forgejo/models
Lunny Xiao 97c8dbf332
Fix bug hidden on CI and make ci failed if tests failure (#29254)
The tests on migration tests failed but CI reports successfully

https://github.com/go-gitea/gitea/actions/runs/7364373807/job/20044685969#step:8:141

This PR will fix the bug on migration v283 and also the CI hidden
behaviour.

The reason is on the Makefile

`GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(MIGRATE_TEST_PACKAGES)` will
return the error exit code.

But

`for pkg in $(shell $(GO) list
code.gitea.io/gitea/models/migrations/...); do \
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test
$(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
	done`

will not work.

This also fix #29602

(cherry picked from commit 45277486c2c6213b7766b1da708a991cdb1f3565)

Conflicts:
	.github/workflows/pull-db-tests.yml
	Makefile
	models/migrations/v1_22/v283.go
	models/migrations/v1_22/v286_test.go
	models/migrations/v1_22/v287_test.go
	already in Forgejo for the Makefile & CI logic but Gitea changes
	otherwise rule
2024-03-11 23:36:59 +07:00
..
actions remove util.OptionalBool and related functions (#29513) 2024-03-06 12:10:46 +08:00
activities Avoid issue info panic (#29625) 2024-03-11 23:36:58 +07:00
admin Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
asymkey [GITEA] Add noreply email address as verified for SSH signed Git commits 2024-02-05 16:09:40 +01:00
auth remove util.OptionalBool and related functions (#29513) 2024-03-06 12:10:46 +08:00
avatars Refactor some legacy code and remove unused code (#28622) 2023-12-28 09:38:59 +00:00
db feat(xorm): add max idle time setting for db connections (#2418) 2024-02-21 12:17:16 +00:00
dbfs make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
fixtures Actions Artifacts v4 backend (#28965) 2024-03-06 12:10:45 +08:00
forgejo/semver [SEMVER] store SemVer in ForgejoSemVer after a database upgrade 2024-02-05 14:44:33 +01:00
forgejo_migrations [GITEA] Allow changing the repo Wiki branch to main 2024-02-05 16:57:47 +01:00
git Start to migrate from util.OptionalBool to optional.Option[bool] (#29329) 2024-02-26 22:30:26 +01:00
issues Merge pull request '[BUG] Disable CODEOWNERS for forked repositories' (#2537) from gusted/forgejo-codeowner-forked into forgejo 2024-03-06 18:18:58 +00:00
migrations Fix bug hidden on CI and make ci failed if tests failure (#29254) 2024-03-11 23:36:59 +07:00
organization Remove unused KeyID. (#29167) 2024-02-16 15:20:52 +01:00
packages Fix incorrect relative/absolute URL usages (#29531) 2024-03-06 12:10:46 +08:00
perm Users with read permission of pull requests can be assigned too (#27263) 2024-02-26 22:30:27 +01:00
project remove util.OptionalBool and related functions (#29513) 2024-03-06 12:10:46 +08:00
pull [GITEA] GetScheduledMergeByPullID may involve a system user 2024-02-05 16:09:41 +01:00
repo remove util.OptionalBool and related functions (#29513) 2024-03-06 12:10:46 +08:00
secret Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
shared/types Refactor locale&string&template related code (#29165) 2024-02-16 15:20:52 +01:00
system Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
unit Add a direct link from repo header to unit settings 2024-02-13 22:42:09 +01:00
unittest Workaround to clean up old reviews on creating a new one (#28554) 2024-02-26 21:42:14 +01:00
user Skip email domain check when admins edit user emails (#29609) 2024-03-11 23:36:58 +07:00
webhook remove util.OptionalBool and related functions (#29513) 2024-03-06 12:10:46 +08:00
error.go Add merge style fast-forward-only (#28954) 2024-02-14 17:19:19 +01:00
fixture_generation.go Replace more db.DefaultContext (#27628) 2023-10-15 17:46:06 +02:00
fixture_test.go Replace more db.DefaultContext (#27628) 2023-10-15 17:46:06 +02:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
org.go Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
org_team.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
org_team_test.go Reduce usage of db.DefaultContext (#27073) 2023-09-14 17:09:32 +00:00
org_test.go Replace more db.DefaultContext (#27628) 2023-10-15 17:46:06 +02:00
repo.go Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
repo_test.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
repo_transfer.go [MODERATION] User blocking 2024-02-05 15:56:45 +01:00
repo_transfer_test.go [MODERATION] User blocking 2024-02-05 15:56:45 +01:00