tests: standalone test-suite framework plus the first unit test
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest6 patches 2 repliesIn review
- v310 patches 10 repliesSuperseded
- v29 patches 0 repliesSuperseded
Changes in v3 from the cover letter
- test_bb_utils used the tmp_path fixture instead of tempfile.mkdtemp(), so the tests no longer leaked scratch directories under /tmp;
- documented the standard pytest scratch-directory controls (TMPDIR
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | tests: add the standalone unit-test suite skeleton.gitignore README.md justfile +2 more | +40 | 0 replies | |
| 2/6 | tests: add conftest with a wic-import preflight and session bannertests/ | +28 | 0 replies | |
| 3/6 | tests: add optional coverage reporting.gitignore justfile pyproject.toml | +12 | 0 replies | |
| 4/6 | add ruff linting.gitignore justfile pyproject.toml | +18 | 0 replies | |
| 5/6 | bb/utils: import errno so mkdirhier's OSError handler workssrc/ | +1 | 0 replies | |
| 6/6 | tests/unit/test_bb_utils: cover mkdirhier()tests/ tests/ | +81 | 0 replies |
Reviews trailers per patch
None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Paul Barker |
|---|---|
| Series | R-b |
| 1/6 | |
| 2/6 | |
| 3/6 | |
| 4/6 | |
| 5/6 | |
| 6/6 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [wic][PATCH v4 0/6] tests: standalone test-suite framework plus the first unit test
wic has no test mechanism of its own; it relies on the oe-selftest from oe-core, which needs a full bitbake build to exercise even pure-Python logic. This series starts a small standalone suite that runs from a plain checkout, framework first, then the first fix, and its test.
- the suite skeleton (pyproject test extra, pytest config, layout,
a justfile command runner, and a README Testing section);
- a conftest that imports wic once up front (stopping the session with
a clear message if that fails) and prints a session banner;
- optional coverage and ruff linting, each exposed as just recipes;
- a one-line fix to wic.bb.utils (import errno) so mkdirhier's OSError
handler works, as its own commit; - unit tests for mkdirhier() that pin its behaviour and catch that bug.
The suite is green at every commit and the test tree is ruff-clean.
Changes in v4 (in response to review feedback, thanks to Paul Barker):
v4 restructures the v3 10-patch series into 6 patches. How the old patches map to the new ones:
- v3 1/10 (skeleton) -> v4 1/6, which also gains a justfile command runner in place of the run-tests.sh wrapper and no longer creates a tests/docs/ tree;
- v3 2/10 (conftest banner) -> v4 2/6, which also absorbs the
wic-import check (see next line);
- v3 3/10 (run-tests.sh wrapper) -> dropped; the justfile replaces it
and its wic-import check moves into conftest, so the check runs on
every invocation rather than only through the wrapper;
- v3 4/10 (coverage) -> v4 3/6, exposed as just recipes;
- v3 5/10 (ruff linting) -> v4 4/6, exposed as just recipes, with
ruff now pinned exactly so the clean-bar gate is reproducible;
- v3 8/10 (tests/** E402 ignore) -> folded into v4 4/6;
- v3 6/10, 7/10, 10/10 (docs README, authoring guide, review rubric)
-> dropped; the suite ships a short README Testing section instead
of a tests/docs/ tree;- v3 9/10 (test plus folded-in errno fix) -> split into v4 5/6 (the errno fix, on its own, first) and v4 6/6 (the tests), and the tests are reframed to target mkdirhier's own behaviour rather than re-testing os.makedirs.
Dependency versions were also refreshed to current releases.
Changes in v3:
- test_bb_utils used the tmp_path fixture instead of tempfile.mkdtemp(), so the tests no longer leaked scratch directories under /tmp;
- documented the standard pytest scratch-directory controls (TMPDIR
and --basetemp) rather than a custom variable;
- added a review-rubric doc.
Changes in v2:
- v1 was a single ~6000-line commit that used xfail markers to record the bugs it found; v2 broke the work into a reviewable series where each test lands green next to the fix that makes it pass, with no xfails.
Trevor Woerner (6):
tests: add the standalone unit-test suite skeleton
tests: add conftest with a wic-import preflight and session banner
tests: add optional coverage reporting
add ruff linting
bb/utils: import errno so mkdirhier's OSError handler works tests/unit/test_bb_utils: cover mkdirhier()
.gitignore | 4 ++ README.md | 15 +++++++ justfile | 27 +++++++++++++ pyproject.toml | 24 +++++++++++ src/wic/bb/utils.py | 1 + tests/conftest.py | 28 +++++++++++++ tests/unit/test_bb_utils.py | 81 +++++++++++++++++++++++++++++++++++++ 7 files changed, 180 insertions(+) create mode 100644 justfile create mode 100644 tests/conftest.py create mode 100644 tests/unit/test_bb_utils.py
Signature · 1 line
2.50.0.173.g8b6f19ccfc3a