Commit 1496397
fix: address Copilot review findings on PR owasp-modsecurity#3594
- tests/pytest.ini: [tool:pytest] is only honored in setup.cfg, not a
standalone pytest.ini (needs [pytest] there). Confirmed empirically:
--strict-markers was silently not enforced (an unregistered marker
only warned, never errored) - the markers that did appear were
registered by conftest.py's pytest_configure hook, not this file.
addopts/testpaths/filterwarnings were all being silently ignored.
- dump_regression_fixtures.pl / regression_fixtures.py: the dumper
baked this-machine's absolute paths (from $ENV{DEBUG_LOG} etc.
interpolated into .t files) directly into the checked-in fixture
JSON, which would fail regression tests (and the CI fixture-
staleness check) on any other machine, including CI. Real paths are
still used while evaluating .t files (so conf=>sub{} coderefs that
do real file I/O keep working), but the dumper now swaps them for
portable "##KEY##" placeholders in the JSON it emits, longest value
first so a shorter path that's a prefix of a longer one doesn't
break the longer match. regression_fixtures.py resolves the same
keys for the local machine and substitutes them back in when
loading a fixture. Verified zero absolute local paths remain in any
checked-in fixture, and the full regression suite still passes.
- test_base64decode.py: `assert result.success or case["ret"] == 0`
always passed for ret=0 cases regardless of the actual result,
masking a real bug - the "Completely invalid" case's expected
output was simply wrong (verified against msc_test directly:
base64Decode lenient-decodes valid-looking characters rather than
failing, producing specific non-empty bytes, not "" with ret=0).
Fixed the expected data and removed the always-true fallback.
- apache_server.py: only pass `-d <ServerRoot>` to httpd when
_resolve_server_root() actually found one, instead of passing -d
with an empty string on failure.
- Corrected the PR description: two hand-written unit test files
(test_beginswith.py, test_base64decode.py) carry edge-case coverage
beyond their source .t file, contradicting the "same test data, no
new cases" framing for the migration overall.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 2c7af26 commit 1496397
25 files changed
Lines changed: 120 additions & 36 deletions
File tree
- tests
- regression/fixtures
- action
- config
- misc
- rule
- target
- test_transformations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| |||
239 | 246 | | |
240 | 247 | | |
241 | 248 | | |
242 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments