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

chore: Adjust e2e tests for createdAt and createdBy new v1alpha Project.Spec fields #144

Merged
merged 2 commits into from
Jun 11, 2024
Merged
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
7 changes: 5 additions & 2 deletions test/test_helper/load.bash
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,19 @@ _assert_objects_existence() {
case "$1" in
apply)
run_sloctl "${args[*]}"
refute_output --partial "No resources found"
# We can't retrieve the same object we applied so we need to compare the minimum.
filter='[.[] | {"name": .metadata.name, "project": .metadata.project, "labels": .metadata.labels, "annotations": .metadata.annotations}] | sort_by(.name, .project)'
# shellcheck disable=2154
have=$(yq --sort-keys -y '[.[] | del(.status)]' <<<"$output")
have=$(yq --sort-keys -y "$filter" <<<"$output")
want=$(yq --sort-keys -y '[
.[] | select(.kind == "'"$kind"'") |
select(.metadata.name == "'"$name"'") |
if .metadata.project then
select(.metadata.project == "'"$project"'")
else
.
end]' <<<"$2")
end] | '"$filter"'' <<<"$2")
assert_equal "$have" "$want"
;;
delete)
Expand Down
Loading