Skip to content

Add independent log parser fixtures#51

Open
mohamedjaazeer4-sketch wants to merge 1 commit into
weilixiong:mainfrom
mohamedjaazeer4-sketch:issue5-independent-log-parser-fixtures
Open

Add independent log parser fixtures#51
mohamedjaazeer4-sketch wants to merge 1 commit into
weilixiong:mainfrom
mohamedjaazeer4-sketch:issue5-independent-log-parser-fixtures

Conversation

@mohamedjaazeer4-sketch

Copy link
Copy Markdown

Summary

Adds independent hand-written log parser fixtures for tools/log_aggregator.py and a focused validation test covering:

  • structured JSON log parsing
  • plain text log parsing
  • nginx access log parsing
  • malformed JSON handling
  • aggregator parser routing for nginx logs

Also updates parser order from:

[JSONLogParser(), TextLogParser(), NginxLogParser()]

to:

[JSONLogParser(), NginxLogParser(), TextLogParser()]

This prevents the generic text parser from swallowing nginx access logs before NginxLogParser can parse them.

Validation performed

python3 tests/test_log_aggregator_independent_fixtures.py
python3 -m py_compile tools/log_aggregator.py tests/test_log_aggregator_independent_fixtures.py

Focused test result:

PASS test_json_fixture
PASS test_plain_text_fixture
PASS test_nginx_fixture_direct_parser
PASS test_malformed_json_does_not_crash_json_parser
PASS test_aggregator_routes_nginx_before_generic_text_parser
ALL LOG AGGREGATOR FIXTURE TESTS PASSED

Full build note

I attempted the full build locally, but the environment is missing npm, so the frontend build could not run.

Error:

FileNotFoundError: [Errno 2] No such file or directory: 'npm'

Notes

The fixtures are hand-written representative examples and are not generated by the parser implementation.

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