Skip to content

Commit

Permalink
CI: Parameterize CrateDB version for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Apr 12, 2022
1 parent ab08d17 commit 4db3f2c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion DEVELOP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
3 changes: 2 additions & 1 deletion tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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
)
Expand Down

0 comments on commit 4db3f2c

Please sign in to comment.