Skip to content

Commit

Permalink
removed resolver version from being set by env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Donny Wong committed May 28, 2024
1 parent 74bbb50 commit c71a1cd
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ All notable changes to this project will be documented here.

## [unreleased]
- Add tidyverse as a default R tester package (#512)
- For the Haskell tester, make stack resolver a test and environment setting (#526)
- For the Haskell tester, make stack resolver a test setting (#526)

## [v2.4.3]
- Omit skipped test cases in Python tester (#522)
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ 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: 0 additions & 2 deletions server/autotest_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,6 @@ 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: 0 additions & 1 deletion server/autotest_server/settings.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"resolver_version": {
"title": "Resolver version",
"type": "string",
"enum": []
"default": null
}
}
},
Expand Down
10 changes: 4 additions & 6 deletions server/autotest_server/testers/haskell/setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import os
import json
import subprocess
from ...config import config

HASKELL_TEST_DEPS = ["tasty-discover", "tasty-quickcheck"]
STACK_RESOLVER = "lts-16.17"


def create_environment(_settings, _env_dir, default_env_dir):
env_data = _settings.get("env_data", {})
resolver = env_data.get("resolver_version", config["stack_resolver"])
resolver = env_data.get("resolver_version", STACK_RESOLVER)
cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS]
subprocess.run(cmd, check=True)

Expand All @@ -17,7 +17,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 = config["stack_resolver"]
resolver = STACK_RESOLVER
cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS]
subprocess.run(cmd, check=True)
subprocess.run(
Expand All @@ -28,8 +28,6 @@ def install():
def settings():
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "settings_schema.json")) as f:
settings_ = json.load(f)
resolvers = [config["stack_resolver"]]
resolver_versions = settings_["properties"]["env_data"]["properties"]["resolver_version"]
resolver_versions["enum"] = resolvers
resolver_versions["default"] = resolvers[-1]
resolver_versions["default"] = STACK_RESOLVER
return settings_

0 comments on commit c71a1cd

Please sign in to comment.