test: rename ExpectMatchContext to ExpectMatch (#25998)

Cleans the last few instances of ExpectMatch that didn't use the new `(ctx, ...)` variant, then deletes the deprecated method and renames `ExpectMatchContext` to drop the `Context` suffix.
This commit is contained in:
Spike Curtis
2026-06-03 15:30:37 -04:00
committed by GitHub
parent 7d7cc27581
commit 5b692bf1cc
66 changed files with 524 additions and 536 deletions
+20 -20
View File
@@ -131,14 +131,14 @@ func TestServerCreateAdminUser(t *testing.T) {
stdout := expecter.NewAttachedToInvocation(t, inv)
clitest.Start(t, inv)
stdout.ExpectMatchContext(ctx, "Creating user...")
stdout.ExpectMatchContext(ctx, "Generating user SSH key...")
stdout.ExpectMatchContext(ctx, fmt.Sprintf("Adding user to organization %q (%s) as admin...", org1Name, org1ID.String()))
stdout.ExpectMatchContext(ctx, fmt.Sprintf("Adding user to organization %q (%s) as admin...", org2Name, org2ID.String()))
stdout.ExpectMatchContext(ctx, "User created successfully.")
stdout.ExpectMatchContext(ctx, username)
stdout.ExpectMatchContext(ctx, email)
stdout.ExpectMatchContext(ctx, "****")
stdout.ExpectMatch(ctx, "Creating user...")
stdout.ExpectMatch(ctx, "Generating user SSH key...")
stdout.ExpectMatch(ctx, fmt.Sprintf("Adding user to organization %q (%s) as admin...", org1Name, org1ID.String()))
stdout.ExpectMatch(ctx, fmt.Sprintf("Adding user to organization %q (%s) as admin...", org2Name, org2ID.String()))
stdout.ExpectMatch(ctx, "User created successfully.")
stdout.ExpectMatch(ctx, username)
stdout.ExpectMatch(ctx, email)
stdout.ExpectMatch(ctx, "****")
verifyUser(t, connectionURL, username, email, password)
})
@@ -165,10 +165,10 @@ func TestServerCreateAdminUser(t *testing.T) {
stdout := expecter.NewAttachedToInvocation(t, inv)
clitest.Start(t, inv)
stdout.ExpectMatchContext(ctx, "User created successfully.")
stdout.ExpectMatchContext(ctx, username)
stdout.ExpectMatchContext(ctx, email)
stdout.ExpectMatchContext(ctx, "****")
stdout.ExpectMatch(ctx, "User created successfully.")
stdout.ExpectMatch(ctx, username)
stdout.ExpectMatch(ctx, email)
stdout.ExpectMatch(ctx, "****")
verifyUser(t, connectionURL, username, email, password)
})
@@ -197,19 +197,19 @@ func TestServerCreateAdminUser(t *testing.T) {
clitest.Start(t, inv)
stdout.ExpectMatchContext(ctx, "Username")
stdout.ExpectMatch(ctx, "Username")
stdin.WriteLine(username)
stdout.ExpectMatchContext(ctx, "Email")
stdout.ExpectMatch(ctx, "Email")
stdin.WriteLine(email)
stdout.ExpectMatchContext(ctx, "Password")
stdout.ExpectMatch(ctx, "Password")
stdin.WriteLine(password)
stdout.ExpectMatchContext(ctx, "Confirm password")
stdout.ExpectMatch(ctx, "Confirm password")
stdin.WriteLine(password)
stdout.ExpectMatchContext(ctx, "User created successfully.")
stdout.ExpectMatchContext(ctx, username)
stdout.ExpectMatchContext(ctx, email)
stdout.ExpectMatchContext(ctx, "****")
stdout.ExpectMatch(ctx, "User created successfully.")
stdout.ExpectMatch(ctx, username)
stdout.ExpectMatch(ctx, email)
stdout.ExpectMatch(ctx, "****")
verifyUser(t, connectionURL, username, email, password)
})