Skip to content

Commit dab6f3b

Browse files
authored
test(e2e): add isolation by ensuring unique name (#25724)
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
1 parent 79b0981 commit dab6f3b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1278
-1324
lines changed

test/e2e/admin_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func TestBackupExportImport(t *testing.T) {
1919
var exportRawOutput string
2020
ctx := Given(t)
2121
// Create application in argocd namespace
22-
appctx := appfixture.GivenWithSameState(t)
22+
appctx := appfixture.GivenWithSameState(ctx)
2323

2424
var appTestNamespace Application
2525
var appOtherNamespace Application

test/e2e/app_autosync_ns_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
)
1616

1717
func TestNSAutoSyncSelfHealDisabled(t *testing.T) {
18-
Given(t).
19-
SetTrackingMethod("annotation").
18+
ctx := Given(t)
19+
ctx.SetTrackingMethod("annotation").
2020
Path(guestbookPath).
2121
SetAppNamespace(fixture.AppNamespace()).
2222
// TODO: There is a bug with annotation tracking method that prevents
@@ -37,16 +37,16 @@ func TestNSAutoSyncSelfHealDisabled(t *testing.T) {
3737
// app should not be auto-synced if k8s change detected
3838
When().
3939
And(func() {
40-
errors.NewHandler(t).FailOnErr(fixture.KubeClientset.AppsV1().Deployments(fixture.DeploymentNamespace()).Patch(t.Context(),
40+
errors.NewHandler(t).FailOnErr(fixture.KubeClientset.AppsV1().Deployments(ctx.DeploymentNamespace()).Patch(t.Context(),
4141
"guestbook-ui", types.MergePatchType, []byte(`{"spec": {"revisionHistoryLimit": 0}}`), metav1.PatchOptions{}))
4242
}).
4343
Then().
4444
Expect(SyncStatusIs(SyncStatusCodeOutOfSync))
4545
}
4646

4747
func TestNSAutoSyncSelfHealEnabled(t *testing.T) {
48-
Given(t).
49-
SetTrackingMethod("annotation").
48+
ctx := Given(t)
49+
ctx.SetTrackingMethod("annotation").
5050
Path(guestbookPath).
5151
SetAppNamespace(fixture.AppNamespace()).
5252
When().
@@ -63,7 +63,7 @@ func TestNSAutoSyncSelfHealEnabled(t *testing.T) {
6363
When().
6464
// app should be auto-synced once k8s change detected
6565
And(func() {
66-
errors.NewHandler(t).FailOnErr(fixture.KubeClientset.AppsV1().Deployments(fixture.DeploymentNamespace()).Patch(t.Context(),
66+
errors.NewHandler(t).FailOnErr(fixture.KubeClientset.AppsV1().Deployments(ctx.DeploymentNamespace()).Patch(t.Context(),
6767
"guestbook-ui", types.MergePatchType, []byte(`{"spec": {"revisionHistoryLimit": 0}}`), metav1.PatchOptions{}))
6868
}).
6969
Refresh(RefreshTypeNormal).

test/e2e/app_autosync_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
)
1919

2020
func TestAutoSyncSelfHealDisabled(t *testing.T) {
21-
Given(t).
22-
Path(guestbookPath).
21+
ctx := Given(t)
22+
ctx.Path(guestbookPath).
2323
When().
2424
// app should be auto-synced once created
2525
CreateFromFile(func(app *Application) {
@@ -36,7 +36,7 @@ func TestAutoSyncSelfHealDisabled(t *testing.T) {
3636
// app should not be auto-synced if k8s change detected
3737
When().
3838
And(func() {
39-
errors.NewHandler(t).FailOnErr(fixture.KubeClientset.AppsV1().Deployments(fixture.DeploymentNamespace()).Patch(t.Context(),
39+
errors.NewHandler(t).FailOnErr(fixture.KubeClientset.AppsV1().Deployments(ctx.DeploymentNamespace()).Patch(t.Context(),
4040
"guestbook-ui", types.MergePatchType, []byte(`{"spec": {"revisionHistoryLimit": 0}}`), metav1.PatchOptions{}))
4141
}).
4242
Refresh(RefreshTypeNormal).
@@ -45,8 +45,8 @@ func TestAutoSyncSelfHealDisabled(t *testing.T) {
4545
}
4646

4747
func TestAutoSyncSelfHealEnabled(t *testing.T) {
48-
Given(t).
49-
Path(guestbookPath).
48+
ctx := Given(t)
49+
ctx.Path(guestbookPath).
5050
When().
5151
// app should be auto-synced once created
5252
CreateFromFile(func(app *Application) {
@@ -61,7 +61,7 @@ func TestAutoSyncSelfHealEnabled(t *testing.T) {
6161
When().
6262
// app should be auto-synced once k8s change detected
6363
And(func() {
64-
errors.NewHandler(t).FailOnErr(fixture.KubeClientset.AppsV1().Deployments(fixture.DeploymentNamespace()).Patch(t.Context(),
64+
errors.NewHandler(t).FailOnErr(fixture.KubeClientset.AppsV1().Deployments(ctx.DeploymentNamespace()).Patch(t.Context(),
6565
"guestbook-ui", types.MergePatchType, []byte(`{"spec": {"revisionHistoryLimit": 0}}`), metav1.PatchOptions{}))
6666
}).
6767
Refresh(RefreshTypeNormal).

test/e2e/app_management_ns_test.go

Lines changed: 74 additions & 75 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)