From 37b5fcd3aad3d797ad2ab6f7efaa9d86f7d9896a Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Sat, 13 Jan 2024 14:37:45 -0500 Subject: [PATCH 01/44] Update changelog for release v2.4.0 (#481) * Update changelog for release v2.4.0 * add missing changelog entries --- Changelog.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index af6f2df6..d2ea60ac 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,14 +1,20 @@ # CHANGELOG All notable changes to this project will be documented here. -## [unreleased] - +## [v2.4.0] - Fix bug that prevented test results from being returned when a feedback file could not be found (#458) - Add support for Python 3.11 and 3.12 (#467) - Track test environment setup status and report errors when running tests if environment setup is in progress or raised an error (#468) - Update Haskell tester to use [Stack](https://docs.haskellstack.org/en/stable/) to install dependencies (#469) - Improve default error message when a test group times out (#470) +## [v2.3.3] +- Updated python-ta to 2.6.2 (#454) + +## [v2.3.2] +- Fix a bug in the Java tester, where failed/error tests were being detected as passing. (#451) +- updated python-ta to 2.6.1 (#452) + ## [v2.3.1] - Fix a bug that prevented test file from being copied from a zip file to another location on disk (#426) From 4599edabd2aaaff7a46b8a312506ddd5de727cbf Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Thu, 25 Jan 2024 16:00:30 -0500 Subject: [PATCH 02/44] unset sticky bit when clearing working directory (#483) --- Changelog.md | 3 +++ server/autotest_server/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index d2ea60ac..8afd82a2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,9 @@ # CHANGELOG All notable changes to this project will be documented here. +## [unreleased] +- Fix bug that prevented copies of instructor directories from being deleted (#483) + ## [v2.4.0] - Fix bug that prevented test results from being returned when a feedback file could not be found (#458) - Add support for Python 3.11 and 3.12 (#467) diff --git a/server/autotest_server/__init__.py b/server/autotest_server/__init__.py index c3706fa5..6f2ee12d 100644 --- a/server/autotest_server/__init__.py +++ b/server/autotest_server/__init__.py @@ -254,9 +254,9 @@ def _clear_working_directory(tests_path: str, test_username: str) -> None: Run commands that clear the tests_path working directory """ if test_username != getpass.getuser(): - chmod_cmd = f"sudo -u {test_username} -- bash -c 'chmod -Rf ugo+rwX {tests_path}'" + chmod_cmd = f"sudo -u {test_username} -- bash -c 'chmod -Rf -t ugo+rwX {tests_path}'" else: - chmod_cmd = f"chmod -Rf ugo+rwX {tests_path}" + chmod_cmd = f"chmod -Rf -t ugo+rwX {tests_path}" subprocess.run(chmod_cmd, shell=True) From 566bf7c1af8a940e336ebff9be8ba6ed4cda2346 Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Tue, 6 Feb 2024 21:12:17 -0500 Subject: [PATCH 03/44] haskell tester: document STACK_ROOT and add to docker dev environment (#484) --- Changelog.md | 1 + README.md | 5 +++++ docker-compose.yml | 1 + 3 files changed, 7 insertions(+) diff --git a/Changelog.md b/Changelog.md index 8afd82a2..7dd8874e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented here. ## [unreleased] - Fix bug that prevented copies of instructor directories from being deleted (#483) +- Add STACK_ROOT to containers as well as notes in readme (#484) ## [v2.4.0] - Fix bug that prevented test results from being returned when a feedback file could not be found (#458) diff --git a/README.md b/README.md index 2486b0a7..f159fe9d 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,7 @@ Installing each tester will also install the following additional packages (syst - `haskell` - ghc - cabal-install + - haskell-stack - tasty-stats (cabal package) - tasty-discover (cabal package) - tasty-quickcheck (cabal package) @@ -259,6 +260,10 @@ ERROR_LOG= # file to write error log informatoin to (default is stderr) SETTINGS_JOB_TIMEOUT= # the maximum runtime (in seconds) of a job that updates settings before it is interrupted (default is 60) ``` +## Stack configuration +The Haskell autotester uses [stack](https://docs.haskellstack.org/en/stable/) to install and manage Haskell packages. By default, stack will install to `${HOME}/.stack`, where `${HOME}` is the home directory of the user running the autotester. +The installation location can be configured by setting a `$STACK_ROOT`, such as the root of the workspace directory. + ## MarkUs configuration options After installing the autotester and the API, the next step is to [register the MarkUs instance with the autotester](https://github.com/MarkUsProject/Markus/wiki/Installation#autotester-installation-steps). diff --git a/docker-compose.yml b/docker-compose.yml index 49ffa6b2..fbc3fc49 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,7 @@ services: - WORKSPACE=/home/docker/.autotesting - SUPERVISOR_URL=127.0.0.1:9001 - AUTOTESTER_CONFIG=/app/.dockerfiles/docker-config.yml + - STACK_ROOT=/home/docker/.autotesting/.stack depends_on: - postgres - redis From 6f1e50065ceab85d4c0edef99724fb1368c43ae6 Mon Sep 17 00:00:00 2001 From: donny-wong <141858744+donny-wong@users.noreply.github.com> Date: Wed, 7 Feb 2024 11:05:08 -0500 Subject: [PATCH 04/44] update changelog with new release v2.4.1 [ci skip] (#490) Co-authored-by: Donny Wong --- Changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog.md b/Changelog.md index 7dd8874e..9ba5538c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented here. ## [unreleased] + +## [v2.4.1] - Fix bug that prevented copies of instructor directories from being deleted (#483) - Add STACK_ROOT to containers as well as notes in readme (#484) From d69c5337953d12107fb5f88f777a330a4d6e5703 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 24 Feb 2024 11:34:12 -0500 Subject: [PATCH 05/44] [pre-commit.ci] pre-commit autoupdate (#479) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.12.1 → 24.2.0](https://github.com/psf/black/compare/23.12.1...24.2.0) - [github.com/pycqa/flake8: 6.1.0 → 7.0.0](https://github.com/pycqa/flake8/compare/6.1.0...7.0.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46badc1b..d6b7b9cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,9 @@ repos: - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.2.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 \ No newline at end of file From b59053c73c0ee8fbfa2fd2ecad81ce556c6133fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 01:14:02 +0000 Subject: [PATCH 06/44] build(deps): bump jsonschema from 4.20.0 to 4.21.1 in /server (#485) Bumps [jsonschema](https://github.com/python-jsonschema/jsonschema) from 4.20.0 to 4.21.1. - [Release notes](https://github.com/python-jsonschema/jsonschema/releases) - [Changelog](https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst) - [Commits](https://github.com/python-jsonschema/jsonschema/compare/v4.20.0...v4.21.1) --- updated-dependencies: - dependency-name: jsonschema dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- server/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/requirements.txt b/server/requirements.txt index ae91fdd0..efd4d6bb 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -3,7 +3,7 @@ click==8.1.7 redis==5.0.1 pyyaml==6.0.1 jsonschema==4.17.3;python_version<"3.8" -jsonschema==4.20.0;python_version>="3.8" +jsonschema==4.21.1;python_version>="3.8" requests==2.31.0 psycopg2-binary==2.9.9 supervisor==4.2.5 From f87f855157113f2d8e949b7ceac8fc1edda9713c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 01:14:38 +0000 Subject: [PATCH 07/44] build(deps): bump jsonschema from 4.20.0 to 4.21.1 in /client (#487) Bumps [jsonschema](https://github.com/python-jsonschema/jsonschema) from 4.20.0 to 4.21.1. - [Release notes](https://github.com/python-jsonschema/jsonschema/releases) - [Changelog](https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst) - [Commits](https://github.com/python-jsonschema/jsonschema/compare/v4.20.0...v4.21.1) --- updated-dependencies: - dependency-name: jsonschema dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- client/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/requirements.txt b/client/requirements.txt index 70902c1a..f2c3415c 100644 --- a/client/requirements.txt +++ b/client/requirements.txt @@ -5,6 +5,6 @@ python-dotenv==1.0.0;python_version>="3.8" rq==1.15.1 redis==5.0.1 jsonschema==4.17.3;python_version<"3.8" -jsonschema==4.20.0;python_version>="3.8" +jsonschema==4.21.1;python_version>="3.8" Werkzeug==2.2.3;python_version<"3.8" Werkzeug==2.3.8;python_version>="3.8" From f5b9452ecb1e2a2c8c97c370a3b8ebd8952db9fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 01:27:56 +0000 Subject: [PATCH 08/44] build(deps): bump python-dotenv from 1.0.0 to 1.0.1 in /client (#486) Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v1.0.0...v1.0.1) --- updated-dependencies: - dependency-name: python-dotenv dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- client/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/requirements.txt b/client/requirements.txt index f2c3415c..16abeef7 100644 --- a/client/requirements.txt +++ b/client/requirements.txt @@ -1,7 +1,7 @@ flask==2.2.5;python_version<"3.8" flask==2.3.3;python_version>="3.8" python-dotenv==0.21.1;python_version<"3.8" -python-dotenv==1.0.0;python_version>="3.8" +python-dotenv==1.0.1;python_version>="3.8" rq==1.15.1 redis==5.0.1 jsonschema==4.17.3;python_version<"3.8" From 4fe3068234d69246f51d2be1444cdc49f584895c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 01:33:54 +0000 Subject: [PATCH 09/44] build(deps): bump rq from 1.15.1 to 1.16.0 in /server (#494) Bumps [rq](https://github.com/rq/rq) from 1.15.1 to 1.16.0. - [Release notes](https://github.com/rq/rq/releases) - [Changelog](https://github.com/rq/rq/blob/master/CHANGES.md) - [Commits](https://github.com/rq/rq/compare/v1.15.1...v1.16) --- updated-dependencies: - dependency-name: rq dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- server/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/requirements.txt b/server/requirements.txt index efd4d6bb..eb2e560e 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -1,4 +1,4 @@ -rq==1.15.1 +rq==1.16.0 click==8.1.7 redis==5.0.1 pyyaml==6.0.1 From 01cca0d6502438e50eb9ea3edd5c9361b1ff055d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:52:01 +0000 Subject: [PATCH 10/44] build(deps): bump redis from 5.0.1 to 5.0.3 in /server (#497) Bumps [redis](https://github.com/redis/redis-py) from 5.0.1 to 5.0.3. - [Release notes](https://github.com/redis/redis-py/releases) - [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES) - [Commits](https://github.com/redis/redis-py/compare/v5.0.1...v5.0.3) --- updated-dependencies: - dependency-name: redis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- server/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/requirements.txt b/server/requirements.txt index eb2e560e..4b0f8bb4 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -1,6 +1,6 @@ rq==1.16.0 click==8.1.7 -redis==5.0.1 +redis==5.0.3 pyyaml==6.0.1 jsonschema==4.17.3;python_version<"3.8" jsonschema==4.21.1;python_version>="3.8" From 69a0ffa1ebb8ae5e4dbecec073d7d8be48293916 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:52:20 +0000 Subject: [PATCH 11/44] build(deps): bump redis from 5.0.1 to 5.0.3 in /client (#498) Bumps [redis](https://github.com/redis/redis-py) from 5.0.1 to 5.0.3. - [Release notes](https://github.com/redis/redis-py/releases) - [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES) - [Commits](https://github.com/redis/redis-py/compare/v5.0.1...v5.0.3) --- updated-dependencies: - dependency-name: redis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- client/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/requirements.txt b/client/requirements.txt index 16abeef7..fd7537a5 100644 --- a/client/requirements.txt +++ b/client/requirements.txt @@ -3,7 +3,7 @@ flask==2.3.3;python_version>="3.8" python-dotenv==0.21.1;python_version<"3.8" python-dotenv==1.0.1;python_version>="3.8" rq==1.15.1 -redis==5.0.1 +redis==5.0.3 jsonschema==4.17.3;python_version<"3.8" jsonschema==4.21.1;python_version>="3.8" Werkzeug==2.2.3;python_version<"3.8" From 12f2890e47aafafff4f199367fde3ed3eb4774c6 Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Fri, 22 Mar 2024 10:22:32 -0400 Subject: [PATCH 12/44] user separate sticky bit command when cleaning up test directories (#491) --- server/autotest_server/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/autotest_server/__init__.py b/server/autotest_server/__init__.py index 6f2ee12d..046b565a 100644 --- a/server/autotest_server/__init__.py +++ b/server/autotest_server/__init__.py @@ -218,6 +218,7 @@ def _run_test_specs( preexec_fn=set_rlimits_before_test, universal_newlines=True, env={**os.environ, **env_vars, **env}, + executable="/bin/bash", ) try: settings_json = json.dumps({**settings, "test_data": test_data}) @@ -254,10 +255,13 @@ def _clear_working_directory(tests_path: str, test_username: str) -> None: Run commands that clear the tests_path working directory """ if test_username != getpass.getuser(): - chmod_cmd = f"sudo -u {test_username} -- bash -c 'chmod -Rf -t ugo+rwX {tests_path}'" + sticky_cmd = f"sudo -u {test_username} -- bash -c 'chmod -Rf -t {tests_path}'" + chmod_cmd = f"sudo -u {test_username} -- bash -c 'chmod -Rf ugo+rwX {tests_path}'" else: - chmod_cmd = f"chmod -Rf -t ugo+rwX {tests_path}" + sticky_cmd = f"chmod -Rf -t {tests_path}" + chmod_cmd = f"chmod -Rf ugo+rwX {tests_path}" + subprocess.run(sticky_cmd, shell=True) subprocess.run(chmod_cmd, shell=True) # be careful not to remove the tests_path dir itself since we have to From 04c71d7f689e7c928b91c8717afc7cc144b9ba20 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 31 Mar 2024 09:46:57 -0400 Subject: [PATCH 13/44] [pre-commit.ci] pre-commit autoupdate (#500) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.2.0 → 24.3.0](https://github.com/psf/black/compare/24.2.0...24.3.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6b7b9cd..a81cfa1e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 24.2.0 + rev: 24.3.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 From 77ecd5793e15dbe8877c3dc29e906768618474c7 Mon Sep 17 00:00:00 2001 From: David Liu Date: Tue, 2 Apr 2024 14:46:32 -0400 Subject: [PATCH 14/44] Set _env_status earlier when updating settings (#499) * Set _env_status earlier when updating settings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- Changelog.md | 1 + client/autotest_client/__init__.py | 10 +++++++++- server/autotest_server/__init__.py | 5 ----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index 9ba5538c..799bf474 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented here. ## [v2.4.1] - Fix bug that prevented copies of instructor directories from being deleted (#483) - Add STACK_ROOT to containers as well as notes in readme (#484) +- Ensure _env_status is updated to "setup" earlier when a request to update test settings is made (#499) ## [v2.4.0] - Fix bug that prevented test results from being returned when a feedback file could not be found (#458) diff --git a/client/autotest_client/__init__.py b/client/autotest_client/__init__.py index dc2ea3a8..87455aae 100644 --- a/client/autotest_client/__init__.py +++ b/client/autotest_client/__init__.py @@ -2,6 +2,7 @@ from werkzeug.exceptions import HTTPException import os import sys +import time import rq import json import io @@ -108,6 +109,11 @@ def _update_settings(settings_id, user): if error: abort(make_response(jsonify(message=error), 422)) + test_settings["_user"] = user + test_settings["_last_access"] = int(time.time()) + test_settings["_env_status"] = "setup" + REDIS_CONNECTION.hset("autotest:settings", key=settings_id, value=json.dumps(test_settings)) + queue = rq.Queue("settings", connection=REDIS_CONNECTION) data = {"user": user, "settings_id": settings_id, "test_settings": test_settings, "file_url": file_url} queue.enqueue_call( @@ -198,7 +204,9 @@ def settings(settings_id, **_kw): @authorize def create_settings(user): settings_id = REDIS_CONNECTION.incr("autotest:settings_id") - REDIS_CONNECTION.hset("autotest:settings", key=settings_id, value=json.dumps({"_user": user})) + REDIS_CONNECTION.hset( + "autotest:settings", key=settings_id, value=json.dumps({"_user": user, "_env_status": "setup"}) + ) _update_settings(settings_id, user) return {"settings_id": settings_id} diff --git a/server/autotest_server/__init__.py b/server/autotest_server/__init__.py index 046b565a..88524c26 100644 --- a/server/autotest_server/__init__.py +++ b/server/autotest_server/__init__.py @@ -370,11 +370,6 @@ def ignore_missing_dir_error( def update_test_settings(user, settings_id, test_settings, file_url): - test_settings["_user"] = user - test_settings["_last_access"] = int(time.time()) - test_settings["_env_status"] = "setup" - redis_connection().hset("autotest:settings", key=settings_id, value=json.dumps(test_settings)) - try: settings_dir = os.path.join(TEST_SCRIPT_DIR, str(settings_id)) From a1b9c05b53976918a2a165ede3d1da10c15115f8 Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Thu, 4 Apr 2024 11:02:35 -0400 Subject: [PATCH 15/44] update changelog for v2.4.2 (#506) --- Changelog.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 799bf474..83b5c202 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,10 +3,12 @@ All notable changes to this project will be documented here. ## [unreleased] +## [v2.4.2] +- Ensure _env_status is updated to "setup" earlier when a request to update test settings is made (#499) + ## [v2.4.1] - Fix bug that prevented copies of instructor directories from being deleted (#483) - Add STACK_ROOT to containers as well as notes in readme (#484) -- Ensure _env_status is updated to "setup" earlier when a request to update test settings is made (#499) ## [v2.4.0] - Fix bug that prevented test results from being returned when a feedback file could not be found (#458) From a85cdf84674dde59d916a5b2d2e96a484156639f Mon Sep 17 00:00:00 2001 From: donny-wong <141858744+donny-wong@users.noreply.github.com> Date: Tue, 9 Apr 2024 16:49:17 -0400 Subject: [PATCH 16/44] Sticky bit unit test (#501) --------- Co-authored-by: Donny Wong Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .../tests/test_autotest_server.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/server/autotest_server/tests/test_autotest_server.py b/server/autotest_server/tests/test_autotest_server.py index bc3be969..f2a61b61 100644 --- a/server/autotest_server/tests/test_autotest_server.py +++ b/server/autotest_server/tests/test_autotest_server.py @@ -1,7 +1,10 @@ +import subprocess + import pytest import fakeredis import rq import autotest_server +import os @pytest.fixture @@ -26,3 +29,22 @@ def fake_redis_db(monkeypatch, fake_job): def test_redis_connection(fake_redis_conn): assert autotest_server.redis_connection() == fake_redis_conn + + +def test_sticky(): + workers = autotest_server.config["workers"] + autotest_worker = workers[0]["user"] + autotest_worker_working_dir = f"/home/docker/.autotesting/workers/{autotest_worker}" + path = f"{autotest_worker_working_dir}/test_sticky" + + if not os.path.exists(path): + mkdir_cmd = f"sudo -u {autotest_worker} mkdir {path}" + chmod_cmd = f"sudo -u {autotest_worker} chmod 000 {path}" + chmod_sticky_cmd = f"sudo -u {autotest_worker} chmod +t {path}" + subprocess.run(mkdir_cmd, shell=True) + subprocess.run(chmod_cmd, shell=True) + subprocess.run(chmod_sticky_cmd, shell=True) + + autotest_server._clear_working_directory(autotest_worker_working_dir, autotest_worker) + + assert os.path.exists(path) is False From f2bfa613895a5e08e4f97c4226541605a2f17685 Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Tue, 9 Apr 2024 16:51:55 -0400 Subject: [PATCH 17/44] Upgrade dev docker environment to 22.04 (#492) * make docker user's home directory executable to allow running tests --- client/.dockerfiles/Dockerfile | 6 +++--- docker-compose.yml | 4 ++-- server/.dockerfiles/Dockerfile | 9 +++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/client/.dockerfiles/Dockerfile b/client/.dockerfiles/Dockerfile index ed3a0839..f7695774 100644 --- a/client/.dockerfiles/Dockerfile +++ b/client/.dockerfiles/Dockerfile @@ -3,9 +3,9 @@ ARG UBUNTU_VERSION FROM ubuntu:$UBUNTU_VERSION RUN apt-get update -y && \ - apt-get -y install software-properties-common && \ - add-apt-repository -y ppa:deadsnakes/ppa && \ - apt-get install -y python3.11 python3.11-venv + DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common && \ + DEBIAN_FRONTEND=noninteractive add-apt-repository -y ppa:deadsnakes/ppa && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y python3.11 python3.11-venv COPY ./requirements.txt /requirements.txt diff --git a/docker-compose.yml b/docker-compose.yml index fbc3fc49..90b52b1c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: context: ./server dockerfile: ./.dockerfiles/Dockerfile args: - UBUNTU_VERSION: '20.04' + UBUNTU_VERSION: '22.04' LOGIN_USER: 'docker' WORKSPACE: '/home/docker/.autotesting' image: markus-autotest-server-dev:1.1.0 @@ -28,7 +28,7 @@ services: context: ./client dockerfile: ./.dockerfiles/Dockerfile args: - UBUNTU_VERSION: '20.04' + UBUNTU_VERSION: '22.04' image: markus-autotest-client-dev:1.1.0 container_name: 'autotest-client' volumes: diff --git a/server/.dockerfiles/Dockerfile b/server/.dockerfiles/Dockerfile index 652ca6ac..73a185ea 100644 --- a/server/.dockerfiles/Dockerfile +++ b/server/.dockerfiles/Dockerfile @@ -2,15 +2,14 @@ ARG UBUNTU_VERSION FROM ubuntu:$UBUNTU_VERSION as base -ENV DEBIAN_FRONTEND=noninteractive ARG LOGIN_USER ARG WORKSPACE RUN apt-get update -y && \ - apt-get -y install software-properties-common && \ - add-apt-repository -y ppa:deadsnakes/ppa && \ - apt-get -y install python3.7 \ + DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common && \ + DEBIAN_FRONTEND=noninteractive add-apt-repository -y ppa:deadsnakes/ppa && \ + DEBIAN_FRONTEND=noninteractive apt-get -y install python3.7 \ python3.7-venv \ python3.8 \ python3.8-venv \ @@ -36,6 +35,8 @@ RUN useradd -ms /bin/bash $LOGIN_USER && \ usermod -aG $worker $LOGIN_USER; \ done +RUN chmod a+x /home/${LOGIN_USER} + COPY . /app RUN python3.11 -m venv /markus_venv && \ From b61a55fc6f09f894b1d0d5185ef891735095ab2f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 00:36:29 +0000 Subject: [PATCH 18/44] [pre-commit.ci] pre-commit autoupdate (#507) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.3.0 → 24.4.0](https://github.com/psf/black/compare/24.3.0...24.4.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a81cfa1e..e3b15d8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.4.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 From c3b34fc23ac058eeb936a094f17713114e14b8bf Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Mon, 22 Apr 2024 10:42:37 -0400 Subject: [PATCH 19/44] add post-install script for haskell (#508) * add post-install script for haskell * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update tests with stack_root * fix test_ci * remove test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * disable stack upgrade recommendation --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/test_ci.yml | 2 +- server/autotest_server/testers/haskell/haskell_tester.py | 2 +- server/autotest_server/testers/haskell/setup.py | 8 +++++++- .../autotest_server/testers/haskell/stack_permissions.sh | 5 +++++ 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100755 server/autotest_server/testers/haskell/stack_permissions.sh diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml index 93d972e7..6c6656fb 100644 --- a/.github/workflows/test_ci.yml +++ b/.github/workflows/test_ci.yml @@ -5,7 +5,7 @@ on: jobs: test: if: github.event.pull_request.draft == false - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: python-version: diff --git a/server/autotest_server/testers/haskell/haskell_tester.py b/server/autotest_server/testers/haskell/haskell_tester.py index 572f2841..754e3c25 100644 --- a/server/autotest_server/testers/haskell/haskell_tester.py +++ b/server/autotest_server/testers/haskell/haskell_tester.py @@ -7,7 +7,7 @@ from ..tester import Tester, Test, TestError from ..specs import TestSpecs -STACK_OPTIONS = ["--resolver=lts-14.27", "--system-ghc", "--allow-different-user"] +STACK_OPTIONS = ["--resolver=lts-16.17", "--system-ghc", "--allow-different-user"] class HaskellTest(Test): diff --git a/server/autotest_server/testers/haskell/setup.py b/server/autotest_server/testers/haskell/setup.py index 2cbcdb65..43f8090c 100644 --- a/server/autotest_server/testers/haskell/setup.py +++ b/server/autotest_server/testers/haskell/setup.py @@ -7,7 +7,7 @@ def create_environment(_settings, _env_dir, default_env_dir): - resolver = "lts-14.27" + resolver = "lts-16.17" cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS] subprocess.run(cmd, check=True) @@ -16,6 +16,12 @@ 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" + cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS] + subprocess.run(cmd, check=True) + subprocess.run( + os.path.join(os.path.dirname(os.path.realpath(__file__)), "stack_permissions.sh"), check=True, shell=True + ) def settings(): diff --git a/server/autotest_server/testers/haskell/stack_permissions.sh b/server/autotest_server/testers/haskell/stack_permissions.sh new file mode 100755 index 00000000..22c3fd34 --- /dev/null +++ b/server/autotest_server/testers/haskell/stack_permissions.sh @@ -0,0 +1,5 @@ +echo "allow-different-user: true" >> $STACK_ROOT/config.yaml +echo "recommend-stack-upgrade: false" >> $STACK_ROOT/config.yaml +chmod a+w $STACK_ROOT/stack.sqlite3.pantry-write-lock +chmod a+w $STACK_ROOT/global-project/.stack-work/stack.sqlite3.pantry-write-lock +chmod a+w $STACK_ROOT/pantry/pantry.sqlite3.pantry-write-lock \ No newline at end of file From 59772b76265d555baad89d710fac2efcc4ad5bf6 Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Tue, 23 Apr 2024 11:55:13 -0400 Subject: [PATCH 20/44] add typing-extensions to test venv (#511) --- .github/workflows/test_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml index 6c6656fb..42e12de1 100644 --- a/.github/workflows/test_ci.yml +++ b/.github/workflows/test_ci.yml @@ -35,6 +35,6 @@ jobs: restore-keys: | ${{ runner.os }}-pip- - name: Install python packages - run: python -m pip install pytest fakeredis -r ${{ matrix.test-dir }}/requirements.txt + run: python -m pip install pytest fakeredis typing-extensions -r ${{ matrix.test-dir }}/requirements.txt - name: run tests run: pytest ${{ matrix.test-dir }} From 9c4c6412f781995e622797e694b4970cc12289b8 Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Wed, 24 Apr 2024 15:41:23 -0400 Subject: [PATCH 21/44] Clean local directory before setting up test files (#510) --- server/autotest_server/__init__.py | 1 + .../tests/test_autotest_server.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/server/autotest_server/__init__.py b/server/autotest_server/__init__.py index 88524c26..217421e3 100644 --- a/server/autotest_server/__init__.py +++ b/server/autotest_server/__init__.py @@ -343,6 +343,7 @@ def run_test(settings_id, test_id, files_url, categories, user, test_env_vars): redis_connection().hset("autotest:settings", key=settings_id, value=json.dumps(settings)) test_username, tests_path = tester_user() try: + _clear_working_directory(tests_path, test_username) _setup_files(settings_id, user, files_url, tests_path, test_username) cmd = run_test_command(test_username=test_username) results = _run_test_specs(cmd, settings, categories, tests_path, test_username, test_id, test_env_vars) diff --git a/server/autotest_server/tests/test_autotest_server.py b/server/autotest_server/tests/test_autotest_server.py index f2a61b61..0cf74b38 100644 --- a/server/autotest_server/tests/test_autotest_server.py +++ b/server/autotest_server/tests/test_autotest_server.py @@ -48,3 +48,20 @@ def test_sticky(): autotest_server._clear_working_directory(autotest_worker_working_dir, autotest_worker) assert os.path.exists(path) is False + + +def test_pre_remove(): + workers = autotest_server.config["workers"] + autotest_worker = workers[0]["user"] + autotest_worker_working_dir = f"/home/docker/.autotesting/workers/{autotest_worker}" + path = f"{autotest_worker_working_dir}/__pycache__" + + if not os.path.exists(path): + mkdir_cmd = f"sudo -u {autotest_worker} mkdir {path}" + chmod_cmd = f"sudo -u {autotest_worker} chmod 000 {path}" + subprocess.run(mkdir_cmd, shell=True) + subprocess.run(chmod_cmd, shell=True) + + autotest_server._clear_working_directory(autotest_worker_working_dir, autotest_worker) + + assert os.path.exists(path) is False From 7a56e41af329f0124fcc5b5b48578637530c480f Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Fri, 26 Apr 2024 12:39:32 -0400 Subject: [PATCH 22/44] Add tidyverse as a default package for the R tester (#512) --- Changelog.md | 1 + server/.dockerfiles/Dockerfile | 13 ++++++++++++- .../autotest_server/testers/r/lib/r_tester_setup.R | 9 +++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 83b5c202..d746537e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,7 @@ All notable changes to this project will be documented here. ## [unreleased] +- Add tidyverse as a default R tester package (#512) ## [v2.4.2] - Ensure _env_status is updated to "setup" earlier when a request to update test settings is made (#499) diff --git a/server/.dockerfiles/Dockerfile b/server/.dockerfiles/Dockerfile index 73a185ea..36884913 100644 --- a/server/.dockerfiles/Dockerfile +++ b/server/.dockerfiles/Dockerfile @@ -25,7 +25,16 @@ RUN apt-get update -y && \ postgresql-client \ libpq-dev \ sudo \ - git + git \ + libfontconfig1-dev \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libpng-dev \ + libtiff5-dev \ + libjpeg-dev \ + libharfbuzz-dev \ + libfribidi-dev \ + r-base RUN useradd -ms /bin/bash $LOGIN_USER && \ usermod -aG sudo $LOGIN_USER && \ @@ -45,6 +54,8 @@ RUN python3.11 -m venv /markus_venv && \ find /app/autotest_server/testers -name requirements.system -exec {} \; && \ rm -rf /app/* +RUN echo "TZ=$( cat /etc/timezone )" >> /etc/R/Renviron.site + RUN mkdir -p ${WORKSPACE} && chown ${LOGIN_USER} ${WORKSPACE} WORKDIR /home/${LOGIN_USER} diff --git a/server/autotest_server/testers/r/lib/r_tester_setup.R b/server/autotest_server/testers/r/lib/r_tester_setup.R index e5d8ab8f..4791a12c 100644 --- a/server/autotest_server/testers/r/lib/r_tester_setup.R +++ b/server/autotest_server/testers/r/lib/r_tester_setup.R @@ -12,7 +12,7 @@ library(remotes) main <- function() { # Tester dependencies # rjson v0.2.20 is required to support R v3.x - deps <- "testthat, rjson (== 0.2.20)" + deps <- "testthat, rjson (== 0.2.20), stringi, tidyverse" # Additional dependencies for test environment from command-line args args <- commandArgs(TRUE) @@ -53,7 +53,12 @@ install_dep <- function(row) { } else if (!is.na(version)) { install_version(name, version = paste(compare, version, sep =" ")) } else { - install.packages(name) + if (name == 'stringi') { + install.packages(name, configure.args="--disable-pkg-config") + } + else { + install.packages(name) + } } if (!(name %in% installed.packages())) { From 9d25ba0211fb080ede44d7d364384102c016a187 Mon Sep 17 00:00:00 2001 From: David Liu Date: Wed, 8 May 2024 18:01:53 +0000 Subject: [PATCH 23/44] Ensure Python tester omits skipped tests (#522) --- Changelog.md | 1 + .../autotest_server/testers/py/py_tester.py | 2 +- server/autotest_server/testers/tester.py | 2 +- .../autotest_server/tests/testers/__init__.py | 0 .../tests/testers/py/__init__.py | 0 .../testers/py/fixtures/sample_tests_skip.py | 10 +++ .../py/fixtures/sample_tests_success.py | 6 ++ .../tests/testers/py/test_py_tester.py | 63 +++++++++++++++++++ 8 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 server/autotest_server/tests/testers/__init__.py create mode 100644 server/autotest_server/tests/testers/py/__init__.py create mode 100644 server/autotest_server/tests/testers/py/fixtures/sample_tests_skip.py create mode 100644 server/autotest_server/tests/testers/py/fixtures/sample_tests_success.py create mode 100644 server/autotest_server/tests/testers/py/test_py_tester.py diff --git a/Changelog.md b/Changelog.md index d746537e..8bf8e3ab 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented here. ## [unreleased] - Add tidyverse as a default R tester package (#512) +- Omit skipped test cases in Python tester (#522) ## [v2.4.2] - Ensure _env_status is updated to "setup" earlier when a request to update test settings is made (#499) diff --git a/server/autotest_server/testers/py/py_tester.py b/server/autotest_server/testers/py/py_tester.py index d6777577..88c57129 100644 --- a/server/autotest_server/testers/py/py_tester.py +++ b/server/autotest_server/testers/py/py_tester.py @@ -89,7 +89,7 @@ def pytest_runtest_makereport(self, item, call): """ outcome = yield rep = outcome.get_result() - if rep.failed or item.nodeid not in self.results: + if rep.failed or (item.nodeid not in self.results and not rep.skipped and rep.when != "teardown"): self.results[item.nodeid] = { "status": "failure" if rep.failed else "success", "name": item.nodeid, diff --git a/server/autotest_server/testers/tester.py b/server/autotest_server/testers/tester.py index 6658d68f..abe555b2 100644 --- a/server/autotest_server/testers/tester.py +++ b/server/autotest_server/testers/tester.py @@ -2,7 +2,7 @@ from abc import ABC, abstractmethod from functools import wraps from typing import Optional, Callable, Any, Type, Dict, List -from testers.specs import TestSpecs +from .specs import TestSpecs import traceback diff --git a/server/autotest_server/tests/testers/__init__.py b/server/autotest_server/tests/testers/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/server/autotest_server/tests/testers/py/__init__.py b/server/autotest_server/tests/testers/py/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/server/autotest_server/tests/testers/py/fixtures/sample_tests_skip.py b/server/autotest_server/tests/testers/py/fixtures/sample_tests_skip.py new file mode 100644 index 00000000..2f18e2d2 --- /dev/null +++ b/server/autotest_server/tests/testers/py/fixtures/sample_tests_skip.py @@ -0,0 +1,10 @@ +import pytest + + +def add_one(x): + return x + 1 + + +@pytest.mark.skip +def test_add_one(): + assert add_one(1) == 2 diff --git a/server/autotest_server/tests/testers/py/fixtures/sample_tests_success.py b/server/autotest_server/tests/testers/py/fixtures/sample_tests_success.py new file mode 100644 index 00000000..eb62e43a --- /dev/null +++ b/server/autotest_server/tests/testers/py/fixtures/sample_tests_success.py @@ -0,0 +1,6 @@ +def add_one(x): + return x + 1 + + +def test_add_one(): + assert add_one(1) == 2 diff --git a/server/autotest_server/tests/testers/py/test_py_tester.py b/server/autotest_server/tests/testers/py/test_py_tester.py new file mode 100644 index 00000000..a111378f --- /dev/null +++ b/server/autotest_server/tests/testers/py/test_py_tester.py @@ -0,0 +1,63 @@ +from ....testers.specs import TestSpecs +from ....testers.py.py_tester import PyTester + + +def test_success(request, monkeypatch) -> None: + """Test that when a test succeeds, it is added to the results.""" + monkeypatch.chdir(request.fspath.dirname) + tester = PyTester( + specs=TestSpecs.from_json( + """ + { + "test_data": { + "script_files": ["fixtures/sample_tests_success.py"], + "category": ["instructor"], + "timeout": 30, + "tester": "pytest", + "output_verbosity": "short", + "extra_info": { + "criterion": "", + "name": "Python Test Group 1" + } + } + } + """ + ) + ) + results = tester.run_python_tests() + assert len(results) == 1 + assert "fixtures/sample_tests_success.py" in results + assert len(results["fixtures/sample_tests_success.py"]) == 1 + + result = results["fixtures/sample_tests_success.py"][0] + assert result["status"] == "success" + # nodeid is inexact in CI test + assert result["name"].endswith("fixtures/sample_tests_success.py::test_add_one") + assert result["errors"] == "" + assert result["description"] is None + + +def test_skip(request, monkeypatch) -> None: + """Test that when a test is skipped, it is omitted from the results.""" + monkeypatch.chdir(request.fspath.dirname) + tester = PyTester( + specs=TestSpecs.from_json( + """ + { + "test_data": { + "script_files": ["fixtures/sample_tests_skip.py"], + "category": ["instructor"], + "timeout": 30, + "tester": "pytest", + "output_verbosity": "short", + "extra_info": { + "criterion": "", + "name": "Python Test Group 1" + } + } + } + """ + ) + ) + results = tester.run_python_tests() + assert results == {"fixtures/sample_tests_skip.py": []} From a6b414ea255a69fc6a3864d45500698a0b179085 Mon Sep 17 00:00:00 2001 From: donny-wong <141858744+donny-wong@users.noreply.github.com> Date: Thu, 9 May 2024 14:34:00 -0400 Subject: [PATCH 24/44] update changelog with new release v2.4.3 [ci skip] (#525) Co-authored-by: Donny Wong --- Changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog.md b/Changelog.md index 8bf8e3ab..7248b0be 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,8 @@ All notable changes to this project will be documented here. ## [unreleased] - Add tidyverse as a default R tester package (#512) + +## [v2.4.3] - Omit skipped test cases in Python tester (#522) ## [v2.4.2] From 3d9a5e01fabdc48d2232fef2739340b13ee74c97 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 00:12:04 +0000 Subject: [PATCH 25/44] [pre-commit.ci] pre-commit autoupdate (#514) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e3b15d8c..44572f53 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 24.4.0 + rev: 24.4.2 hooks: - id: black - repo: https://github.com/pycqa/flake8 From 9b750fe100a80a8db0b406ad470e57f22ce69a57 Mon Sep 17 00:00:00 2001 From: donny-wong <141858744+donny-wong@users.noreply.github.com> Date: Fri, 31 May 2024 20:44:06 -0400 Subject: [PATCH 26/44] haskell tester: make stack resolver version a user setting (#526) --- Changelog.md | 1 + .../testers/haskell/haskell_tester.py | 4 ++-- .../testers/haskell/settings_schema.json | 17 +++++++++++++++++ server/autotest_server/testers/haskell/setup.py | 12 ++++++++---- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index 7248b0be..366f3570 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +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 setting (#526) ## [v2.4.3] - Omit skipped test cases in Python tester (#522) diff --git a/server/autotest_server/testers/haskell/haskell_tester.py b/server/autotest_server/testers/haskell/haskell_tester.py index 754e3c25..c0ba5f4c 100644 --- a/server/autotest_server/testers/haskell/haskell_tester.py +++ b/server/autotest_server/testers/haskell/haskell_tester.py @@ -7,8 +7,6 @@ from ..tester import Tester, Test, TestError from ..specs import TestSpecs -STACK_OPTIONS = ["--resolver=lts-16.17", "--system-ghc", "--allow-different-user"] - class HaskellTest(Test): def __init__( @@ -101,6 +99,8 @@ def run_haskell_tests(self) -> Dict[str, List[Dict[str, Union[int, str]]]]: Tests are run by first discovering all tests from a specific module (using tasty-discover) and then running all the discovered tests and parsing the results from a csv file. """ + resolver = self.specs["env_data", "resolver_version"] + STACK_OPTIONS = [f"--resolver={resolver}", "--system-ghc", "--allow-different-user"] results = {} this_dir = os.getcwd() haskell_lib = os.path.join(os.path.dirname(os.path.realpath(__file__)), "lib") diff --git a/server/autotest_server/testers/haskell/settings_schema.json b/server/autotest_server/testers/haskell/settings_schema.json index f034c97c..5fd49f3d 100644 --- a/server/autotest_server/testers/haskell/settings_schema.json +++ b/server/autotest_server/testers/haskell/settings_schema.json @@ -1,5 +1,8 @@ { "type": "object", + "required": [ + "env_data" + ], "properties": { "tester_type": { "type": "string", @@ -7,6 +10,20 @@ "haskell" ] }, + "env_data": { + "title": "Haskell environment", + "type": "object", + "required": [ + "resolver_version" + ], + "properties": { + "resolver_version": { + "title": "Resolver version", + "type": "string", + "default": null + } + } + }, "test_data": { "title": "Test Groups", "type": "array", diff --git a/server/autotest_server/testers/haskell/setup.py b/server/autotest_server/testers/haskell/setup.py index 43f8090c..f1b3efa0 100644 --- a/server/autotest_server/testers/haskell/setup.py +++ b/server/autotest_server/testers/haskell/setup.py @@ -2,12 +2,13 @@ import json import subprocess - HASKELL_TEST_DEPS = ["tasty-discover", "tasty-quickcheck"] +STACK_RESOLVER = "lts-16.17" def create_environment(_settings, _env_dir, default_env_dir): - resolver = "lts-16.17" + env_data = _settings.get("env_data", {}) + resolver = env_data.get("resolver_version", STACK_RESOLVER) cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS] subprocess.run(cmd, check=True) @@ -16,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 = "lts-16.17" + resolver = STACK_RESOLVER cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS] subprocess.run(cmd, check=True) subprocess.run( @@ -26,4 +27,7 @@ def install(): def settings(): with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "settings_schema.json")) as f: - return json.load(f) + settings_ = json.load(f) + resolver_versions = settings_["properties"]["env_data"]["properties"]["resolver_version"] + resolver_versions["default"] = STACK_RESOLVER + return settings_ From 16dcb8c078132d0a5f5e834a4c7168e8203eb11d Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Mon, 10 Jun 2024 14:14:55 -0400 Subject: [PATCH 27/44] Clear files created in /tmp after test runs (#528) * ensure users are added in GitHub Actions test configuration --- .github/workflows/test_ci.yml | 4 ++ Changelog.md | 1 + server/autotest_server/__init__.py | 8 +++- .../tests/fixtures/test_config.yml | 4 +- .../tests/test_autotest_server.py | 38 +++++++++++++++++++ 5 files changed, 53 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml index 42e12de1..45a09496 100644 --- a/.github/workflows/test_ci.yml +++ b/.github/workflows/test_ci.yml @@ -36,5 +36,9 @@ jobs: ${{ runner.os }}-pip- - name: Install python packages run: python -m pip install pytest fakeredis typing-extensions -r ${{ matrix.test-dir }}/requirements.txt + - name: Create users + run: | + sudo adduser --disabled-login --no-create-home fake_user + sudo adduser --disabled-login --no-create-home fake_user_2 - name: run tests run: pytest ${{ matrix.test-dir }} diff --git a/Changelog.md b/Changelog.md index 366f3570..e71c9ff4 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,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 setting (#526) +- Clean up tmp directory after test runs (#528) ## [v2.4.3] - Omit skipped test cases in Python tester (#522) diff --git a/server/autotest_server/__init__.py b/server/autotest_server/__init__.py index 217421e3..a44d8d98 100644 --- a/server/autotest_server/__init__.py +++ b/server/autotest_server/__init__.py @@ -252,14 +252,19 @@ def _run_test_specs( def _clear_working_directory(tests_path: str, test_username: str) -> None: """ - Run commands that clear the tests_path working directory + Run commands that clear the tests_path working directory, as well + as clearing any files or directories owned by test_username in the /tmp directory """ if test_username != getpass.getuser(): sticky_cmd = f"sudo -u {test_username} -- bash -c 'chmod -Rf -t {tests_path}'" chmod_cmd = f"sudo -u {test_username} -- bash -c 'chmod -Rf ugo+rwX {tests_path}'" + clean_tmp_cmd = ( + f"sudo -u {test_username} -- bash -c 'find /tmp -maxdepth 1 -user {test_username} -exec rm " f"-rf {{}} +' " + ) else: sticky_cmd = f"chmod -Rf -t {tests_path}" chmod_cmd = f"chmod -Rf ugo+rwX {tests_path}" + clean_tmp_cmd = f"find /tmp -maxdepth 1 -user {test_username} -exec rm -rf {{}} +" subprocess.run(sticky_cmd, shell=True) subprocess.run(chmod_cmd, shell=True) @@ -268,6 +273,7 @@ def _clear_working_directory(tests_path: str, test_username: str) -> None: # set the group ownership with sudo (and that is only done in ../install.sh) clean_cmd = f"rm -rf {tests_path}/.[!.]* {tests_path}/*" subprocess.run(clean_cmd, shell=True) + subprocess.run(clean_tmp_cmd, shell=True) def _stop_tester_processes(test_username: str) -> None: diff --git a/server/autotest_server/tests/fixtures/test_config.yml b/server/autotest_server/tests/fixtures/test_config.yml index 3b651714..1b731323 100644 --- a/server/autotest_server/tests/fixtures/test_config.yml +++ b/server/autotest_server/tests/fixtures/test_config.yml @@ -3,7 +3,9 @@ redis_url: fake_url supervisor_url: fake_url workers: - user: fake_user - queues: + queues: &queues - high - low - batch + - user: fake_user_2 + queues: *queues diff --git a/server/autotest_server/tests/test_autotest_server.py b/server/autotest_server/tests/test_autotest_server.py index 0cf74b38..260767dd 100644 --- a/server/autotest_server/tests/test_autotest_server.py +++ b/server/autotest_server/tests/test_autotest_server.py @@ -65,3 +65,41 @@ def test_pre_remove(): autotest_server._clear_working_directory(autotest_worker_working_dir, autotest_worker) assert os.path.exists(path) is False + + +def test_tmp_remove_file(): + workers = autotest_server.config["workers"] + autotest_worker = workers[0]["user"] + autotest_worker_working_dir = f"/home/docker/.autotesting/workers/{autotest_worker}" + path = "/tmp/test.txt" + touch_cmd = f"sudo -u {autotest_worker} touch {path}" + subprocess.run(touch_cmd, shell=True) + autotest_server._clear_working_directory(autotest_worker_working_dir, autotest_worker) + assert os.path.exists(path) is False + + +def test_tmp_remove_dir(): + workers = autotest_server.config["workers"] + autotest_worker = workers[0]["user"] + autotest_worker_working_dir = f"/home/docker/.autotesting/workers/{autotest_worker}" + path = "/tmp/folder" + mkdir_cmd = f"sudo -u {autotest_worker} mkdir {path}" + subprocess.run(mkdir_cmd, shell=True) + touch_cmd = f"sudo -u {autotest_worker} touch {path}/test.txt" + subprocess.run(touch_cmd, shell=True) + autotest_server._clear_working_directory(autotest_worker_working_dir, autotest_worker) + assert os.path.exists(path) is False + + +def test_tmp_remove_other_user(): + workers = autotest_server.config["workers"] + autotest_worker_creator = workers[0]["user"] + autotest_worker_remover = workers[1]["user"] + autotest_worker_working_dir = f"/home/docker/.autotesting/workers/{autotest_worker_remover}" + path = "/tmp/folder" + mkdir_cmd = f"sudo -u {autotest_worker_creator} mkdir {path}" + subprocess.run(mkdir_cmd, shell=True) + touch_cmd = f"sudo -u {autotest_worker_creator} touch {path}/test.txt" + subprocess.run(touch_cmd, shell=True) + autotest_server._clear_working_directory(autotest_worker_working_dir, autotest_worker_remover) + assert os.path.exists(path) is True From 6c49a8d68cb42ea6b91b6bde0904b703c8d26860 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 23:06:00 -0400 Subject: [PATCH 28/44] [pre-commit.ci] pre-commit autoupdate (#533) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pycqa/flake8: 7.0.0 → 7.1.0](https://github.com/pycqa/flake8/compare/7.0.0...7.1.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 44572f53..2cef89a7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,6 @@ repos: hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 7.0.0 + rev: 7.1.0 hooks: - id: flake8 \ No newline at end of file From b25bb7218ffbf75f75348522506ee6e471d857dd Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Tue, 23 Jul 2024 14:24:41 -0400 Subject: [PATCH 29/44] update changelog for v2.4.4 (#537) * update changelog for v2.4.4 * re-add unreleased to changelog --- Changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changelog.md b/Changelog.md index e71c9ff4..6b92228e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented here. ## [unreleased] + +## [v2.4.4] - Add tidyverse as a default R tester package (#512) - For the Haskell tester, make stack resolver a test setting (#526) - Clean up tmp directory after test runs (#528) From 09f3ea3040f0650aaf2a66552e8f17d9a13d8ebd Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Tue, 23 Jul 2024 15:48:34 -0400 Subject: [PATCH 30/44] r-tester: use rownames to check installed packages and ensure stringi is installed first (#535) --- Changelog.md | 1 + .../autotest_server/testers/r/lib/r_tester_setup.R | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Changelog.md b/Changelog.md index 6b92228e..12ce3ec9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,7 @@ All notable changes to this project will be documented here. ## [unreleased] +- Ensure R packages are correctly installed (#535) ## [v2.4.4] - Add tidyverse as a default R tester package (#512) diff --git a/server/autotest_server/testers/r/lib/r_tester_setup.R b/server/autotest_server/testers/r/lib/r_tester_setup.R index 4791a12c..fd1519f0 100644 --- a/server/autotest_server/testers/r/lib/r_tester_setup.R +++ b/server/autotest_server/testers/r/lib/r_tester_setup.R @@ -38,10 +38,13 @@ install_dep <- function(row) { } else { remote_type <- NA_character_ } + if (!('stringi' %in% rownames(installed.packages))) { + install.packages(name, configure.args="--disable-pkg-config") + } # Check if package is already installed # TODO: make this work for remote packages (with '/' in the name) - if (name %in% installed.packages() && + if (name %in% rownames(installed.packages()) && (is.na(version) || version_satisfies_criterion(name, compare, version))) { print(paste("Skipping '", name, "': package already installed", sep="")) return() @@ -53,15 +56,10 @@ install_dep <- function(row) { } else if (!is.na(version)) { install_version(name, version = paste(compare, version, sep =" ")) } else { - if (name == 'stringi') { - install.packages(name, configure.args="--disable-pkg-config") - } - else { - install.packages(name) - } + install.packages(name) } - if (!(name %in% installed.packages())) { + if (!(name %in% rownames(installed.packages()))) { stop("ERROR: Could not install package ", name) } } From bf921aba4a9a7d68c35231b4b19846d748adfdd3 Mon Sep 17 00:00:00 2001 From: donny-wong <141858744+donny-wong@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:11:05 -0400 Subject: [PATCH 31/44] Make PyTA version a schema setting (#536) --- Changelog.md | 1 + server/autotest_server/testers/pyta/requirements.txt | 2 -- .../testers/pyta/settings_schema.json | 5 +++++ server/autotest_server/testers/pyta/setup.py | 12 ++++++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index 12ce3ec9..33f114d7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented here. - Add tidyverse as a default R tester package (#512) - For the Haskell tester, make stack resolver a test setting (#526) - Clean up tmp directory after test runs (#528) +- Make PyTA version a setting (#536) ## [v2.4.3] - Omit skipped test cases in Python tester (#522) diff --git a/server/autotest_server/testers/pyta/requirements.txt b/server/autotest_server/testers/pyta/requirements.txt index b9e7f41c..9145eaa7 100644 --- a/server/autotest_server/testers/pyta/requirements.txt +++ b/server/autotest_server/testers/pyta/requirements.txt @@ -1,3 +1 @@ -python-ta==1.4.2;python_version<"3.8" -python-ta==2.7.0; python_version>="3.8" isort<5;python_version<"3.8" diff --git a/server/autotest_server/testers/pyta/settings_schema.json b/server/autotest_server/testers/pyta/settings_schema.json index 816b1716..3983c486 100644 --- a/server/autotest_server/testers/pyta/settings_schema.json +++ b/server/autotest_server/testers/pyta/settings_schema.json @@ -25,6 +25,11 @@ "pip_requirements": { "title": "Package requirements", "type": "string" + }, + "pyta_version": { + "title": "PyTA version", + "type": "string", + "default": null } } }, diff --git a/server/autotest_server/testers/pyta/setup.py b/server/autotest_server/testers/pyta/setup.py index 4df657f0..853038eb 100644 --- a/server/autotest_server/testers/pyta/setup.py +++ b/server/autotest_server/testers/pyta/setup.py @@ -3,15 +3,21 @@ import json import subprocess +PYTA_VERSION_PREFIX = "python-ta==" +PYTA_VERSION = "2.7.0" + def create_environment(settings_, env_dir, _default_env_dir): env_data = settings_.get("env_data", {}) python_version = env_data.get("python_version", "3") - pip_requirements = ["wheel"] + env_data.get("pip_requirements", "").split() + env_properties = ["wheel"] + env_data.get("pip_requirements", "").split() + pyta_version = env_data.get("pyta_version", PYTA_VERSION) + pyta_version = PYTA_VERSION_PREFIX + pyta_version + env_properties.append(pyta_version) requirements = os.path.join(os.path.dirname(os.path.realpath(__file__)), "requirements.txt") pip = os.path.join(env_dir, "bin", "pip") subprocess.run([f"python{python_version}", "-m", "venv", "--clear", env_dir], check=True) - subprocess.run([pip, "install", "-r", requirements, *pip_requirements], check=True) + subprocess.run([pip, "install", "-r", requirements, *env_properties], check=True) return {"PYTHON": os.path.join(env_dir, "bin", "python3")} @@ -22,6 +28,8 @@ def settings(): python_versions = settings_["properties"]["env_data"]["properties"]["python_version"] python_versions["enum"] = py_versions python_versions["default"] = py_versions[-1] + pyta_version = settings_["properties"]["env_data"]["properties"]["pyta_version"] + pyta_version["default"] = PYTA_VERSION return settings_ From 75e983198c9ee2f4114d8d07d8143fab8a4f57cd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 09:58:54 -0400 Subject: [PATCH 32/44] [pre-commit.ci] pre-commit autoupdate (#538) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.4.2 → 24.8.0](https://github.com/psf/black/compare/24.4.2...24.8.0) - [github.com/pycqa/flake8: 7.1.0 → 7.1.1](https://github.com/pycqa/flake8/compare/7.1.0...7.1.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2cef89a7..d95b5146 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,9 @@ repos: - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 7.1.0 + rev: 7.1.1 hooks: - id: flake8 \ No newline at end of file From d59ab91a41b26db86ac9e1f0f1ae5c34607cc243 Mon Sep 17 00:00:00 2001 From: david-yz-liu Date: Wed, 7 Aug 2024 17:03:21 -0400 Subject: [PATCH 33/44] Add libxml2-dev to server Dockerfile, required by R testthat library --- Changelog.md | 3 ++- server/.dockerfiles/Dockerfile | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 33f114d7..8a4e435c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,12 +3,13 @@ All notable changes to this project will be documented here. ## [unreleased] - Ensure R packages are correctly installed (#535) +- Make PyTA version a setting (#536) +- Add `libxml2-dev` to server `Dockerfile`, required by R `tidyverse` library (#539) ## [v2.4.4] - Add tidyverse as a default R tester package (#512) - For the Haskell tester, make stack resolver a test setting (#526) - Clean up tmp directory after test runs (#528) -- Make PyTA version a setting (#536) ## [v2.4.3] - Omit skipped test cases in Python tester (#522) diff --git a/server/.dockerfiles/Dockerfile b/server/.dockerfiles/Dockerfile index 36884913..ff5a7598 100644 --- a/server/.dockerfiles/Dockerfile +++ b/server/.dockerfiles/Dockerfile @@ -34,6 +34,7 @@ RUN apt-get update -y && \ libjpeg-dev \ libharfbuzz-dev \ libfribidi-dev \ + libxml2-dev \ r-base RUN useradd -ms /bin/bash $LOGIN_USER && \ From 3ec4a68d17152d8e74c25ece9fee2586b7cf8736 Mon Sep 17 00:00:00 2001 From: david-yz-liu Date: Wed, 7 Aug 2024 17:04:22 -0400 Subject: [PATCH 34/44] Display stderr contents if R packages fail to install --- Changelog.md | 1 + server/autotest_server/__init__.py | 5 ++++- server/autotest_server/testers/r/setup.py | 8 +++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 8a4e435c..975b4de2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented here. - Ensure R packages are correctly installed (#535) - Make PyTA version a setting (#536) - Add `libxml2-dev` to server `Dockerfile`, required by R `tidyverse` library (#539) +- Display stderr contents if R packages fail to install (#539) ## [v2.4.4] - Add tidyverse as a default R tester package (#512) diff --git a/server/autotest_server/__init__.py b/server/autotest_server/__init__.py index a44d8d98..666e65b4 100644 --- a/server/autotest_server/__init__.py +++ b/server/autotest_server/__init__.py @@ -405,7 +405,10 @@ def update_test_settings(user, settings_id, test_settings, file_url): try: tester_settings["_env"] = tester_install.create_environment(tester_settings, env_dir, default_env) except Exception as e: - raise Exception(f"create tester environment failed:\n{e}") from e + error_message = f"create tester environment failed:\n{e}" + if e.stderr: + error_message += f"\nDetails (captured stderr):\n{e.stderr}" + raise Exception(error_message) from e test_settings["testers"][i] = tester_settings test_settings["_files"] = files_dir test_settings.pop("_error", None) diff --git a/server/autotest_server/testers/r/setup.py b/server/autotest_server/testers/r/setup.py index 729808ca..16ff1326 100644 --- a/server/autotest_server/testers/r/setup.py +++ b/server/autotest_server/testers/r/setup.py @@ -10,7 +10,13 @@ def create_environment(settings_, env_dir, default_env_dir): env = {"R_LIBS_SITE": env_dir, "R_LIBS_USER": env_dir} r_tester_setup = os.path.join(os.path.dirname(os.path.realpath(__file__)), "lib", "r_tester_setup.R") - subprocess.run(["Rscript", r_tester_setup, req_string], env={**os.environ, **env}, check=True) + subprocess.run( + ["Rscript", r_tester_setup, req_string], + env={**os.environ, **env}, + check=True, + text=True, + capture_output=True, + ) return {**env, "PYTHON": os.path.join(default_env_dir, "bin", "python3")} From bb2f7ae7c8a2a087cab342852124cbb3970becd9 Mon Sep 17 00:00:00 2001 From: david-yz-liu Date: Wed, 7 Aug 2024 17:05:13 -0400 Subject: [PATCH 35/44] Do not display failure messages when test case passes --- Changelog.md | 1 + server/autotest_server/testers/r/r_tester.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 975b4de2..bd105b2c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented here. - Make PyTA version a setting (#536) - Add `libxml2-dev` to server `Dockerfile`, required by R `tidyverse` library (#539) - Display stderr contents if R packages fail to install (#539) +- Do not display `testthat` failure messages when test case passes (#539) ## [v2.4.4] - Add tidyverse as a default R tester package (#512) diff --git a/server/autotest_server/testers/r/r_tester.py b/server/autotest_server/testers/r/r_tester.py index 641ca76b..a5f99c3b 100644 --- a/server/autotest_server/testers/r/r_tester.py +++ b/server/autotest_server/testers/r/r_tester.py @@ -34,7 +34,10 @@ def run(self): successes = 0 error = False for result in self.result: - messages.append(result["message"]) + # Only add message if not a success, as testthat reports failure messages only + if result["type"] != "expectation_success": + messages.append(result["message"]) + if result["type"] == "expectation_success": self.points_total += 1 successes += 1 From df22b1811a421af92a144b4f1cd059404d9eae02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:40:48 -0400 Subject: [PATCH 36/44] build(deps): bump redis from 5.0.3 to 5.0.4 in /client (#520) Bumps [redis](https://github.com/redis/redis-py) from 5.0.3 to 5.0.4. - [Release notes](https://github.com/redis/redis-py/releases) - [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES) - [Commits](https://github.com/redis/redis-py/compare/v5.0.3...v5.0.4) --- updated-dependencies: - dependency-name: redis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- client/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/requirements.txt b/client/requirements.txt index fd7537a5..08bc9e08 100644 --- a/client/requirements.txt +++ b/client/requirements.txt @@ -3,7 +3,7 @@ flask==2.3.3;python_version>="3.8" python-dotenv==0.21.1;python_version<"3.8" python-dotenv==1.0.1;python_version>="3.8" rq==1.15.1 -redis==5.0.3 +redis==5.0.4 jsonschema==4.17.3;python_version<"3.8" jsonschema==4.21.1;python_version>="3.8" Werkzeug==2.2.3;python_version<"3.8" From 44160c1794ce59eb02d10cc4d03ab5c73e3ffb17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:41:04 -0400 Subject: [PATCH 37/44] build(deps): bump redis from 5.0.3 to 5.0.4 in /server (#516) Bumps [redis](https://github.com/redis/redis-py) from 5.0.3 to 5.0.4. - [Release notes](https://github.com/redis/redis-py/releases) - [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES) - [Commits](https://github.com/redis/redis-py/compare/v5.0.3...v5.0.4) --- updated-dependencies: - dependency-name: redis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- server/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/requirements.txt b/server/requirements.txt index 4b0f8bb4..a140a172 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -1,6 +1,6 @@ rq==1.16.0 click==8.1.7 -redis==5.0.3 +redis==5.0.4 pyyaml==6.0.1 jsonschema==4.17.3;python_version<"3.8" jsonschema==4.21.1;python_version>="3.8" From 4e84476dec151fae8faf52ac1f4bcd9ec10d2b94 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:47:09 -0400 Subject: [PATCH 38/44] build(deps): bump jsonschema from 4.21.1 to 4.22.0 in /client (#519) Bumps [jsonschema](https://github.com/python-jsonschema/jsonschema) from 4.21.1 to 4.22.0. - [Release notes](https://github.com/python-jsonschema/jsonschema/releases) - [Changelog](https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst) - [Commits](https://github.com/python-jsonschema/jsonschema/compare/v4.21.1...v4.22.0) --- updated-dependencies: - dependency-name: jsonschema dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- client/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/requirements.txt b/client/requirements.txt index 08bc9e08..4691101d 100644 --- a/client/requirements.txt +++ b/client/requirements.txt @@ -5,6 +5,6 @@ python-dotenv==1.0.1;python_version>="3.8" rq==1.15.1 redis==5.0.4 jsonschema==4.17.3;python_version<"3.8" -jsonschema==4.21.1;python_version>="3.8" +jsonschema==4.22.0;python_version>="3.8" Werkzeug==2.2.3;python_version<"3.8" Werkzeug==2.3.8;python_version>="3.8" From b3570d05000235821504a04302db242c0945b19f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:47:18 -0400 Subject: [PATCH 39/44] build(deps): bump jsonschema from 4.21.1 to 4.22.0 in /server (#517) Bumps [jsonschema](https://github.com/python-jsonschema/jsonschema) from 4.21.1 to 4.22.0. - [Release notes](https://github.com/python-jsonschema/jsonschema/releases) - [Changelog](https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst) - [Commits](https://github.com/python-jsonschema/jsonschema/compare/v4.21.1...v4.22.0) --- updated-dependencies: - dependency-name: jsonschema dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- server/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/requirements.txt b/server/requirements.txt index a140a172..eda4657b 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -3,7 +3,7 @@ click==8.1.7 redis==5.0.4 pyyaml==6.0.1 jsonschema==4.17.3;python_version<"3.8" -jsonschema==4.21.1;python_version>="3.8" +jsonschema==4.22.0;python_version>="3.8" requests==2.31.0 psycopg2-binary==2.9.9 supervisor==4.2.5 From c9989c4e54e2933b67d64bfe30abb8e8936c89a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:48:27 -0400 Subject: [PATCH 40/44] build(deps): bump rq from 1.16.0 to 1.16.2 in /server (#529) Bumps [rq](https://github.com/rq/rq) from 1.16.0 to 1.16.2. - [Release notes](https://github.com/rq/rq/releases) - [Changelog](https://github.com/rq/rq/blob/master/CHANGES.md) - [Commits](https://github.com/rq/rq/compare/v1.16...v1.16.2) --- updated-dependencies: - dependency-name: rq dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- server/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/requirements.txt b/server/requirements.txt index eda4657b..06799aa1 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -1,4 +1,4 @@ -rq==1.16.0 +rq==1.16.2 click==8.1.7 redis==5.0.4 pyyaml==6.0.1 From a7fb05d194423fab1b2b54191bb011a13e247f55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:53:03 -0400 Subject: [PATCH 41/44] build(deps): bump rq from 1.15.1 to 1.16.2 in /client (#531) Bumps [rq](https://github.com/rq/rq) from 1.15.1 to 1.16.2. - [Release notes](https://github.com/rq/rq/releases) - [Changelog](https://github.com/rq/rq/blob/master/CHANGES.md) - [Commits](https://github.com/rq/rq/compare/v1.15.1...v1.16.2) --- updated-dependencies: - dependency-name: rq dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Liu --- client/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/requirements.txt b/client/requirements.txt index 4691101d..ae0fae8f 100644 --- a/client/requirements.txt +++ b/client/requirements.txt @@ -2,7 +2,7 @@ flask==2.2.5;python_version<"3.8" flask==2.3.3;python_version>="3.8" python-dotenv==0.21.1;python_version<"3.8" python-dotenv==1.0.1;python_version>="3.8" -rq==1.15.1 +rq==1.16.2 redis==5.0.4 jsonschema==4.17.3;python_version<"3.8" jsonschema==4.22.0;python_version>="3.8" From 4284afa8d5f379e9b27b2e9c8f44ff288bcceefc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:05:48 -0400 Subject: [PATCH 42/44] build(deps): bump requests from 2.31.0 to 2.32.3 in /server (#530) Bumps [requests](https://github.com/psf/requests) from 2.31.0 to 2.32.3. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.31.0...v2.32.3) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: david-yz-liu --- server/requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/requirements.txt b/server/requirements.txt index 06799aa1..cecfc36d 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -4,6 +4,7 @@ redis==5.0.4 pyyaml==6.0.1 jsonschema==4.17.3;python_version<"3.8" jsonschema==4.22.0;python_version>="3.8" -requests==2.31.0 +requests==2.31.0;python_version<"3.8" +requests==2.32.3;python_version>="3.8" psycopg2-binary==2.9.9 supervisor==4.2.5 From 0f268fc459462f96171d777c52b89d6c25360b36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:40:20 -0400 Subject: [PATCH 43/44] build(deps): bump flask from 2.3.3 to 3.0.3 in /client (#521) * build(deps): bump werkzeug from 2.3.8 to 3.0.3 in /client Bumps [werkzeug](https://github.com/pallets/werkzeug) from 2.3.8 to 3.0.3. - [Release notes](https://github.com/pallets/werkzeug/releases) - [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/werkzeug/compare/2.3.8...3.0.3) --- updated-dependencies: - dependency-name: werkzeug dependency-type: direct:production ... Signed-off-by: dependabot[bot] * build(deps): bump flask from 2.3.3 to 3.0.3 in /client Bumps [flask](https://github.com/pallets/flask) from 2.3.3 to 3.0.3. - [Release notes](https://github.com/pallets/flask/releases) - [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/flask/compare/2.3.3...3.0.3) --- updated-dependencies: - dependency-name: flask dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: david-yz-liu --- client/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/requirements.txt b/client/requirements.txt index ae0fae8f..b6871faa 100644 --- a/client/requirements.txt +++ b/client/requirements.txt @@ -1,5 +1,5 @@ flask==2.2.5;python_version<"3.8" -flask==2.3.3;python_version>="3.8" +flask==3.0.3;python_version>="3.8" python-dotenv==0.21.1;python_version<"3.8" python-dotenv==1.0.1;python_version>="3.8" rq==1.16.2 @@ -7,4 +7,4 @@ redis==5.0.4 jsonschema==4.17.3;python_version<"3.8" jsonschema==4.22.0;python_version>="3.8" Werkzeug==2.2.3;python_version<"3.8" -Werkzeug==2.3.8;python_version>="3.8" +Werkzeug==3.0.3;python_version>="3.8" From d2003e670f17fdb4f083d5bd1f898e1445690e76 Mon Sep 17 00:00:00 2001 From: Samuel Maldonado Date: Fri, 16 Aug 2024 15:34:59 -0400 Subject: [PATCH 44/44] Changelog: update changelog --- Changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index bd105b2c..c84f40e0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,7 +1,7 @@ # CHANGELOG All notable changes to this project will be documented here. -## [unreleased] +## [v2.5.0] - Ensure R packages are correctly installed (#535) - Make PyTA version a setting (#536) - Add `libxml2-dev` to server `Dockerfile`, required by R `tidyverse` library (#539)