refact(e2e): Add context as an argument for cli methods

This was done have some alignment with the corresponding api methods as well as matching standard Go conventions.
This commit is contained in:
Michael Li committed 2022-10-25 16:23:52 -04:00
1 parent a956e8dec9
commit 57ffc71849
15 files changed
+107 -110

No files matched your search

+4 -5
View File
@@ -29,8 +29,7 @@ func CreateNewUserApi(t testing.TB, ctx context.Context, client *api.Client, sco
// CreateNewUserCli creates a new user using the cli.
// Returns the id of the new user
func CreateNewUserCli(t testing.TB, scopeId string) string {
ctx := context.Background()
func CreateNewUserCli(t testing.TB, ctx context.Context, scopeId string) string {
output := e2e.RunCommand(ctx, "boundary",
e2e.WithArgs(
"users", "create",
@@ -48,7 +47,7 @@ func CreateNewUserCli(t testing.TB, scopeId string) string {
newUserId := newUserResult.Item.Id
t.Cleanup(func() {
AuthenticateAdminCli(t)
AuthenticateAdminCli(t, context.Background())
output := e2e.RunCommand(ctx, "boundary",
e2e.WithArgs("users", "delete", "-id", newUserId),
)
@@ -60,8 +59,8 @@ func CreateNewUserCli(t testing.TB, scopeId string) string {
}
// SetAccountToUserCli sets an account to a the specified user using the cli.
func SetAccountToUserCli(t testing.TB, userId string, accountId string) {
output := e2e.RunCommand(context.Background(), "boundary",
func SetAccountToUserCli(t testing.TB, ctx context.Context, userId string, accountId string) {
output := e2e.RunCommand(ctx, "boundary",
e2e.WithArgs(
"users", "set-accounts",
"-id", userId,