Skip to content

Add independent log parser fixture tests#34

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

Add independent log parser fixture tests#34
pengyuayn wants to merge 1 commit into
weilixiong:mainfrom
pengyuayn:add-independent-log-parser-fixtures

Conversation

@pengyuayn

Copy link
Copy Markdown

Summary

Adds independent, hand-written log parser fixtures for JSON, plain-text, nginx-style access logs, and malformed/unsupported lines. The fixtures validate parser output without relying on samples generated by the parser itself.

Changes

  • Added tests/fixtures/log_aggregator/ with representative JSON, text, nginx, and malformed log lines.
  • Added tests/test_log_aggregator_fixtures.py covering timestamp, level, service/format, nginx key fields, malformed input behavior, and CLI export compatibility.
  • Fixed a clear parser bug exposed by the JSON fixture: JSON ISO-8601 timestamps are now normalized to epoch seconds so CLI summary/time-range generation does not crash.

Validation

  • python3 -m unittest tests/test_log_aggregator_fixtures.py passes: 5 tests OK.
  • python3 build.py was run. It completed module execution but exited non-zero in this local macOS environment because cargo/go/luac/ghc are not installed and frailbox C compilation fails locally. It attempted to create diagnostic/build-bf2147ac.logd, but encryptly failed during logd creation, so no diagnostic artifact was produced on this machine.

Notes

Fixture source/intent: the log lines are hand-written representatives of archived production-like formats, not generated by tools/log_aggregator.py. They are intentionally small and focused on parser contract validation.

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