diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 620f512c..8edbbd4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -155,3 +155,68 @@ jobs: env_vars: OS,PYTHON name: codecov-umbrella fail_ci_if_error: true + + + tests-kinesis: + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest"] + python-version: ["3.9", "3.12"] + + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python-version }} + # Do not tear down Testcontainers + TC_KEEPALIVE: true + + # https://docs.github.com/en/actions/using-containerized-services/about-service-containers + services: + cratedb: + image: crate/crate:nightly + ports: + - 4200:4200 + - 5432:5432 + + name: " + PyMongo: + Python ${{ matrix.python-version }} on OS ${{ matrix.os }}" + steps: + + - name: Acquire sources + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + cache: 'pip' + cache-dependency-path: 'pyproject.toml' + + - name: Set up project + run: | + + # `setuptools 0.64.0` adds support for editable install hooks (PEP 660). + # https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400 + pip install "setuptools>=64" --upgrade + + # Install package in editable mode. + pip install --use-pep517 --prefer-binary --editable=.[kinesis,test,develop] + + - name: Run linter and software tests + run: | + pytest -m kinesis + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + files: ./coverage.xml + flags: kinesis + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: true diff --git a/pyproject.toml b/pyproject.toml index 85cc9d26..63e61eff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,7 +107,7 @@ dependencies = [ ] [project.optional-dependencies] all = [ - "cratedb-toolkit[full,influxdb,mongodb]", + "cratedb-toolkit[full,influxdb,kinesis,mongodb]", ] cfr = [ "pandas<2.2", @@ -255,6 +255,7 @@ xfail_strict = true markers = [ "examples", "influxdb", + "kinesis", "mongodb", "pymongo", "slow", diff --git a/tests/io/test_iac.py b/tests/io/test_iac.py index 8136bfd6..ef49b088 100644 --- a/tests/io/test_iac.py +++ b/tests/io/test_iac.py @@ -1,4 +1,9 @@ # ruff: noqa: F401 +import pytest + +pytestmark = pytest.mark.kinesis + +pytest.importorskip("lorrystream", reason="Only works with LorryStream installed") def test_iac_imports(): diff --git a/tests/io/test_processor.py b/tests/io/test_processor.py index db972ffc..49e5bc37 100644 --- a/tests/io/test_processor.py +++ b/tests/io/test_processor.py @@ -3,6 +3,10 @@ import pytest +pytestmark = pytest.mark.kinesis + +pytest.importorskip("commons_codec", reason="Only works with commons-codec installed") + @pytest.fixture def reset_handler():