From 22729faee95c89ee1b31bfe8d31b6c57bd8b4843 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 31 May 2024 15:16:52 -0300 Subject: [PATCH] Cleanup e2e tests Signed-off-by: Juan Cruz Viotti --- test/format_cwd.sh | 21 ++------------------- test/format_invalid_path.sh | 2 -- test/lint_fail.sh | 2 -- test/lint_fix.sh | 1 - test/lint_pass.sh | 1 - test/test_single_fail.sh | 2 -- test/test_single_unsupported.sh | 2 -- test/validate_fail.sh | 2 -- test/validate_non_supported.sh | 2 -- 9 files changed, 2 insertions(+), 33 deletions(-) diff --git a/test/format_cwd.sh b/test/format_cwd.sh index bd7b41e2..450cde73 100755 --- a/test/format_cwd.sh +++ b/test/format_cwd.sh @@ -40,22 +40,5 @@ cat << 'EOF' > "$TMP/expected_2.json" } EOF -if ! cmp -s "$TMP/schema_1.json" "$TMP/expected_1.json" -then - echo "GOT:" 1>&2 - cat "$TMP/schema_1.json" 1>&2 - echo "EXPECTED:" 1>&2 - cat "$TMP/expected_1.json" 1>&2 - echo "FAIL" 1>&2 - exit 1 -fi - -if ! cmp -s "$TMP/schema_2.json" "$TMP/expected_2.json" -then - echo "GOT:" 1>&2 - cat "$TMP/schema_2.json" 1>&2 - echo "EXPECTED:" 1>&2 - cat "$TMP/expected_2.json" 1>&2 - echo "FAIL" 1>&2 - exit 1 -fi +diff "$TMP/schema_1.json" "$TMP/expected_1.json" +diff "$TMP/schema_2.json" "$TMP/expected_2.json" diff --git a/test/format_invalid_path.sh b/test/format_invalid_path.sh index 387de5be..44243a26 100755 --- a/test/format_invalid_path.sh +++ b/test/format_invalid_path.sh @@ -4,7 +4,6 @@ set -o errexit set -o nounset TMP="$(mktemp -d)" -# shellcheck disable=SC2317 clean() { rm -rf "$TMP"; } trap clean EXIT @@ -16,5 +15,4 @@ then exit 1 else echo "PASS" 1>&2 - exit 0 fi diff --git a/test/lint_fail.sh b/test/lint_fail.sh index 19920df0..224057b5 100755 --- a/test/lint_fail.sh +++ b/test/lint_fail.sh @@ -4,7 +4,6 @@ set -o errexit set -o nounset TMP="$(mktemp -d)" -# shellcheck disable=SC2317 clean() { rm -rf "$TMP"; } trap clean EXIT @@ -24,5 +23,4 @@ then exit 1 else echo "PASS" 1>&2 - exit 0 fi diff --git a/test/lint_fix.sh b/test/lint_fix.sh index 5f9e2853..62c0da09 100755 --- a/test/lint_fix.sh +++ b/test/lint_fix.sh @@ -4,7 +4,6 @@ set -o errexit set -o nounset TMP="$(mktemp -d)" -# shellcheck disable=SC2317 clean() { rm -rf "$TMP"; } trap clean EXIT diff --git a/test/lint_pass.sh b/test/lint_pass.sh index 2caa83ba..3eadfbf9 100755 --- a/test/lint_pass.sh +++ b/test/lint_pass.sh @@ -4,7 +4,6 @@ set -o errexit set -o nounset TMP="$(mktemp -d)" -# shellcheck disable=SC2317 clean() { rm -rf "$TMP"; } trap clean EXIT diff --git a/test/test_single_fail.sh b/test/test_single_fail.sh index 9d129cef..1f414bc9 100755 --- a/test/test_single_fail.sh +++ b/test/test_single_fail.sh @@ -4,7 +4,6 @@ set -o errexit set -o nounset TMP="$(mktemp -d)" -# shellcheck disable=SC2317 clean() { rm -rf "$TMP"; } trap clean EXIT @@ -35,5 +34,4 @@ then exit 1 else echo "PASS" 1>&2 - exit 0 fi diff --git a/test/test_single_unsupported.sh b/test/test_single_unsupported.sh index 65389958..963c38c5 100755 --- a/test/test_single_unsupported.sh +++ b/test/test_single_unsupported.sh @@ -4,7 +4,6 @@ set -o errexit set -o nounset TMP="$(mktemp -d)" -# shellcheck disable=SC2317 clean() { rm -rf "$TMP"; } trap clean EXIT @@ -35,5 +34,4 @@ then exit 1 else echo "PASS" 1>&2 - exit 0 fi diff --git a/test/validate_fail.sh b/test/validate_fail.sh index 781778be..bf3933d1 100755 --- a/test/validate_fail.sh +++ b/test/validate_fail.sh @@ -4,7 +4,6 @@ set -o errexit set -o nounset TMP="$(mktemp -d)" -# shellcheck disable=SC2317 clean() { rm -rf "$TMP"; } trap clean EXIT @@ -32,5 +31,4 @@ then exit 1 else echo "PASS" 1>&2 - exit 0 fi diff --git a/test/validate_non_supported.sh b/test/validate_non_supported.sh index 3efd5fb7..b1e14ac3 100755 --- a/test/validate_non_supported.sh +++ b/test/validate_non_supported.sh @@ -4,7 +4,6 @@ set -o errexit set -o nounset TMP="$(mktemp -d)" -# shellcheck disable=SC2317 clean() { rm -rf "$TMP"; } trap clean EXIT @@ -32,5 +31,4 @@ then exit 1 else echo "PASS" 1>&2 - exit 0 fi