From c3f7f4f1ab51989609777d77a218b494210e5682 Mon Sep 17 00:00:00 2001 From: Jimisola Laursen Date: Wed, 4 Mar 2026 10:14:48 +0100 Subject: [PATCH] test: standardize test setup with integration/e2e markers and junit output - Expand addopts with standard verbose flags - Broaden testpaths from tests/unit to tests (discovers future dirs) - Add integration and e2e markers - Fix CI: use correct package name (reqstool_python_decorators), add --junitxml - Create empty tests/integration/ and tests/e2e/ directory structure --- .github/workflows/build.yml | 4 ++-- pyproject.toml | 13 +++++++++++-- tests/e2e/__init__.py | 0 tests/e2e/reqstool_decorators/__init__.py | 0 tests/integration/__init__.py | 0 tests/integration/reqstool_decorators/__init__.py | 0 6 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 tests/e2e/__init__.py create mode 100644 tests/e2e/reqstool_decorators/__init__.py create mode 100644 tests/integration/__init__.py create mode 100644 tests/integration/reqstool_decorators/__init__.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 537b08a..d252d4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,8 +28,8 @@ jobs: python-version: "3.13" - name: Install dependencies run: pip install hatch - - name: Run unit and integrations tests - run: hatch run dev:pytest --cov=reqstool-python-decorators --cov-report=xml --cov-report=html + - name: Run tests + run: hatch run dev:pytest --junitxml=build/junit.xml --cov=reqstool_python_decorators --cov-report=xml:build/coverage.xml - name: Build project run: hatch build # Upload artifacts for later use diff --git a/pyproject.toml b/pyproject.toml index 0c1ab4a..497314d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,9 +3,18 @@ requires = ["hatchling", "hatch-vcs", "build", "twine"] build-backend = "hatchling.build" [tool.pytest.ini_options] -addopts = ["-s", "--import-mode=importlib"] +addopts = [ + "-rsxX", + "-s", + "--import-mode=importlib", + "--log-cli-level=DEBUG", +] pythonpath = [".", "src", "tests"] -testpaths = ["tests/unit"] +testpaths = ["tests"] +markers = [ + "integration: tests that require external resources", + "e2e: end-to-end tests that run the full pipeline locally", +] [project] name = "reqstool-python-decorators" diff --git a/tests/e2e/__init__.py b/tests/e2e/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/e2e/reqstool_decorators/__init__.py b/tests/e2e/reqstool_decorators/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/reqstool_decorators/__init__.py b/tests/integration/reqstool_decorators/__init__.py new file mode 100644 index 0000000..e69de29