Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#48 Resource Type Pattern does not match Ec2NodeClass #49

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/utils.bash
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

# The pattern for resource types
# (pod, PODs, complex.crd.resource, etc.)
resource_type_pattern="[a-z][a-z.]+"
# (pod, PODs, complex.crd.resource, ec2nodeclass, etc.)
resource_type_pattern="[a-z][0-9a-z.]+"

# The regex for the "try" key word
try_regex_verify_is="^at +most +([0-9]+) +times +every +([0-9]+)s +to +get +($resource_type_pattern) +named +'([^']+)' +and +verify +that +'([^']+)' +is +'([^']+)'$"
Expand Down
9 changes: 9 additions & 0 deletions tests/test.detik.verify.bats
Original file line number Diff line number Diff line change
Expand Up @@ -677,3 +677,12 @@ mytest_with_namespace() {
[ "${lines[0]}" = "Valid expression. Verification in progress..." ]
[ "${lines[1]}" = "Found 2 pods named nginx (instead of less than 1 expected)." ]
}


@test "verifying the number of ec2nodeclass with the lower-case syntax (resource name with a number)" {
run verify "there are 2 ec2nodeclass named 'nginx'"
[ "$status" -eq 0 ]
[ ${#lines[@]} -eq 2 ]
[ "${lines[0]}" = "Valid expression. Verification in progress..." ]
[ "${lines[1]}" = "Found 2 ec2nodeclass named nginx (as expected)." ]
}