Skip to content

Commit

Permalink
Kinesis: Add CI configuration for software tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Aug 16, 2024
1 parent d71aa85 commit 564a668
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 1 deletion.
65 changes: 65 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ dependencies = [
]
[project.optional-dependencies]
all = [
"cratedb-toolkit[full,influxdb,mongodb]",
"cratedb-toolkit[full,influxdb,kinesis,mongodb]",
]
cfr = [
"pandas<2.2",
Expand Down Expand Up @@ -255,6 +255,7 @@ xfail_strict = true
markers = [
"examples",
"influxdb",
"kinesis",
"mongodb",
"pymongo",
"slow",
Expand Down
5 changes: 5 additions & 0 deletions tests/io/test_iac.py
Original file line number Diff line number Diff line change
@@ -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():
Expand Down
4 changes: 4 additions & 0 deletions tests/io/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 564a668

Please sign in to comment.