|
Option C Tools
|
Functions | |
| None | _make_project (Path root) |
| test_resolve_all_scope_includes_env_file (Path tmp_path) | |
| test_resolve_all_scope_includes_nested_pem (Path tmp_path) | |
| test_resolve_all_scope_prunes_excluded_dirs (Path tmp_path) | |
| test_secrets_pass_flags_env_file (Path tmp_path) | |
Purpose
-------
OI-505 regression coverage — at ``scope="all"`` the quality gate must see
non-Python files whose filename matches
``oct.core.exclusions.NEVER_EXPORT_FILE_PATTERNS`` (e.g. ``.env``,
``*.pem``, ``credentials.json``) so the filename-pattern secrets rule
can flag them. Before this fix ``_resolve_scope`` only returned
``.py`` files at ``scope="all"``, leaving those sensitive files invisible.
Responsibilities
----------------
- Verify ``scope="all"`` includes ``.env`` and other sensitive-filename
patterns in secrets scanning.
- Verify nested sensitive files below root are detected.
- Verify excluded directories (``.venv``, ``__pycache__``) are still
pruned.
Diagnostics
-----------
Domain: GIT-TESTS
Levels:
L2 — test lifecycle
L3 — assertion details
L4 — deep tracing
Contracts
---------
- A scaffolded project with a ``.env`` in its root must produce at
least one ``secrets_findings`` entry when run with ``scope="all"``.
- ``scope="all"`` must not miss files that live below the root (e.g.
``config/.env``).
- Excluded directories (``.venv`` / ``__pycache__``) must still be
pruned — a secret-named file inside them must not surface.
|
protected |
Create the minimal skeleton the quality gate expects.
Definition at line 54 of file test_quality_gate_all_scope.py.
| tests_git.test_quality_gate_all_scope.test_resolve_all_scope_includes_env_file | ( | Path | tmp_path | ) |
OI-505: a root-level ``.env`` is returned by ``_resolve_scope('all')``.
Definition at line 68 of file test_quality_gate_all_scope.py.
| tests_git.test_quality_gate_all_scope.test_resolve_all_scope_includes_nested_pem | ( | Path | tmp_path | ) |
OI-505: a nested ``*.pem`` file is captured too.
Definition at line 78 of file test_quality_gate_all_scope.py.
| tests_git.test_quality_gate_all_scope.test_resolve_all_scope_prunes_excluded_dirs | ( | Path | tmp_path | ) |
OI-505: a ``.env`` inside ``.venv`` or ``__pycache__`` is ignored.
Definition at line 89 of file test_quality_gate_all_scope.py.
| tests_git.test_quality_gate_all_scope.test_secrets_pass_flags_env_file | ( | Path | tmp_path | ) |
OI-505: end-to-end — secrets pass reports the ``.env`` finding.
Definition at line 104 of file test_quality_gate_all_scope.py.