From 7204692e3acc91f60b151b6f0d2ac81584ba446b Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Fri, 21 Aug 2020 18:43:55 +0200 Subject: [PATCH] Use test name instead of arbitrary string that needs to be different for each test Signed-off-by: Guillaume Tardif --- tests/aci-e2e/e2e-aci_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/aci-e2e/e2e-aci_test.go b/tests/aci-e2e/e2e-aci_test.go index 9c3e6ac2a..7de7a4606 100644 --- a/tests/aci-e2e/e2e-aci_test.go +++ b/tests/aci-e2e/e2e-aci_test.go @@ -126,7 +126,7 @@ func TestLoginLogout(t *testing.T) { func TestContainerRun(t *testing.T) { c := NewParallelE2eCLI(t, binDir) - sID, rg := setupTestResourceGroup(t, c, "run") + sID, rg := setupTestResourceGroup(t, c) const ( testShareName = "dockertestshare" @@ -284,7 +284,7 @@ func TestContainerRun(t *testing.T) { func TestContainerRunAttached(t *testing.T) { c := NewParallelE2eCLI(t, binDir) - _, _ = setupTestResourceGroup(t, c, "runA") + _, _ = setupTestResourceGroup(t, c) // Used in subtests var ( @@ -390,7 +390,7 @@ func TestContainerRunAttached(t *testing.T) { func TestCompose(t *testing.T) { c := NewParallelE2eCLI(t, binDir) - _, _ = setupTestResourceGroup(t, c, "compose") + _, _ = setupTestResourceGroup(t, c) const ( composeFile = "../composefiles/aci-demo/aci_demo_port.yaml" @@ -491,7 +491,7 @@ func TestCompose(t *testing.T) { func TestRunEnvVars(t *testing.T) { c := NewParallelE2eCLI(t, binDir) - _, _ = setupTestResourceGroup(t, c, "runEnv") + _, _ = setupTestResourceGroup(t, c) t.Run("run", func(t *testing.T) { cmd := c.NewDockerCmd( @@ -525,9 +525,9 @@ func TestRunEnvVars(t *testing.T) { }) } -func setupTestResourceGroup(t *testing.T, c *E2eCLI, tName string) (string, string) { +func setupTestResourceGroup(t *testing.T, c *E2eCLI) (string, string) { startTime := strconv.Itoa(int(time.Now().Unix())) - rg := "E2E-" + tName + "-" + startTime + rg := "E2E-" + t.Name() + "-" + startTime azureLogin(t, c) sID := getSubscriptionID(t) err := createResourceGroup(sID, rg)