Skip to content

Commit 4b8bb11

Browse files
committed
e2e tests for complex lease filtering
1 parent 71466fc commit 4b8bb11

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

e2e/tests.bats

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,30 @@ EOF
185185
assert_success
186186
assert_output "No resources found."
187187

188+
# Test complex selectors with matchExpressions (regression test for server-side over-filtering)
189+
jmp create lease --selector 'example.com/firmware=v2,!experimental' --duration 1d
190+
191+
# Partial match: filter with just matchLabels (subset) → should match
192+
run jmp get leases --selector 'example.com/firmware=v2' -o yaml
193+
assert_success
194+
assert_output --partial "example.com/firmware=v2"
195+
196+
# Partial match: filter with just matchExpressions (subset) → should match
197+
# This specifically tests client-side filtering of matchExpressions
198+
run jmp get leases --selector '!experimental' -o yaml
199+
assert_success
200+
assert_output --partial "!experimental"
201+
202+
# Non-matching matchExpressions → should NOT match
203+
run jmp get leases --selector '!production'
204+
assert_success
205+
assert_output "No resources found."
206+
207+
# Filter asks for more than lease has → should NOT match
208+
run jmp get leases --selector 'example.com/firmware=v2,!experimental,region=us'
209+
assert_success
210+
assert_output "No resources found."
211+
188212
jmp delete leases --all
189213
}
190214

0 commit comments

Comments
 (0)