From 4db3f2c8400c9adf117faa22d0c617bb4c98a64f Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 12 Apr 2022 12:39:39 +0200 Subject: [PATCH] CI: Parameterize CrateDB version for integration tests --- .github/workflows/main.yml | 7 ++++++- DEVELOP.rst | 6 +++++- tests/test_integration.py | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8b19a7b6..6306eb71 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,12 +4,17 @@ on: push jobs: test: - name: Test python-${{ matrix.python-version }} on ${{ matrix.os }} + name: Python ${{ matrix.python-version }}, CrateDB ${{ matrix.cratedb-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-2019] python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + cratedb-version: ['4.7.1'] + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python-version }} + CRATEDB_VERSION: ${{ matrix.cratedb-version }} steps: - uses: actions/checkout@v2 diff --git a/DEVELOP.rst b/DEVELOP.rst index 56df8cd2..212ee18c 100644 --- a/DEVELOP.rst +++ b/DEVELOP.rst @@ -19,10 +19,14 @@ Afterwards you can launch crash:: Running Tests ============= -The tests are run using the `unittest`_:: +The tests are run using the `unittest`_ module:: $ venv/bin/python -m unittest -v +In order to adjust the CrateDB version used for running the tests, amend the +environment variable ``CRATEDB_VERSION`` like:: + + $ export CRATEDB_VERSION=4.8.0 If you install tox_, you can also run tests against multiple Python interpreters:: diff --git a/tests/test_integration.py b/tests/test_integration.py index 5067dd4a..97bb8734 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -27,6 +27,7 @@ if sys.platform != "linux": raise SkipTest("Integration tests only supported on Linux") +crate_version = os.getenv("CRATEDB_VERSION", "4.7.1") crate_http_port = 44209 crate_transport_port = 44309 crate_settings = { @@ -38,7 +39,7 @@ 'transport.tcp.port': crate_transport_port } node = CrateLayer.from_uri( - 'https://cdn.crate.io/downloads/releases/crate-4.7.1.tar.gz', + f'https://cdn.crate.io/downloads/releases/crate-{crate_version}.tar.gz', 'crate', settings=crate_settings )