Skip to content

Commit

Permalink
Replace sleep with Assert for ensuring resources are reconciled
Browse files Browse the repository at this point in the history
  • Loading branch information
Baarsgaard committed Oct 24, 2024
1 parent 70c16be commit 0873848
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions tests/e2e/immutable_uids/grafanadashboard/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,52 @@ spec:
spec:
uid: SpecUID

- name: Ensure Grafana and other resources are ready
try:
- assert:
resource:
apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
metadata:
name: grafana-immutable
status:
stage: complete
stageStatus: success

- assert:
resource:
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: dashboard-uid
status:
conditions:
- reason: ApplySuccessful
status: "True"
type: DashboardSynchronized
- assert:
resource:
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: metadata-uid
status:
conditions:
- reason: ApplySuccessful
status: "True"
type: DashboardSynchronized
- assert:
resource:
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
name: spec-uid
status:
conditions:
- reason: ApplySuccessful
status: "True"
type: DashboardSynchronized

- name: Verify uid in Grafana Instance status object
try:
- script:
Expand All @@ -156,9 +202,6 @@ spec:
- name: specUid
value: (json_parse($stdout))

- sleep:
duration: 30s

- assert:
resource:
apiVersion: grafana.integreatly.org/v1beta1
Expand Down

0 comments on commit 0873848

Please sign in to comment.