Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
branches: [main]

jobs:
test:
run-tests-and-coverage:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand All @@ -27,5 +27,34 @@ jobs:
run: poetry build && poetry run twine check dist/*.tar.gz
- name: Run tests
run: make core/tests
- name: Rename coverage file
run: mv .coverage .coverage.${{ matrix.python-version}}
- name: "Save coverage artifact"
uses: actions/upload-artifact@v4
with:
name: "coverage-artifact-${{ matrix.python-version}}"
path: ".coverage.*"
retention-days: 1
- name: Run doctests
run: make core/doctests

coverage-compile:
needs: "run-tests-and-coverage"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: ./.github/actions/setup-env
- name: Install Python dependencies
run: poetry install --all-extras
- name: "Download coverage artifacts"
uses: actions/download-artifact@v4
with:
pattern: "coverage-artifact-*"
merge-multiple: true
- name: Compile coverage
run: make coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ tests : ${TESTS}
${TESTS} : %/tests :
poetry run pytest -v --cov=testcontainers.$* $*/tests

# Target to combine and report coverage.
coverage:
poetry run coverage combine
poetry run coverage report
poetry run coverage xml
poetry run coverage html

# Target to lint the code.
lint:
pre-commit run -a
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![image](https://img.shields.io/pypi/v/testcontainers.svg)](https://pypi.python.org/pypi/testcontainers)
[![image](https://img.shields.io/pypi/l/testcontainers.svg)](https://github.com/testcontainers/testcontainers-python/blob/main/LICENSE)
[![image](https://img.shields.io/pypi/pyversions/testcontainers.svg)](https://pypi.python.org/pypi/testcontainers)
[![codecov](https://codecov.io/gh/testcontainers/testcontainers-python/branch/master/graph/badge.svg)](https://codecov.io/gh/testcontainers/testcontainers-python)


# Testcontainers Python

`testcontainers-python` facilitates the use of Docker containers for functional and integration testing.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ priority = "primary"
line-length = 120

[tool.pytest.ini_options]
addopts = "--cov-report=term --cov-report=html --tb=short --strict-markers"
addopts = "--tb=short --strict-markers"
log_cli = true
log_cli_level = "INFO"

Expand Down