Skip to content

Commit 4c38fd7

Browse files
committed
chore(test): skip the example plugin in default run-unit-tests runs
The example plugin is a skeleton - its unit test is a copy-paste starting point for new plugins, not a real check. Running it as part of `tox` / `tools/run-unit-tests` adds noise without signal. Skip it by default via a SKIP_PLUGINS set. Explicit `python tools/run-unit-tests example` still runs it so the template stays verifiable.
1 parent a54eb23 commit 4c38fd7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
* Fix `--require-hashes` pip install in pre-commit autoupdate workflow by using pinned version instead
1414
* tox.ini: disable the sdist build (`no_package = true`) so `tox` no longer trips over the flat top-level layout with "Multiple top-level packages discovered". The repo is a collection of plugin scripts, not a Python package
15+
* tools/run-unit-tests: skip the `example` plugin in default runs. Its unit test is a template meant to be copy-pasted into new plugins and does not correspond to a real check. Explicit `python tools/run-unit-tests example` still runs it
1516
* `.github/workflows/docs.yml`: pin all GitHub Actions by commit SHA (with the version as a trailing comment) instead of by tag, clearing the four OpenSSF Scorecard `PinnedDependenciesID` alerts. Dependabot is already configured for `github-actions` and updates hash-pinned actions natively
1617
* deb-updates: add missing `lib.txt` import so the "N update(s) available" summary no longer crashes with `AttributeError` at runtime
1718
* mysql-memory: fix `get_other_process_memory()` fallback path for psutil older than 5.3.0 (referenced an undefined `cmdline` variable and the wrong attribute on the process dict) and drop an unreachable `break` after `return` in `get_pfs_memory()`

tools/run-unit-tests

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ import os
2121
import subprocess
2222
import sys
2323

24+
# Plugins whose unit tests exist only as a template and are not meant to
25+
# be executed by the runner. The `example` plugin is the reference skeleton
26+
# for new plugins, its unit test is a copy-paste starting point.
27+
SKIP_PLUGINS = {'example'}
28+
2429

2530
def main():
2631
"""Find and run unit tests, report results."""
@@ -35,6 +40,10 @@ def main():
3540
for plugin in sorted(os.listdir(check_plugins)):
3641
if requested and plugin not in requested:
3742
continue
43+
# when a plugin is explicitly requested on the command line, run it
44+
# even if it is normally skipped; otherwise honor the skip set
45+
if plugin in SKIP_PLUGINS and not requested:
46+
continue
3847
unit_test_dir = os.path.join(check_plugins, plugin, 'unit-test')
3948
run_file = os.path.join(unit_test_dir, 'run')
4049
if os.path.isfile(run_file):

0 commit comments

Comments
 (0)