Skip to content

Commit d117074

Browse files
committed
Refactored Haskell tester configuration
1 parent b204f7f commit d117074

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
HASKELL_TEST_DEPS = ["tasty-discover", "tasty-quickcheck", "tasty-hunit"]
2+
STACK_RESOLVER = "lts-21.21"

server/autotest_server/testers/haskell/requirements.system

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -euxo pipefail
33

44
# Install a system-wide ghc, which can be used as a default version in the Haskell tester.
5-
# This should be synchronized with the LTS version and dependencies in setup.py
5+
# This should be synchronized with the LTS version and dependencies in config.py
66
if ! dpkg -l ghc cabal-install &> /dev/null; then
77
apt-get -y update
88
DEBIAN_FRONTEND=noninteractive apt-get install -y -o 'Dpkg::Options::=--force-confdef' -o 'Dpkg::Options::=--force-confold' ghc cabal-install

server/autotest_server/testers/haskell/schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from msgspec import Meta, Struct
55
from markus_autotesting_core.types import BaseTestData, BaseTesterSettings
66

7+
from .config import STACK_RESOLVER
8+
79

810
class HaskellTesterSettings(BaseTesterSettings):
911
"""The settings for the Haskell tester."""
@@ -22,4 +24,4 @@ class HaskellTestData(BaseTestData, kw_only=True):
2224
class HaskellEnvData(Struct, kw_only=True):
2325
"""Settings for the Haskell environment"""
2426

25-
resolver_version: Annotated[str, Meta(title="Stackage LTS resolver version")] = "lts-21.21"
27+
resolver_version: Annotated[str, Meta(title="Stackage LTS resolver version")] = STACK_RESOLVER

server/autotest_server/testers/haskell/setup.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import os
22
import subprocess
33

4+
from .config import HASKELL_TEST_DEPS, STACK_RESOLVER
45
from ..schema import generate_schema
56
from .schema import HaskellTesterSettings
67

7-
HASKELL_TEST_DEPS = ["tasty-discover", "tasty-quickcheck", "tasty-hunit"]
8-
STACK_RESOLVER = "lts-21.21"
9-
108

119
def create_environment(_settings, _env_dir, default_env_dir):
1210
env_data = _settings.get("env_data", {})
@@ -53,6 +51,4 @@ def install():
5351

5452

5553
def settings():
56-
json_schema, components = generate_schema(HaskellTesterSettings)
57-
components["HaskellEnvData"]["properties"]["resolver_version"]["default"] = STACK_RESOLVER
58-
return json_schema, components
54+
return generate_schema(HaskellTesterSettings)

0 commit comments

Comments
 (0)