Skip to content

Add testing reference to wb-dev#37

Closed
ilyatikhonyuk wants to merge 3 commits into
mainfrom
feature/wb-dev-testing-reference
Closed

Add testing reference to wb-dev#37
ilyatikhonyuk wants to merge 3 commits into
mainfrom
feature/wb-dev-testing-reference

Conversation

@ilyatikhonyuk

Copy link
Copy Markdown
Contributor

What changed

  • wb-dev: new references/testing.md — the how-to for tests in WB Python services that no skill covered:
    • layout: tests/ at the repo root with __init__.py (pybuild discovers the suite by package), conftest.py, one test_<module>.py per production module, tests/data/ with artefacts captured from real controllers and golden files next to inputs;
    • style: plain pytest functions, black-box through the public API (same principle as fw-unittests on the firmware side);
    • WB fixture patterns (each with its source repo): factory fixtures, fake sysroot in tmp_path, autouse module-state reset, patch at the process boundary, monkeypatch for sys.argv;
    • run levels: local pytest (+ coverage commands from codestyle/python.ru.md), pybuild during the .deb build (WBDEV_PYBUILD_TEST_ARGS), Jenkins flags (defaultRunCoverage, defaultCoverageMin — per-repo, don't lower);
    • what NOT to do: no live broker/network/hardware in unit tests, don't edit failing tests to pass, don't hand-invent fixture data, keep tests/test_version.py.
  • wb-dev SKILL.md: new short Testing section pointing at the reference.
  • Versions: wb-plc plugin → 1.13.0, wb-cli → 1.8.14 (lockstep).

Why

The skills covered firmware testing (fw-unittests, fw-integration-tests) and process requirements (a PR needs tests — wb-git), but not how to add tests to a Python service. wb-python-service-template ships no tests at all, so an agent bootstrapping a service had no pattern to follow. The reference distills the actual conventions from wb-cloud-agent, wb-nm-helper, wb-diag-collect and this repo's own suite.

Test plan

Doc-only. Every pattern in the reference is backed by a named production repo; the Jenkins flag examples are copied verbatim from live Jenkinsfiles (wb-cloud-agent, wb-nm-helper).

Risks

🤖 Generated with Claude Code

ilyatikhonyuk and others added 2 commits July 15, 2026 15:19
New references/testing.md: how tests are organized in WB Python
services — tests/ layout with captured fixture data and golden
files, pytest black-box style, WB fixture patterns (fake sysroot
in tmp_path, factory mocks, autouse state reset, boundary patches),
and the three run levels (local pytest, pybuild during .deb build,
Jenkins coverage flags). Distilled from wb-cloud-agent,
wb-nm-helper, wb-diag-collect and wb-ai-skills; the service
template itself ships no tests. SKILL.md gets a Testing section
pointing at the reference.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…g-reference

# Conflicts:
#	.claude-plugin/plugin.json
#	debian/changelog
#	pyproject.toml
#	wb_cli/__init__.py
@aadegtyarev
aadegtyarev self-requested a review July 15, 2026 12:30

@aadegtyarev aadegtyarev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не в ту репку.

The service template intentionally ships without tests; the guide
applies when the need arises, its absence is not a per-project gap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ilyatikhonyuk

Copy link
Copy Markdown
Contributor Author

Wrong repo — this content belongs in the private marketplace. Migrated as-is (including the 'tests are added when needed' clarification) to wirenboard/wb-agent-tools#74 as the new wb-development:python-testing skill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants