test(api): merge repeated cases into tables, drop skips dbtest already makes (#8295)
release / web (push) Successful in 1m34s
release / go (push) Successful in 2m0s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 3m24s
release / android (push) Successful in 4m46s
release / Build signed APK (push) Successful in 5m12s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Publish the release image to GHCR (dispatch only) (push) Skipped
release / Build + push container image (push) Successful in 29s
release / Verify release artifacts (tag releases only) (push) Skipped
release / web (push) Successful in 1m34s
release / go (push) Successful in 2m0s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 3m24s
release / android (push) Successful in 4m46s
release / Build signed APK (push) Successful in 5m12s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Publish the release image to GHCR (dispatch only) (push) Skipped
release / Build + push container image (push) Successful in 29s
release / Verify release artifacts (tag releases only) (push) Skipped
- The like/unlike story runs as one sequence that checks the rows after each step. - The invite-only sign-up cases are one test, which now also checks that a refused sign-up creates no account. - Demoting an admin, and stopping at the last one, is one test. - A wrong password and an unknown user are one test, which now also checks that the two refusals are identical. - The cover-path resolver tests repeated the cover handler's tests branch for branch; the handler tests stay. - The Range-from-start stream test only re-checked http.ServeContent. - The APK's nil-user 401 is covered by the mounted-route walk. - 68 copies of the MINSTREL_TEST_DATABASE_URL skip go: every one of those tests reaches dbtest.Pool, which already skips. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -14,9 +13,6 @@ import (
|
||||
)
|
||||
|
||||
func TestResetPassword_Happy(t *testing.T) {
|
||||
if os.Getenv("MINSTREL_TEST_DATABASE_URL") == "" {
|
||||
t.Skip("MINSTREL_TEST_DATABASE_URL not set")
|
||||
}
|
||||
h, pool := testHandlers(t)
|
||||
user := seedUser(t, pool, "resetuser", "oldpw1234", false)
|
||||
|
||||
@@ -61,9 +57,6 @@ func TestResetPassword_Happy(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestResetPassword_AlreadyUsed_400(t *testing.T) {
|
||||
if os.Getenv("MINSTREL_TEST_DATABASE_URL") == "" {
|
||||
t.Skip("MINSTREL_TEST_DATABASE_URL not set")
|
||||
}
|
||||
h, pool := testHandlers(t)
|
||||
user := seedUser(t, pool, "alreadyused", "pw", false)
|
||||
|
||||
@@ -87,9 +80,6 @@ func TestResetPassword_AlreadyUsed_400(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestResetPassword_Expired_400(t *testing.T) {
|
||||
if os.Getenv("MINSTREL_TEST_DATABASE_URL") == "" {
|
||||
t.Skip("MINSTREL_TEST_DATABASE_URL not set")
|
||||
}
|
||||
h, pool := testHandlers(t)
|
||||
user := seedUser(t, pool, "expiredreset", "pw", false)
|
||||
|
||||
@@ -113,9 +103,6 @@ func TestResetPassword_Expired_400(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestResetPassword_PasswordTooShort_400(t *testing.T) {
|
||||
if os.Getenv("MINSTREL_TEST_DATABASE_URL") == "" {
|
||||
t.Skip("MINSTREL_TEST_DATABASE_URL not set")
|
||||
}
|
||||
h, _ := testHandlers(t)
|
||||
body := `{"token":"any-token","new_password":"abc"}`
|
||||
req := httptest.NewRequest(http.MethodPost, "/api/auth/reset-password",
|
||||
@@ -128,9 +115,6 @@ func TestResetPassword_PasswordTooShort_400(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestResetPassword_BogusToken_400(t *testing.T) {
|
||||
if os.Getenv("MINSTREL_TEST_DATABASE_URL") == "" {
|
||||
t.Skip("MINSTREL_TEST_DATABASE_URL not set")
|
||||
}
|
||||
h, _ := testHandlers(t)
|
||||
|
||||
body := `{"token":"bogus-token","new_password":"abcd1234"}`
|
||||
@@ -147,9 +131,6 @@ func TestResetPassword_BogusToken_400(t *testing.T) {
|
||||
// A reset ends Subsonic apps' access too: they sign in with the API key or
|
||||
// the Subsonic password, which whoever had the account could have made.
|
||||
func TestResetPassword_SignsOutSubsonicApps(t *testing.T) {
|
||||
if os.Getenv("MINSTREL_TEST_DATABASE_URL") == "" {
|
||||
t.Skip("MINSTREL_TEST_DATABASE_URL not set")
|
||||
}
|
||||
h, pool := testHandlers(t)
|
||||
user := seedUser(t, pool, "resetsubsonic", "oldpw1234", false)
|
||||
giveSubsonicPassword(t, h, user)
|
||||
|
||||
Reference in New Issue
Block a user