test(api): the invite-only test starts from exactly one account (#8295)
release / go (push) Failing after 1m53s
release / web (push) Successful in 1m17s
release / integration (push) Failing after 3m23s
release / govulncheck (push) Successful in 18s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Publish the release image to GHCR (dispatch only) (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 1m3s
release / android (push) Canceled after 1m26s

The deliberate break letting the second account in without an invite did
not fail it: accounts earlier tests made through sign-up have no test
prefix, survive dbtest's reset, and kept the count above one. The test now
clears users first. The deliberate break stays for one more run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 10:56:44 -05:00
co-authored by Claude Opus 5.5
parent 22f801d8f1
commit 8e44666131
+5
View File
@@ -271,6 +271,11 @@ func TestRegister_OneInviteMakesOneAccountUnderARace(t *testing.T) {
func TestRegister_AfterTheFirstAccountAnInviteIsTheOnlyWayIn(t *testing.T) {
h, pool := testHandlers(t)
resetInvites(t, h)
// Exactly one account, so the first sign-up below is the second account:
// accounts other tests made through sign-up survive dbtest's reset.
if _, err := pool.Exec(context.Background(), "DELETE FROM users"); err != nil {
t.Fatalf("reset users: %v", err)
}
admin := seedUser(t, pool, "admin1", "pw", true)
const token = "test-invite-abc123"
if _, err := pool.Exec(context.Background(),