Skip to content

Add independent log-parser fixtures and validation script (#5)#63

Open
harshith8gowda wants to merge 5 commits into
weilixiong:mainfrom
harshith8gowda:bounty-5-2026-07-13
Open

Add independent log-parser fixtures and validation script (#5)#63
harshith8gowda wants to merge 5 commits into
weilixiong:mainfrom
harshith8gowda:bounty-5-2026-07-13

Conversation

@harshith8gowda

@harshith8gowda harshith8gowda commented Jul 13, 2026

Copy link
Copy Markdown

Summary

Adds independent log-parser fixtures and a validation script for tools/log_aggregator.py. The legacy parser test data was generated by the same parser logic and could false-pass; these fixtures are hand-written from real log examples and were never produced by the parser.

Changes

  • tools/tests/fixtures/json_sample.log — 3 structured JSON lines (level / severity / lvl variants)
  • tools/tests/fixtures/text_sample.log — 3 plain-text lines (ISO, standard, syslog timestamps)
  • tools/tests/fixtures/nginx_sample.log — 2 nginx access-log lines (status 200 and 500)
  • tools/tests/fixtures/malformed.log — 4 partial / unsupported lines that must not crash parsing
  • tools/tests/test_log_parser_fixtures.py — validation script asserting timestamp, level, service/format, and key fields for each format, plus malformed-line safety
  • tools/tests/README.md — explains fixture source and how to run the validation

Testing

python3 tools/tests/test_log_parser_fixtures.py

Result: 34/34 checks passed on the committed hand-written fixtures (ran locally, exit 0).

  • JSON: level/service/timestamp/message extraction verified across three field-name variants
  • Text: [auth] bracket service, ISO/standard/syslog timestamps, level tokens
  • Nginx: status -> level mapping (200 info, 500 error), request/remote_addr extraction
  • Malformed: broken JSON and garbage lines handled without raising

Did NOT change production parsing behavior. CLI aggregation remains compatible.

Checklist

  • Relevant modules affected by these changes build locally (no production code changed)
  • Tests pass locally (34/34 fixture checks)
  • Diagnostic build log is committed in this PR (see note below)
  • Documentation has been updated (README added)
  • Changes are scoped to the PR purpose and avoid unrelated cleanup
  • Security, privacy, and error-handling implications have been considered

Diagnostic build note

The repo python3 build.py diagnostic step requires the full multi-language toolchain (cargo, npm, go, gcc, cmake) plus the encryptly Windows binary, which is not available in this Linux-based CI environment, so a .logd could not be generated here. The validation script above is self-contained and is the substantive evidence for this fixtire/validation bounty. A diagnostic/build-1462fe7e.json artifact from a scoped build.py -m backend run is included for transparency.

Closes #5

lobster-trap and others added 5 commits June 16, 2026 11:25
Hand-written fixtures (JSON, text, nginx) plus a malformed-line safety case,
and a validation script asserting timestamp/level/service/key-field extraction.
Fixes the false-pass risk in the legacy parser test data (bounty jackjin1997#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

2 participants