-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug hidden on CI and make ci failed if tests failure #29254
Conversation
Interesting, does |
Interesting +1. Is the root problem really fixed?
|
I guess that but unfortunately, it's not right. It must be affected by others. |
@lunny Could you fix the diff --git a/models/migrations/v1_10/v96.go b/models/migrations/v1_10/v96.go
index 34c8240031..2847be57b1 100644
--- a/models/migrations/v1_10/v96.go
+++ b/models/migrations/v1_10/v96.go
@@ -38,7 +38,7 @@ func DeleteOrphanedAttachments(x *xorm.Engine) error {
return err
}
if len(attachments) == 0 {
- return nil
+ break
}
ids := make([]int64, 0, limit)
@@ -58,7 +58,9 @@ func DeleteOrphanedAttachments(x *xorm.Engine) error {
}
}
if len(attachments) < limit {
- return nil
+ break
}
}
+
+ return sess.Commit()
} |
Looks like there is no |
gitea/models/migrations/v1_10/v96.go Lines 24 to 25 in 16f1326
Edit: Nvm, yes, no transaction here. |
Finally fixed all migration tests. It's ready to re-review now. |
I was unable to create a backport for 1.21. @lunny, please send one manually. 🍵
|
* giteaofficial/main: Store webhook event in database (go-gitea#29145) Fix bug hidden on CI and make ci failed if tests failure (go-gitea#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 go-gitea#29602
…9662) 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 <[email protected]>
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