petercorke / petercorke/bdsim

tech-debt: reinstate example smoke-test coverage, and cover examples/codegen/ separately

Open
#91 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tech-debt
Dominant language
Python
Stars
267
Forks
39
Avg merge
11d 18h
Merged PRs (30d)
6

Description

Summary

tests/test_examples_smoke.py (runs every top-level examples/*.py script as a subprocess, asserts exit 0) is currently fully disabled: pytestmark = pytest.mark.skip(reason="example smoke tests temporarily disabled"), no further explanation in the file. Worth understanding why and reinstating if the original reason no longer applies.

examples/codegen/ is deliberately out of its scope, not an oversight

bdsim.codegen's example scripts (motor_control.py, verify_codegen.py, main.cpp) live in examples/codegen/, a subdirectory. test_examples_smoke.py globs non-recursively (EXAMPLES_DIR.glob("*.py")), so they're excluded from its discovery automatically -- intentional, not something to "fix" by making the glob recursive. They need a C++ toolchain (clang++ + Eigen) that a generic bdsim smoke test shouldn't have to assume is present; tests/test_codegen.py covers codegen-specific compile-verification separately, with its own skipif guard for when a compiler/Eigen aren't available.

When reinstating this test, keep examples/codegen/ excluded (either leave the glob non-recursive, or add an explicit skip for that subdirectory if the glob is ever made recursive for other reasons).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/test_examples_smoke.py and its disabled pytestmark, then inspect tests/test_codegen.py and the examples/ layout to understand the existing coverage and environment guards. Reinstate the top-level example subprocess smoke test if its original blocker no longer applies, while keeping examples/codegen/ excluded; verify with the relevant pytest tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.