Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
Fix notification tests with eventually (#3539)
Browse files Browse the repository at this point in the history
* assert scenarios labels with eventually

* change format of eventually

* change image tag

* remove log

---------

Co-authored-by: PetarTodorovv <31803034+PetarTodorovv@users.noreply.github.com>
  • Loading branch information
ognyvrac and PetarTodorovv authored Dec 13, 2023
1 parent 3a8269a commit b3ae91d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion chart/compass/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ global:
name: compass-console
e2e_tests:
dir: dev/incubator/
version: "PR-3536"
version: "PR-3539"
name: compass-e2e-tests
isLocalEnv: false
isForTesting: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,13 +652,19 @@ func TestFormationNotificationsWithRuntimeAndApplicationParticipants(stdT *testi
assertSeveralFormationAssignmentsNotifications(t, notificationsForConsumerTenant, rtCtx, formation.ID, regionLbl, unassignOperation, subscriptionConsumerAccountID, emptyParentCustomerID, 1)

t.Logf("Check that application with ID %q is unassigned from formation %s", app1.ID, formationName)
app := fixtures.GetApplication(t, ctx, certSecuredGraphQLClient, subscriptionConsumerAccountID, app1.ID)
scenarios, hasScenarios := app.Labels["scenarios"]
assert.False(t, hasScenarios)
require.Eventually(t, func() (doesNotHaveScenarioLabels bool) {
app := fixtures.GetApplication(t, ctx, certSecuredGraphQLClient, subscriptionConsumerAccountID, app1.ID)
_, hasScenarios := app.Labels["scenarios"]
if hasScenarios != false {
log.C(ctx).Infof("Application with ID %s is still part of formation %s", app1.ID, formationName)
return false
}
return true
}, eventuallyTimeout, eventuallyTick)

t.Logf("Check that runtime context with ID %q is still assigned to formation %s", subscriptionConsumerSubaccountID, formationName)
actualRtmCtx := fixtures.GetRuntimeContext(t, ctx, certSecuredGraphQLClient, subscriptionConsumerAccountID, consumerSubaccountRuntime.ID, rtCtx.ID)
scenarios, hasScenarios = actualRtmCtx.Labels["scenarios"]
scenarios, hasScenarios := actualRtmCtx.Labels["scenarios"]
assert.True(t, hasScenarios)
assert.Len(t, scenarios, 1)
assert.Contains(t, scenarios, formationName)
Expand Down

0 comments on commit b3ae91d

Please sign in to comment.