Skip to content

Commit 187fbc4

Browse files
authored
Merge pull request #637 from donny-wong/v2.8.1
Minor release for v2.8.1
2 parents 6ad018b + f8b4039 commit 187fbc4

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# CHANGELOG
22
All notable changes to this project will be documented here.
33

4+
## [v2.8.1]
5+
- Update Haskell tester to report installation errors (#636)
6+
- Update Haskell tester test name formatting (#636)
7+
- Update Haskell tester to support `tasty-hunit` adapter (#636)
8+
49
## [v2.8.0]
510
- Update Python and Jupyter test names to follow `[file] class.funcname` format (#605)
611
- Update r tester test_name formatting and add r tester tests (#606)

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ Both the autotester and the API are designed to be run on Ubuntu 20.04 (or suffi
124124
The autotester currently supports testers for the following languages and testing frameworks:
125125
126126
- `haskell`
127-
- [QuickCheck](http://hackage.haskell.org/package/QuickCheck)
127+
- [`tasty-hunit`](https://hackage.haskell.org/package/tasty-hunit)
128+
- [`tasty-quickcheck`](https://hackage.haskell.org/package/tasty-quickcheck)
128129
- `java`
129130
- [JUnit](https://junit.org/junit4/)
130131
- `py` (python3)
@@ -149,8 +150,8 @@ Installing each tester will also install the following additional packages (syst
149150
- ghc
150151
- cabal-install
151152
- haskell-stack
152-
- tasty-stats (cabal package)
153153
- tasty-discover (cabal package)
154+
- tasty-hunit (cabal package)
154155
- tasty-quickcheck (cabal package)
155156
- `java`
156157
- openjdk-8-jdk

server/autotest_server/testers/haskell/haskell_tester.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ def __init__(
3030
def test_name(self) -> str:
3131
"""The name of this test"""
3232
if self._test_name:
33-
return ".".join([self._file_name, self._test_name])
34-
return self._file_name
33+
return f"[{self._file_name}] {self._test_name}"
34+
else:
35+
return f"[{self._file_name}]"
3536

3637
@Test.run_decorator
3738
def run(self) -> str:
@@ -72,8 +73,11 @@ def _test_run_flags(self, test_file: str) -> List[str]:
7273
module_flag,
7374
stats_flag,
7475
f"--timeout={self.specs['test_data', 'test_timeout']}s",
75-
f"--quickcheck-tests={self.specs['test_data', 'test_cases']}",
7676
]
77+
test_cases = self.specs["test_data", "test_cases"] or 0
78+
if test_cases > 0:
79+
flags.append(f"--quickcheck-tests={test_cases}")
80+
7781
return flags
7882

7983
def _parse_test_results(self, reader: Iterator) -> List[Dict[str, Union[int, str]]]:

server/autotest_server/testers/haskell/setup.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,35 @@
22
import json
33
import subprocess
44

5-
HASKELL_TEST_DEPS = ["tasty-discover", "tasty-quickcheck"]
5+
HASKELL_TEST_DEPS = ["tasty-discover", "tasty-quickcheck", "tasty-hunit"]
66
STACK_RESOLVER = "lts-16.17"
77

88

99
def create_environment(_settings, _env_dir, default_env_dir):
1010
env_data = _settings.get("env_data", {})
1111
resolver = env_data.get("resolver_version", STACK_RESOLVER)
1212
cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS]
13-
subprocess.run(cmd, check=True)
13+
subprocess.run(cmd, check=True, capture_output=True, text=True)
1414

1515
return {"PYTHON": os.path.join(default_env_dir, "bin", "python3")}
1616

1717

1818
def install():
19-
subprocess.run(os.path.join(os.path.dirname(os.path.realpath(__file__)), "requirements.system"), check=True)
19+
subprocess.run(
20+
os.path.join(os.path.dirname(os.path.realpath(__file__)), "requirements.system"),
21+
check=True,
22+
capture_output=True,
23+
text=True,
24+
)
2025
resolver = STACK_RESOLVER
2126
cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS]
22-
subprocess.run(cmd, check=True)
27+
subprocess.run(cmd, check=True, capture_output=True)
2328
subprocess.run(
24-
os.path.join(os.path.dirname(os.path.realpath(__file__)), "stack_permissions.sh"), check=True, shell=True
29+
os.path.join(os.path.dirname(os.path.realpath(__file__)), "stack_permissions.sh"),
30+
check=True,
31+
shell=True,
32+
capture_output=True,
33+
text=True,
2534
)
2635

2736

0 commit comments

Comments
 (0)