Skip to content

Commit

Permalink
improve test logic
Browse files Browse the repository at this point in the history
Signed-off-by: pashakostohrys <[email protected]>
  • Loading branch information
pasha-codefresh committed Aug 11, 2023
1 parent a6ca21e commit 3ec21af
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/e2e/sync_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,26 @@ func TestSyncWithStatusIgnored(t *testing.T) {
}

func TestSyncWithApplyOutOfSyncOnly(t *testing.T) {
var ns string
Given(t).
Path(guestbookPath).
ApplyOutOfSyncOnly().
When().
CreateFromFile(func(app *Application) {
ns = app.Spec.Destination.Namespace
}).
Then().
Expect(SyncStatusIs(SyncStatusCodeOutOfSync)).
When().
Sync().
Then().
When().
PatchFile("guestbook-ui-deployment.yaml", `[{ "op": "replace", "path": "/spec/replicas", "value": 1 }]`).
Sync().
Then().
Expect(ResourceResultIs(ResourceResult{Group: "apps", Version: "v1", Kind: "Deployment", Namespace: "guestbook", Name: "guestbook-ui", Message: "deployment.apps/guestbook-ui created", SyncPhase: SyncPhaseSync, HookPhase: OperationRunning}))
// Only one resource should be in sync result
Expect(ResourceResultNumbering(1)).
Expect(ResourceResultIs(ResourceResult{Group: "apps", Version: "v1", Kind: "Deployment", Namespace: ns, Name: "guestbook-ui", Message: "deployment.apps/guestbook-ui configured", SyncPhase: SyncPhaseSync, HookPhase: OperationRunning, Status: ResultCodeSynced}))
}

func TestSyncWithSkipHook(t *testing.T) {
Expand Down

0 comments on commit 3ec21af

Please sign in to comment.