fix(tests): enable automation test discovery in pytest#3165
fix(tests): enable automation test discovery in pytest#3165MarkusNeusinger merged 2 commits intomainfrom
Conversation
The pytest configuration was excluding all "scripts" directories from test discovery, which prevented 108 automation tests in tests/unit/automation/scripts/ from running in CI. Changes: - Updated norecursedirs to specifically exclude .github/scripts instead of all "scripts" directories - This allows test discovery in tests/unit/automation/scripts/ Impact: - Automation tests now run in CI (+108 tests) - Automation coverage increased from 0% to 61% - Total test count: 492 → 600 All 108 automation tests pass successfully.
Removed redundant entries from norecursedirs that pytest already handles automatically: - .github/scripts (doesn't exist + auto-excluded by dotted pattern) - .git (auto-excluded) - .venv (auto-excluded) - __pycache__ (auto-excluded) Kept only: - docs (non-dotted directory to skip) - temp (temporary files directory) Benefits: - Cleaner, more maintainable configuration - Relies on pytest's sensible defaults - Still excludes all necessary directories All 619 tests still discovered and running correctly.
There was a problem hiding this comment.
Pull request overview
This PR fixes pytest configuration to enable test discovery in tests/unit/automation/scripts/, which was previously blocked by the overly broad "scripts" exclusion in norecursedirs. The change successfully enables 108 automation tests to run in CI.
Key changes:
- Removed "scripts", ".git", ".venv", and "pycache" from pytest's
norecursedirsconfiguration - This allows pytest to discover tests in
tests/unit/automation/scripts/while still being restricted to thetests/directory bytestpaths
| norecursedirs = [ | ||
| "docs", | ||
| "scripts", | ||
| ".git", | ||
| ".venv", | ||
| "__pycache__", | ||
| "temp", | ||
| ] |
There was a problem hiding this comment.
The PR description states "Updated norecursedirs to specifically exclude .github/scripts instead of all 'scripts' directories", but the actual change only removes "scripts" from the exclusion list without adding ".github/scripts". Additionally, the .github/scripts directory doesn't currently exist in the codebase.
The current change is correct and achieves the intended goal because testpaths = ["tests"] already restricts pytest to only search within the tests/ directory, so removing "scripts" from norecursedirs won't cause pytest to search in the root scripts/ or automation/scripts/ directories. However, the PR description should be updated to accurately reflect what the change does: it removes "scripts" from the exclusion list to enable test discovery in tests/unit/automation/scripts/.
The pytest configuration was excluding all "scripts" directories from
test discovery, which prevented 108 automation tests in
tests/unit/automation/scripts/ from running in CI.
Changes:
of all "scripts" directories
Impact:
All 108 automation tests pass successfully.