Skip to content

Add independent log parser fixtures#61

Open
glm-5-2 wants to merge 1 commit into
weilixiong:mainfrom
glm-5-2:bounty-log-parser-fixtures
Open

Add independent log parser fixtures#61
glm-5-2 wants to merge 1 commit into
weilixiong:mainfrom
glm-5-2:bounty-log-parser-fixtures

Conversation

@glm-5-2

@glm-5-2 glm-5-2 commented Jul 11, 2026

Copy link
Copy Markdown

Bounty: $25 — Independent log parser fixtures

Issue

#5

What this does

Adds independent parser fixtures based on hand-written representative log lines, covering the main parser paths without relying on parser-generated test data.

Files

  • tests/fixtures/json_logs.txt — 4 hand-written JSON log lines + 1 invalid
  • tests/fixtures/text_logs.txt — 4 hand-written text log lines + 1 empty
  • tests/fixtures/nginx_logs.txt — 4 hand-written nginx access log lines
  • tests/test_log_parser_fixtures.py — 15 tests across all 3 parsers

Tests

  • JSONLogParser: 5 tests (standard, Elasticsearch format, alt keys, invalid, all valid)
  • TextLogParser: 4 tests (standard, empty line, all non-empty, raw preservation)
  • NginxLogParser: 6 tests (GET, POST, 429, 304, all valid, invalid line)

Why these are independent

The fixtures are hand-written to represent real-world log formats — NOT generated by the parser code itself. This eliminates the 40% false-pass rate mentioned in the issue.

- Hand-written JSON, text, and nginx log fixtures (NOT generated by parser)
- Tests cover: standard formats, alternative keys, edge cases, invalid input
- JSON: 5 tests (standard, Elasticsearch, alt keys, invalid JSON, all valid)
- Text: 4 tests (standard, empty line, all non-empty, raw preservation)
- Nginx: 6 tests (GET, POST, 429, 304, all valid, invalid line)
- Fixes false-pass issue where test data was generated by parser code
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.

1 participant