chore(e2e): update e2e tests to use t.Context() (#6316)
This commit is contained in:
71 files changed
+213
-133
No files matched your search
@@ -26,7 +26,7 @@ func TestCliLdap(t *testing.T) {
|
||||
c, err := loadTestConfig()
|
||||
require.NoError(t, err)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
boundary.AuthenticateAdminCli(t, ctx)
|
||||
orgId, err := boundary.CreateOrgCli(t, ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -5,7 +5,6 @@ package base_plus_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -27,7 +26,7 @@ import (
|
||||
// daemon tried to access the keyring when there wasn't one on the system.
|
||||
func TestCliAuthenticateNoKeyring(t *testing.T) {
|
||||
e2e.MaybeSkipTest(t)
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
bc, err := boundary.LoadConfig()
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
func TestCliKeyDestruction(t *testing.T) {
|
||||
e2e.MaybeSkipTest(t)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
boundary.AuthenticateAdminCli(t, ctx)
|
||||
|
||||
t.Log("Creating scope...")
|
||||
@@ -38,6 +38,7 @@ func TestCliKeyDestruction(t *testing.T) {
|
||||
var scopeReply scopes.ScopeCreateResult
|
||||
require.NoError(t, json.Unmarshal(output.Stdout, &scopeReply))
|
||||
t.Cleanup(func() {
|
||||
ctx := context.Background()
|
||||
output = e2e.RunCommand(ctx, "boundary",
|
||||
e2e.WithArgs(
|
||||
"scopes", "delete",
|
||||
@@ -81,6 +82,7 @@ func TestCliKeyDestruction(t *testing.T) {
|
||||
var amReply authmethods.AuthMethodCreateResult
|
||||
require.NoError(t, json.Unmarshal(output.Stdout, &amReply))
|
||||
t.Cleanup(func() {
|
||||
ctx := context.Background()
|
||||
output = e2e.RunCommand(ctx, "boundary",
|
||||
e2e.WithArgs(
|
||||
"auth-methods", "delete",
|
||||
@@ -244,7 +246,7 @@ func TestApiKeyDestruction(t *testing.T) {
|
||||
client, err := boundary.NewApiClient()
|
||||
require.NoError(t, err)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
sc := scopes.NewClient(client)
|
||||
|
||||
t.Log("Creating scope...")
|
||||
|
||||
@@ -31,7 +31,7 @@ func TestHttpRateLimit(t *testing.T) {
|
||||
bc, err := boundary.LoadConfig()
|
||||
require.NoError(t, err)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
boundary.AuthenticateAdminCli(t, ctx)
|
||||
orgId, err := boundary.CreateOrgCli(t, ctx)
|
||||
require.NoError(t, err)
|
||||
@@ -168,7 +168,8 @@ func TestHttpRateLimit(t *testing.T) {
|
||||
accountId, acctPassword, err := boundary.CreateAccountCli(t, ctx, bc.AuthMethodId, acctName)
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() {
|
||||
boundary.AuthenticateAdminCli(t, context.Background())
|
||||
ctx := context.Background()
|
||||
boundary.AuthenticateAdminCli(t, ctx)
|
||||
output := e2e.RunCommand(ctx, "boundary",
|
||||
e2e.WithArgs("accounts", "delete", "-id", accountId),
|
||||
)
|
||||
@@ -177,7 +178,8 @@ func TestHttpRateLimit(t *testing.T) {
|
||||
userId, err := boundary.CreateUserCli(t, ctx, "global")
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() {
|
||||
boundary.AuthenticateAdminCli(t, context.Background())
|
||||
ctx := context.Background()
|
||||
boundary.AuthenticateAdminCli(t, ctx)
|
||||
output := e2e.RunCommand(ctx, "boundary",
|
||||
e2e.WithArgs("users", "delete", "-id", userId),
|
||||
)
|
||||
@@ -303,7 +305,7 @@ func TestCliRateLimit(t *testing.T) {
|
||||
bc, err := boundary.LoadConfig()
|
||||
require.NoError(t, err)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
boundary.AuthenticateAdminCli(t, ctx)
|
||||
orgId, err := boundary.CreateOrgCli(t, ctx)
|
||||
@@ -326,7 +328,8 @@ func TestCliRateLimit(t *testing.T) {
|
||||
accountId, acctPassword, err := boundary.CreateAccountCli(t, ctx, bc.AuthMethodId, acctName)
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() {
|
||||
boundary.AuthenticateAdminCli(t, context.Background())
|
||||
ctx := context.Background()
|
||||
boundary.AuthenticateAdminCli(t, ctx)
|
||||
output := e2e.RunCommand(ctx, "boundary",
|
||||
e2e.WithArgs("accounts", "delete", "-id", accountId),
|
||||
)
|
||||
@@ -335,7 +338,8 @@ func TestCliRateLimit(t *testing.T) {
|
||||
userId, err := boundary.CreateUserCli(t, ctx, "global")
|
||||
require.NoError(t, err)
|
||||
t.Cleanup(func() {
|
||||
boundary.AuthenticateAdminCli(t, context.Background())
|
||||
ctx := context.Background()
|
||||
boundary.AuthenticateAdminCli(t, ctx)
|
||||
output := e2e.RunCommand(ctx, "boundary",
|
||||
e2e.WithArgs("users", "delete", "-id", userId),
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ func TestCliTcpTargetConnectPostgres(t *testing.T) {
|
||||
c, err := loadTestConfig()
|
||||
require.NoError(t, err)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
boundary.AuthenticateAdminCli(t, ctx)
|
||||
orgId, err := boundary.CreateOrgCli(t, ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in new issue
Block a user