Skip to content

Commit 58d7558

Browse files
test(e2e): fix chainsaw condition assertions to filter-as-list form
The (conditions[?type == 'Ready'])[0] indexed-filter idiom fails in chainsaw v0.2.15 with 'field not found in the input object'. Use the filter-as-list form instead. Verified: both tests pass end-to-end against a live cluster. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent cde39df commit 58d7558

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎hack/e2e-chainsaw/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ The two-step dance exists because `kubectl wait` fails immediately when the obje
2929
metadata:
3030
name: postgres-test
3131
status:
32-
(conditions[?type == 'Ready'])[0]:
33-
status: "True"
32+
(conditions[?type == 'Ready']):
33+
- status: "True"
3434
```
3535
3636
What this buys us:

‎hack/e2e-chainsaw/bucket/chainsaw-test.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ spec:
3434
metadata:
3535
name: bucket-test
3636
status:
37-
(conditions[?type == 'Ready'])[0]:
38-
status: "True"
37+
(conditions[?type == 'Ready']):
38+
- status: "True"
3939
# Replaces `until kubectl get ...` + `kubectl wait --for=jsonpath=...`
4040
# pairs: one assert handles both existence and the status field.
4141
- assert:

‎hack/e2e-chainsaw/postgres/chainsaw-test.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ spec:
3737
name: postgres-test
3838
status:
3939
# JMESPath filter: condition order in the array does not matter
40-
(conditions[?type == 'Ready'])[0]:
41-
status: "True"
40+
(conditions[?type == 'Ready']):
41+
- status: "True"
4242

4343
- name: wait-init-job-complete
4444
try:
@@ -50,8 +50,8 @@ spec:
5050
metadata:
5151
name: postgres-test-init-job
5252
status:
53-
(conditions[?type == 'Complete'])[0]:
54-
status: "True"
53+
(conditions[?type == 'Complete']):
54+
- status: "True"
5555

5656
- name: verify-services-and-endpoints
5757
try:

0 commit comments

Comments
 (0)