Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haskell tester: make stack resolver a setting #515

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented here.

## [unreleased]
- Add tidyverse as a default R tester package (#512)
- haskell tester: make stack resolver a setting (#515)

## [v2.4.2]
- Ensure _env_status is updated to "setup" earlier when a request to update test settings is made (#499)
Expand Down
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
2 changes: 2 additions & 0 deletions server/autotest_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ def update_test_settings(user, settings_id, test_settings, file_url):
default_env = os.path.join(TEST_SCRIPT_DIR, DEFAULT_ENV_DIR)
if not os.path.isdir(default_env):
subprocess.run([sys.executable, "-m", "venv", default_env], check=True)
requirements_path = os.path.join(os.path.dirname(__file__), "../requirements.txt")
subprocess.run([f"{default_env}/bin/pip", "install", "-r", requirements_path], check=True)
try:
tester_settings["_env"] = tester_install.create_environment(tester_settings, env_dir, default_env)
except Exception as e:
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
Loading