From 43c7c3b6be239fc0d3e04cdc435d7182002b5d18 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 6 Mar 2024 08:32:55 -0800 Subject: [PATCH] First attempt at using Gitea Actions to run tests. --- .gitea/workflows/test.yaml | 11 +++++++++++ docs/how-to/develop-on-borgmatic.md | 2 +- ...{run-end-to-end-dev-tests => run-end-to-end-tests} | 0 scripts/run-full-tests | 7 ++----- tests/end-to-end/docker-compose.yaml | 1 - 5 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 .gitea/workflows/test.yaml rename scripts/{run-end-to-end-dev-tests => run-end-to-end-tests} (100%) diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml new file mode 100644 index 0000000..571ea9d --- /dev/null +++ b/.gitea/workflows/test.yaml @@ -0,0 +1,11 @@ +name: test +run-name: ${{ gitea.actor }} is running tests +on: [push] + +jobs: + test: + runs-on: host + + steps: + - uses: actions/checkout@v4 + - run: scripts/run-end-to-end-tests diff --git a/docs/how-to/develop-on-borgmatic.md b/docs/how-to/develop-on-borgmatic.md index 1e36868..421d791 100644 --- a/docs/how-to/develop-on-borgmatic.md +++ b/docs/how-to/develop-on-borgmatic.md @@ -99,7 +99,7 @@ see below) and [Docker Compose](https://docs.docker.com/compose/install/). Then run: ```bash -scripts/run-end-to-end-dev-tests +scripts/run-end-to-end-tests ``` This script assumes you have permission to run `docker`. If you don't, then diff --git a/scripts/run-end-to-end-dev-tests b/scripts/run-end-to-end-tests similarity index 100% rename from scripts/run-end-to-end-dev-tests rename to scripts/run-end-to-end-tests diff --git a/scripts/run-full-tests b/scripts/run-full-tests index d18f263..2166420 100755 --- a/scripts/run-full-tests +++ b/scripts/run-full-tests @@ -3,7 +3,7 @@ # This script installs test dependencies and runs all tests, including end-to-end tests. It # is designed to run inside a test container, and presumes that other test infrastructure like # databases are already running. Therefore, on a developer machine, you should not run this script -# directly. Instead, run scripts/run-end-to-end-dev-tests +# directly. Instead, run scripts/run-end-to-end-tests # # For more information, see: # https://torsion.org/borgmatic/docs/how-to/develop-on-borgmatic/ @@ -25,8 +25,5 @@ python3 -m pip install --no-cache --upgrade pip==22.2.2 setuptools==64.0.1 pip3 install --ignore-installed tox==4.11.3 export COVERAGE_FILE=/tmp/.coverage -if [ "$1" != "--end-to-end-only" ]; then - tox --workdir /tmp/.tox --sitepackages -fi - +tox --workdir /tmp/.tox --sitepackages tox --workdir /tmp/.tox --sitepackages -e end-to-end diff --git a/tests/end-to-end/docker-compose.yaml b/tests/end-to-end/docker-compose.yaml index 3fe3afd..72ec8c7 100644 --- a/tests/end-to-end/docker-compose.yaml +++ b/tests/end-to-end/docker-compose.yaml @@ -56,7 +56,6 @@ services: tty: true working_dir: /app entrypoint: /app/scripts/run-full-tests - command: --end-to-end-only depends_on: - postgresql - postgresql2