From 3fa1d5e13bf4e575caf0c8e67d04560899f279cb Mon Sep 17 00:00:00 2001 From: donny-wong <141858744+donny-wong@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:24:32 -0400 Subject: [PATCH 1/2] Ensure all Haskell test cases still run within same file when there are failed test cases (#543) Co-authored-by: Donny Wong --- Changelog.md | 3 +++ .../testers/haskell/haskell_tester.py | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index c84f40e0..13e9cc0b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,9 @@ # CHANGELOG All notable changes to this project will be documented here. +## [unreleased] +- Ensure all Haskell test cases still run within same file when there are failed test cases (#543) + ## [v2.5.0] - Ensure R packages are correctly installed (#535) - Make PyTA version a setting (#536) diff --git a/server/autotest_server/testers/haskell/haskell_tester.py b/server/autotest_server/testers/haskell/haskell_tester.py index c0ba5f4c..0cbbe99a 100644 --- a/server/autotest_server/testers/haskell/haskell_tester.py +++ b/server/autotest_server/testers/haskell/haskell_tester.py @@ -120,9 +120,15 @@ def run_haskell_tests(self) -> Dict[str, List[Dict[str, Union[int, str]]]]: subprocess.run(cmd, stdout=subprocess.DEVNULL, universal_newlines=True, check=True) with tempfile.NamedTemporaryFile(mode="w+", dir=this_dir) as sf: cmd = ["stack", "runghc", *STACK_OPTIONS, "--", f"-i={haskell_lib}", f.name, f"--stats={sf.name}"] - subprocess.run( - cmd, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, universal_newlines=True, check=True - ) + try: + subprocess.run( + cmd, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, universal_newlines=True, check=True + ) + except subprocess.CalledProcessError as e: + if e.returncode == 1: + pass + else: + raise Exception(e) results[test_file] = self._parse_test_results(csv.reader(sf)) return results From 1188d0cd73bb12ee8f6bdb1f98f3fec8a368b4f2 Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Tue, 27 Aug 2024 16:49:40 -0400 Subject: [PATCH 2/2] changelog: update changelog --- Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 13e9cc0b..c0d622f2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,7 +1,7 @@ # CHANGELOG All notable changes to this project will be documented here. -## [unreleased] +## [v2.5.1] - Ensure all Haskell test cases still run within same file when there are failed test cases (#543) ## [v2.5.0]