test: add independent log parser fixtures - #76
Open
GioLealhmx wants to merge 4 commits into
Open
Conversation
Author
|
Hi maintainers — the required GitHub Actions workflow for this fork PR is currently showing Local verification is documented in the PR body:
Could you please approve the workflow run when convenient? I’ll follow up if CI reports anything actionable. |
1 similar comment
Author
|
Hi maintainers — the required GitHub Actions workflow for this fork PR is currently showing Local verification is documented in the PR body:
Could you please approve the workflow run when convenient? I’ll follow up if CI reports anything actionable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/claim #5
Summary
Fixes #5 by adding independent, fixture-backed coverage for the legacy log aggregator parsers. The new fixtures are handwritten production-like samples for JSON, plain text, nginx access logs, and malformed/unsupported input, so the tests no longer depend on data generated by the parser itself.
The independent nginx fixture exposed two small parser bugs, which this PR fixes: nginx lines now reach the nginx parser before the generic text fallback, and
remote_usernow maps to the nginx remote user field instead of the ident field.Changes
tools/tests/fixtures/log_aggregator/for JSON, text, nginx, and malformed lines.tools/tests/test_log_aggregator_fixtures.pyusing only the Python standard library/unittest.NginxLogParserruns beforeTextLogParser.remote_userextraction to use the correct regex group.build.pyso missing optional toolchains are reported as module failures instead of aborting before diagnostics are generated.Testing
python -m py_compile build.py tools/log_aggregator.py— PASSpython -m unittest discover -s tools/tests -p "test_*.py" -v— PASS, 5 testspython build.py— ran and generated required diagnostics:diagnostic/build-a17cdea5.logdanddiagnostic/build-a17cdea5-metadata.json. Exit code was 1 because this Windows environment lacks several unrelated toolchains; the diagnostic metadata records 2 passed modules (market, compliance) and 8 missing-toolchain failures.Checklist