test: add unit tests for services/session_parsers/claude_code.py#1445
Open
Madhumidha-S wants to merge 2 commits into
Open
test: add unit tests for services/session_parsers/claude_code.py#1445Madhumidha-S wants to merge 2 commits into
Madhumidha-S wants to merge 2 commits into
Conversation
Haz3-jolt
requested changes
Jun 17, 2026
|
|
||
| # ── Sample Claude Code JSONL lines ──────────────────────────────────────────── | ||
|
|
||
| USER_SIMPLE = '{"type":"user","message":{"content":"Hello world"},"timestamp":"2026-06-01T10:00:00.000Z"}' |
Contributor
There was a problem hiding this comment.
See these don't really follow the claude code jsonL pattern. If you do use. Claude code, copy over a small section containing tool calls and stuff. Copy that over and remove any PII. These don't follow that pattern.
If you don't have access to claude code, please pick another issue.
Author
There was a problem hiding this comment.
Thanks for the review!! I'll update the fixtures to match actual Claude Code JSONL data.
1c4fe72 to
0ecea9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose / Description
Adds unit testing for the Claude Code JSONL session parser to ensure transcript lines are correctly parsed into normalised frontend events.
Fixes
Approach
Created a new test suite (
tests/test_claude_code_session_parser.py) utilisingpytest. Modelled against the existing session parser tests, the suite injects raw JSONL text samples throughparse_rows.ingested_atsentinels) are handled gracefully.meta,agent-setting).How Has This Been Tested?
uv run pytest tests/test_claude_code_session_parser.py -v(all 23 tests passed).uv run ruff check --fix.make test).Checklist
AI Assistance
Was generative AI tooling used to co-author this PR?