Skip to content

Commit

Permalink
haskell tester: make stack resolver a setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Donny Wong committed Apr 30, 2024
1 parent 7a56e41 commit bd2f235
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
- SUPERVISOR_URL=127.0.0.1:9001
- AUTOTESTER_CONFIG=/app/.dockerfiles/docker-config.yml
- STACK_ROOT=/home/docker/.autotesting/.stack
- STACK_RESOLVER=lts-16.17
depends_on:
- postgres
- redis
Expand Down
1 change: 1 addition & 0 deletions server/autotest_server/settings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
workspace: !ENV ${WORKSPACE}
redis_url: !ENV ${REDIS_URL}
supervisor_url: !ENV ${SUPERVISOR_URL}
stack_resolver: !ENV ${STACK_RESOLVER}
workers:
- user: !ENV ${USER}
queues:
Expand Down
3 changes: 2 additions & 1 deletion server/autotest_server/testers/haskell/haskell_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

from ..tester import Tester, Test, TestError
from ..specs import TestSpecs
from config import config

STACK_OPTIONS = ["--resolver=lts-16.17", "--system-ghc", "--allow-different-user"]
STACK_OPTIONS = [f"--resolver={config['stack_resolver']}", "--system-ghc", "--allow-different-user"]


class HaskellTest(Test):
Expand Down
6 changes: 3 additions & 3 deletions server/autotest_server/testers/haskell/setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import os
import json
import subprocess

from ...config import config

HASKELL_TEST_DEPS = ["tasty-discover", "tasty-quickcheck"]


def create_environment(_settings, _env_dir, default_env_dir):
resolver = "lts-16.17"
resolver = config["stack_resolver"]
cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS]
subprocess.run(cmd, check=True)

Expand All @@ -16,7 +16,7 @@ def create_environment(_settings, _env_dir, default_env_dir):

def install():
subprocess.run(os.path.join(os.path.dirname(os.path.realpath(__file__)), "requirements.system"), check=True)
resolver = "lts-16.17"
resolver = config["stack_resolver"]
cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS]
subprocess.run(cmd, check=True)
subprocess.run(
Expand Down

0 comments on commit bd2f235

Please sign in to comment.