From 53da1df474bae8c7ac77174a36dbf635bf0c64cc Mon Sep 17 00:00:00 2001 From: Ganeson Date: Thu, 7 Oct 2021 16:09:03 +0530 Subject: [PATCH 1/5] Issue #27 Fix: Test runner : duplicate lines in error output Fix for issue #27 that outputs duplicate lines in error output line #56 command the prints the statement (;p) is removed --- bin/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/run.sh b/bin/run.sh index a2f524d..672b689 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -53,7 +53,7 @@ popd > /dev/null if [ $exit_code -eq 0 ] && [ $error -eq 0 ]; then jq -n '{version: 1, status: "pass"}' > ${results_file} else - sanitized_test_output=$(echo "${test_output}" | sed -E -e 's/-+ Error -+//g' -e '/./,$!d' -e '/Phase: /q;p') + sanitized_test_output=$(echo "${test_output}" | sed -E -e 's/-+ Error -+//g' -e '/./,$!d' -e '/Phase: /q') jq -n --arg output "${sanitized_test_output}" '{version: 1, status: "fail", message: $output}' > ${results_file} fi From 38ec5b6fae3b67d59e21a0108fbe6c1cf3551452 Mon Sep 17 00:00:00 2001 From: Ganeson Date: Fri, 8 Oct 2021 10:50:13 +0530 Subject: [PATCH 2/5] Test-Runner issue#27 fix Added comments --- bin/run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/run.sh b/bin/run.sh index 672b689..df83b05 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -53,6 +53,7 @@ popd > /dev/null if [ $exit_code -eq 0 ] && [ $error -eq 0 ]; then jq -n '{version: 1, status: "pass"}' > ${results_file} else + # Removed /q;p and replaced with /q sanitized_test_output=$(echo "${test_output}" | sed -E -e 's/-+ Error -+//g' -e '/./,$!d' -e '/Phase: /q') jq -n --arg output "${sanitized_test_output}" '{version: 1, status: "fail", message: $output}' > ${results_file} From df66be0cb858d38772ac8a8f352e9fc7cbfb2831 Mon Sep 17 00:00:00 2001 From: GANES1998 Date: Fri, 8 Oct 2021 11:49:09 +0530 Subject: [PATCH 3/5] one failed test case exepected results changed --- tests/example-all-fail/expected_results.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/example-all-fail/expected_results.json b/tests/example-all-fail/expected_results.json index 55a222b..79b2644 100644 --- a/tests/example-all-fail/expected_results.json +++ b/tests/example-all-fail/expected_results.json @@ -1,5 +1,5 @@ { "version": 1, "status": "fail", - "message": "Testing example-all-fail-test\nTesting example-all-fail-test\n\n\nERROR in (year-not-divisible-by-4) (:13:9)\nERROR in (year-not-divisible-by-4) (:13:9)\nexpected: (not (example-all-fail/leap-year? 2999))\nexpected: (not (example-all-fail/leap-year? 2999))\n actual: #object[Error Error: Cannot call false as a function.]\n actual: #object[Error Error: Cannot call false as a function.]\n\n\nERROR in (year-divisible-by-2-but-not-4) (:17:9)\nERROR in (year-divisible-by-2-but-not-4) (:17:9)\nexpected: (not (example-all-fail/leap-year? 1658))\nexpected: (not (example-all-fail/leap-year? 1658))\n actual: #object[Error Error: Cannot call false as a function.]\n actual: #object[Error Error: Cannot call false as a function.]\n\n\nERROR in (year-divisible-by-4-but-not-100) (:21:9)\nERROR in (year-divisible-by-4-but-not-100) (:21:9)\nexpected: (example-all-fail/leap-year? 2004)\nexpected: (example-all-fail/leap-year? 2004)\n actual: #object[Error Error: Cannot call true as a function.]\n actual: #object[Error Error: Cannot call true as a function.]\n\n\nERROR in (year-divisible-by-4-and-5) (:25:9)\nERROR in (year-divisible-by-4-and-5) (:25:9)\nexpected: (example-all-fail/leap-year? 2020)\nexpected: (example-all-fail/leap-year? 2020)\n actual: #object[Error Error: Cannot call true as a function.]\n actual: #object[Error Error: Cannot call true as a function.]\n\n\nERROR in (year-divisible-by-100-but-not-400) (:29:9)\nERROR in (year-divisible-by-100-but-not-400) (:29:9)\nexpected: (not (example-all-fail/leap-year? 2200))\nexpected: (not (example-all-fail/leap-year? 2200))\n actual: #object[Error Error: Cannot call false as a function.]\n actual: #object[Error Error: Cannot call false as a function.]\n\n\nERROR in (year-divisible-by-100-but-not-by-3) (:33:9)\nERROR in (year-divisible-by-100-but-not-by-3) (:33:9)\nexpected: (not (example-all-fail/leap-year? 2500))\nexpected: (not (example-all-fail/leap-year? 2500))\n actual: #object[Error Error: Cannot call false as a function.]\n actual: #object[Error Error: Cannot call false as a function.]\n\n\nERROR in (year-divisible-by-400) (:37:9)\nERROR in (year-divisible-by-400) (:37:9)\nexpected: (example-all-fail/leap-year? 2800)\nexpected: (example-all-fail/leap-year? 2800)\n actual: #object[Error Error: Cannot call true as a function.]\n actual: #object[Error Error: Cannot call true as a function.]\n\n\nERROR in (year-divisible-by-400-but-not-125) (:41:9)\nERROR in (year-divisible-by-400-but-not-125) (:41:9)\nexpected: (example-all-fail/leap-year? 3200)\nexpected: (example-all-fail/leap-year? 3200)\n actual: #object[Error Error: Cannot call true as a function.]\n actual: #object[Error Error: Cannot call true as a function.]\n\n\nERROR in (year-divisible-by-200-but-not-by-400) (:45:9)\nERROR in (year-divisible-by-200-but-not-by-400) (:45:9)\nexpected: (not (example-all-fail/leap-year? 2900))\nexpected: (not (example-all-fail/leap-year? 2900))\n actual: #object[Error Error: Cannot call false as a function.]\n actual: #object[Error Error: Cannot call false as a function.]\n\n\nRan 9 tests containing 9 assertions.\nRan 9 tests containing 9 assertions.\n0 failures, 9 errors.\n0 failures, 9 errors." -} + "message": "Testing example-all-fail-test\n\nERROR in (year-not-divisible-by-4) (:13:9)\nexpected: (not (example-all-fail/leap-year? 2999))\n actual: #object[Error Error: Cannot call false as a function.]\n\nERROR in (year-divisible-by-2-but-not-4) (:17:9)\nexpected: (not (example-all-fail/leap-year? 1658))\n actual: #object[Error Error: Cannot call false as a function.]\n actual: #object[Error Error: Cannot call false as a function.]\n\n\nERROR in (year-divisible-by-4-but-not-100) (:21:9)\nERROR in (year-divisible-by-4-but-not-100) (:21:9)\nexpected: (example-all-fail/leap-year? 2004)\nexpected: (example-all-fail/leap-year? 2004)\n actual: #object[Error Error: Cannot call true as a function.]\n actual: #object[Error Error: Cannot call true as a function.]\n\n\nERROR in (year-divisible-by-4-and-5) (:25:9)\nERROR in (year-divisible-by-4-and-5) (:25:9)\nexpected: (example-all-fail/leap-year? 2020)\nexpected: (example-all-fail/leap-year? 2020)\n actual: #object[Error Error: Cannot call true as a function.]\n actual: #object[Error Error: Cannot call true as a function.]\n\n\nERROR in (year-divisible-by-100-but-not-400) (:29:9)\nERROR in (year-divisible-by-100-but-not-400) (:29:9)\nexpected: (not (example-all-fail/leap-year? 2200))\nexpected: (not (example-all-fail/leap-year? 2200))\n actual: #object[Error Error: Cannot call false as a function.]\n actual: #object[Error Error: Cannot call false as a function.]\n\n\nERROR in (year-divisible-by-100-but-not-by-3) (:33:9)\nERROR in (year-divisible-by-100-but-not-by-3) (:33:9)\nexpected: (not (example-all-fail/leap-year? 2500))\nexpected: (not (example-all-fail/leap-year? 2500))\n actual: #object[Error Error: Cannot call false as a function.]\n actual: #object[Error Error: Cannot call false as a function.]\n\n\nERROR in (year-divisible-by-400) (:37:9)\nERROR in (year-divisible-by-400) (:37:9)\nexpected: (example-all-fail/leap-year? 2800)\nexpected: (example-all-fail/leap-year? 2800)\n actual: #object[Error Error: Cannot call true as a function.]\n actual: #object[Error Error: Cannot call true as a function.]\n\n\nERROR in (year-divisible-by-400-but-not-125) (:41:9)\nERROR in (year-divisible-by-400-but-not-125) (:41:9)\nexpected: (example-all-fail/leap-year? 3200)\nexpected: (example-all-fail/leap-year? 3200)\n actual: #object[Error Error: Cannot call true as a function.]\n actual: #object[Error Error: Cannot call true as a function.]\n\n\nERROR in (year-divisible-by-200-but-not-by-400) (:45:9)\nERROR in (year-divisible-by-200-but-not-by-400) (:45:9)\nexpected: (not (example-all-fail/leap-year? 2900))\nexpected: (not (example-all-fail/leap-year? 2900))\n actual: #object[Error Error: Cannot call false as a function.]\n\nRan 9 tests containing 9 assertions.\n0 failures, 9 errors." +} \ No newline at end of file From 9da22a2962f56b71049a456af946721c49b7b9b2 Mon Sep 17 00:00:00 2001 From: GANES1998 Date: Fri, 8 Oct 2021 14:40:00 +0530 Subject: [PATCH 4/5] Test Runner issue#27 fix. Failing testcases updated Test case expected results in tests/example*/*.json are updated. --- tests/example-empty-file/expected_results.json | 4 ++-- tests/example-partial-fail/expected_results.json | 4 ++-- tests/example-syntax-error/expected_results.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/example-empty-file/expected_results.json b/tests/example-empty-file/expected_results.json index 4ef9a34..d103b32 100644 --- a/tests/example-empty-file/expected_results.json +++ b/tests/example-empty-file/expected_results.json @@ -1,5 +1,5 @@ { "version": 1, "status": "fail", - "message": "Message: Could not find namespace: example-empty-file\nMessage: Could not find namespace: example-empty-file" -} + "message": "Message: Could not find namespace: example-empty-file" +} \ No newline at end of file diff --git a/tests/example-partial-fail/expected_results.json b/tests/example-partial-fail/expected_results.json index 0dda7ac..11d9cc2 100644 --- a/tests/example-partial-fail/expected_results.json +++ b/tests/example-partial-fail/expected_results.json @@ -1,5 +1,5 @@ { "version": 1, "status": "fail", - "message": "Testing example-partial-fail-test\nTesting example-partial-fail-test\n\n\nFAIL in (year-divisible-by-400) (:37)\nFAIL in (year-divisible-by-400) (:37)\nexpected: (example-partial-fail/leap-year? 2800)\nexpected: (example-partial-fail/leap-year? 2800)\n actual: (not (example-partial-fail/leap-year? 2800))\n actual: (not (example-partial-fail/leap-year? 2800))\n\n\nFAIL in (year-divisible-by-400-but-not-125) (:41)\nFAIL in (year-divisible-by-400-but-not-125) (:41)\nexpected: (example-partial-fail/leap-year? 3200)\nexpected: (example-partial-fail/leap-year? 3200)\n actual: (not (example-partial-fail/leap-year? 3200))\n actual: (not (example-partial-fail/leap-year? 3200))\n\n\nRan 9 tests containing 9 assertions.\nRan 9 tests containing 9 assertions.\n2 failures, 0 errors.\n2 failures, 0 errors." -} + "message": "Testing example-partial-fail-test\n\nFAIL in (year-divisible-by-400) (:37)\nexpected: (example-partial-fail/leap-year? 2800)\n actual: (not (example-partial-fail/leap-year? 2800))\n\nFAIL in (year-divisible-by-400-but-not-125) (:41)\nexpected: (example-partial-fail/leap-year? 3200)\n actual: (not (example-partial-fail/leap-year? 3200))\n\nRan 9 tests containing 9 assertions.\n2 failures, 0 errors." +} \ No newline at end of file diff --git a/tests/example-syntax-error/expected_results.json b/tests/example-syntax-error/expected_results.json index 0144cc5..a4da07f 100644 --- a/tests/example-syntax-error/expected_results.json +++ b/tests/example-syntax-error/expected_results.json @@ -1,5 +1,5 @@ { "version": 1, "status": "fail", - "message": "Message: Could not resolve symbol: leap\nMessage: Could not resolve symbol: leap\nLocation: 1:14\nLocation: 1:14\nPhase: analysis" -} + "message": "Message: Could not resolve symbol: leap\nnLocation: 1:14\nPhase: analysis" +} \ No newline at end of file From 9709a4a6f723e13995b17547104aa9a13aef7e45 Mon Sep 17 00:00:00 2001 From: GANES1998 Date: Fri, 8 Oct 2021 18:00:07 +0530 Subject: [PATCH 5/5] one failed test case exepected results changed --- tests/example-syntax-error/expected_results.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/example-syntax-error/expected_results.json b/tests/example-syntax-error/expected_results.json index a4da07f..87b4deb 100644 --- a/tests/example-syntax-error/expected_results.json +++ b/tests/example-syntax-error/expected_results.json @@ -1,5 +1,5 @@ { "version": 1, "status": "fail", - "message": "Message: Could not resolve symbol: leap\nnLocation: 1:14\nPhase: analysis" + "message": "Message: Could not resolve symbol: leap\nLocation: 1:14\nPhase: analysis" } \ No newline at end of file