Skip to content

Add independent log parser fixtures#47

Open
bingmokaka wants to merge 1 commit into
weilixiong:mainfrom
bingmokaka:independent-log-parser-fixtures
Open

Add independent log parser fixtures#47
bingmokaka wants to merge 1 commit into
weilixiong:mainfrom
bingmokaka:independent-log-parser-fixtures

Conversation

@bingmokaka

Copy link
Copy Markdown

Summary

Adds independent hand-written parser fixtures for the legacy log aggregator so JSON, plain text, nginx, and malformed log paths are validated without parser-generated samples.

Changes

  • Added fixture files under tests/fixtures/log_aggregator/ for JSON, plain text, nginx access logs, and a malformed/unsupported line.
  • Added tests/test_log_aggregator_fixtures.py using unittest to verify timestamp, level, service/format, and key parsed fields.
  • Fixed two parser issues exposed by the fixtures:
    • Route nginx parsing before the plain-text fallback in LogAggregator.
    • Read nginx remote_user from the correct captured field.

Testing

  • python -m unittest tests.test_log_aggregator_fixtures -v passes: 5 tests.
  • python tools/log_aggregator.py --input tests/fixtures/log_aggregator/nginx.log --output diagnostic/log_aggregator_smoke.json --format json passes locally and reports one nginx error entry.
  • python build.py was attempted but the Windows environment lacks the full multi-language toolchain and npm, so the all-module build crashes when spawning npm install for frontend.
  • python build.py -m backend was also attempted; it reached diagnostic finalization but failed because the bundled encryptly diagnostic pack step returned an error in this Windows environment. No new diagnostic artifact was committed.

Checklist

  • Relevant modules affected by these changes build locally
  • Tests pass locally
  • Diagnostic build log is committed in this PR
  • Documentation has been updated, if applicable
  • Configuration or schema changes are documented, if applicable
  • No generated build artifacts are committed, except the required diagnostic build log
  • Changes are scoped to the PR purpose and avoid unrelated cleanup
  • Security, privacy, and error-handling implications have been considered

  • I would like to request that my diagnostic build log is removed before merging

Closes #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[$25 BOUNTY] [Python] Add independent log parser fixtures

1 participant