From e109106af94643017b23743dc4dfa86d020aa057 Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Mon, 24 Jan 2022 22:34:52 +0100 Subject: [PATCH] Use test script everywhere in the pipeline. (#130) --- .envrc | 2 +- .github/workflows/main.yml | 2 +- docker/mobilizon-reshare.scm | 6 ++---- scripts/mobilizon-reshare.sh | 2 ++ scripts/run_pipeline_tests.sh | 6 +++++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.envrc b/.envrc index f50f029..d627575 100644 --- a/.envrc +++ b/.envrc @@ -22,7 +22,7 @@ if command -v guix; then git-cal --author="$(git config user.name)" run-tests () { - run_pipeline_tests + run_pipeline_tests.sh } export_function run-tests cat << EOF diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8213701..b509d1c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: - name: Install dependencies run: scripts/install_github_actions_dev_dependencies.sh - name: Run tests in dev env - run: run_pipeline_tests.sh + run: scripts/run_pipeline_tests.sh run-tests-preprod: # The type of runner that the job will run on diff --git a/docker/mobilizon-reshare.scm b/docker/mobilizon-reshare.scm index ff158c7..3d3edde 100644 --- a/docker/mobilizon-reshare.scm +++ b/docker/mobilizon-reshare.scm @@ -360,10 +360,8 @@ simplify testing of asynchronous tornado applications.") (replace 'check (lambda* (#:key tests? inputs outputs #:allow-other-keys) (when tests? - (invoke "python" "-m" "pytest" - ;; This test fails because of the unvendoring - ;; of toml from dynaconf. - "-k" "not test_get_settings_failure_invalid_toml")))) + (setenv "POETRY_VIRTUALENVS_CREATE" "false") + (invoke "./scripts/run_pipeline_tests.sh")))) (add-before 'sanity-check 'set-dummy-config (lambda _ ;; This is needed to prevent the tool from diff --git a/scripts/mobilizon-reshare.sh b/scripts/mobilizon-reshare.sh index 596e619..b542188 100755 --- a/scripts/mobilizon-reshare.sh +++ b/scripts/mobilizon-reshare.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e + export MOBILIZON_RESHARE_LOG_DIR="/tmp" export MOBILIZON_RESHARE_LOCAL_STATE_DIR="/tmp" export SECRETS_FOR_DYNACONF="$(pwd)/.secrets.toml" diff --git a/scripts/run_pipeline_tests.sh b/scripts/run_pipeline_tests.sh index 014807f..8ef991e 100755 --- a/scripts/run_pipeline_tests.sh +++ b/scripts/run_pipeline_tests.sh @@ -1 +1,5 @@ -poetry run pytest -m "not timezone_sensitive" \ No newline at end of file +#!/bin/sh + +set -e + +poetry run pytest -m "not timezone_sensitive"