Skip to content

Commit

Permalink
Fix flaky tests. Use jq to sort JSON arrays before comparing them. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mindaugasrukas authored Apr 13, 2022
1 parent 8fce540 commit 7f7bede
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testing/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ function test_new_container_push_skip_unchanged_digest_changed() {
cid=$(docker run --rm -d -p 5000:5000 --name registry registry:2)
EXPECT_CONTAINS "$(bazel run @io_bazel_rules_docker//tests/container:new_push_test_skip_unchanged_digest_changed_tag_1 2>&1)" "Successfully pushed Docker image"
EXPECT_CONTAINS "$(bazel run @io_bazel_rules_docker//tests/container:new_push_test_skip_unchanged_digest_changed_tag_2 2>&1)" "Successfully pushed Docker image"
EXPECT_CONTAINS "$(curl localhost:5000/v2/docker/test/tags/list)" '{"name":"docker/test","tags":["changed_tag1","changed_tag2"]}'
EXPECT_CONTAINS "$(curl -s localhost:5000/v2/docker/test/tags/list | jq --sort-keys -c '(.. | arrays) |= sort')" '{"name":"docker/test","tags":["changed_tag1","changed_tag2"]}'
}

function test_new_container_push_compat() {
Expand Down

0 comments on commit 7f7bede

Please sign in to comment.