From d79be1b568822c5db73d275fb2a92de6ede4249f Mon Sep 17 00:00:00 2001 From: Aymen Fnayou Date: Sun, 25 Oct 2026 05:47:05 +0100 Subject: [PATCH 1/3] test: add branch coverage reporting baseline --- .coveragerc | 8 ++++++++ .github/workflows/python-tests.yml | 4 +++- .gitignore | 2 ++ CONTRIBUTING.md | 10 +++++++++- requirements-dev.txt | 1 + 5 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .coveragerc create mode 100644 requirements-dev.txt diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..27ad054 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,8 @@ +[run] +branch = True +source = + ffmpegfyMe +relative_files = True + +[report] +show_missing = True diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 69215a7..7c03d5c 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -16,7 +16,9 @@ jobs: - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: "3.11" - - run: python -m unittest discover -v + - run: python -m pip install -r requirements-dev.txt + - run: python -m coverage run -m unittest discover -v + - run: python -m coverage report --show-missing container_smoke: name: Container smoke diff --git a/.gitignore b/.gitignore index e3a1731..1314a9f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ __pycache__/ *.pyc *.pyo .env +.coverage +.venv/ # Editor/OS metadata .DS_Store diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 79de319..2179ace 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,15 @@ Common types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`, ## Tests and CI -- Run the Python test suite locally with `python3 -m unittest discover -v`. +Use an isolated virtual environment: + +```sh +python3 -m venv .venv +.venv/bin/python -m pip install -r requirements-dev.txt +.venv/bin/python -m coverage run -m unittest discover -v +.venv/bin/python -m coverage report --show-missing +``` + - The Python test suite runs on PRs and pushes to main. - Watch the required CI checks on the pull request and run the current CI checks before requesting review. diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..f76ca6c --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1 @@ +coverage==7.17.0 From e0ccbccc8922b0a242ee46482010622d42331849 Mon Sep 17 00:00:00 2001 From: Aymen Fnayou Date: Sun, 25 Oct 2026 05:53:21 +0100 Subject: [PATCH 2/3] ci: clarify branch coverage reporting --- .coveragerc | 3 --- .github/workflows/python-tests.yml | 3 ++- CONTRIBUTING.md | 4 +++- README.md | 6 +----- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.coveragerc b/.coveragerc index 27ad054..deb2681 100644 --- a/.coveragerc +++ b/.coveragerc @@ -3,6 +3,3 @@ branch = True source = ffmpegfyMe relative_files = True - -[report] -show_missing = True diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 7c03d5c..057ab14 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -18,7 +18,8 @@ jobs: python-version: "3.11" - run: python -m pip install -r requirements-dev.txt - run: python -m coverage run -m unittest discover -v - - run: python -m coverage report --show-missing + - name: Add branch coverage summary + run: python -m coverage report --show-missing --format=markdown >> "$GITHUB_STEP_SUMMARY" container_smoke: name: Container smoke diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2179ace..a5ca614 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,7 @@ Common types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`, ## Tests and CI -Use an isolated virtual environment: +Use an isolated virtual environment to run tests with branch coverage: ```sh python3 -m venv .venv @@ -36,6 +36,8 @@ python3 -m venv .venv .venv/bin/python -m coverage report --show-missing ``` +The reported ffmpegfyMe.py percentage combines deterministic policy and integration code. It is a module-level baseline, not core-policy-only coverage. Issue #32 defines the target scope. + - The Python test suite runs on PRs and pushes to main. - Watch the required CI checks on the pull request and run the current CI checks before requesting review. diff --git a/README.md b/README.md index a553de1..54a6b3d 100644 --- a/README.md +++ b/README.md @@ -152,11 +152,7 @@ task ffmpegfy:run ## Tests -Run the Python test suite: - -```bash -python3 -m unittest discover -v -``` +Run the Python test suite with branch coverage. See [CONTRIBUTING.md](CONTRIBUTING.md#tests-and-ci) for the local environment and commands. GitHub Actions runs it on pull requests to `main` and pushes to `main`. From 48602e128ac6a0567893abdae5af47361e1cc543 Mon Sep 17 00:00:00 2001 From: Aymen Fnayou Date: Sun, 25 Oct 2026 05:57:14 +0100 Subject: [PATCH 3/3] docs: wrap coverage scope note --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a5ca614..b352063 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,9 @@ python3 -m venv .venv .venv/bin/python -m coverage report --show-missing ``` -The reported ffmpegfyMe.py percentage combines deterministic policy and integration code. It is a module-level baseline, not core-policy-only coverage. Issue #32 defines the target scope. +The reported `ffmpegfyMe.py` percentage combines deterministic policy and +integration code. It is a module-level baseline, not core-policy-only +coverage. Issue #32 defines the target scope. - The Python test suite runs on PRs and pushes to main. - Watch the required CI checks on the pull request and run the current CI