]> source.dussan.org Git - gitea.git/commit
Fix bug hidden on CI and make ci failed if tests failure (#29254) (#29662)
authorLunny Xiao <xiaolunwen@gmail.com>
Sat, 9 Mar 2024 09:44:02 +0000 (17:44 +0800)
committerGitHub <noreply@github.com>
Sat, 9 Mar 2024 09:44:02 +0000 (09:44 +0000)
commite8b6d28ab994a32b345a08241600a5ebbe0c0a4b
tree746133a37d9c32dcbd932abfc0f96a86d07d0b59
parent346b66230519955fc831e75a9cc6175621d63b02
Fix bug hidden on CI and make ci failed if tests failure (#29254) (#29662)

Backport #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 migrations 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.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
.github/workflows/pull-db-tests.yml
Makefile
models/migrations/base/db_test.go
models/migrations/fixtures/Test_AddIssueResourceIndexTable/issue.yml [new file with mode: 0644]
models/migrations/fixtures/Test_AddRepoIDForAttachment/attachment.yml [new file with mode: 0644]
models/migrations/fixtures/Test_AddRepoIDForAttachment/issue.yml [new file with mode: 0644]
models/migrations/fixtures/Test_AddRepoIDForAttachment/release.yml [new file with mode: 0644]
models/migrations/v1_16/v193_test.go