Deduplicate shared ParsedLogEntry fixtures across log tests#4208
Deduplicate shared ParsedLogEntry fixtures across log tests#4208Copilot wants to merge 3 commits into
Conversation
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
✨ New Files (1 files)
Coverage comparison generated by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR consolidates duplicated Squid ParsedLogEntry and raw access-log fixtures across multiple log-related unit test suites into a shared test utility, reducing drift risk and making fixture updates easier to manage.
Changes:
- Added a shared log test fixture utility (
createLogEntry,createRawLogLine) undersrc/logs/. - Updated log test suites to consume the shared fixture instead of maintaining local copies of the canonical entry/log line.
- Simplified/standardized per-test overrides to focus only on scenario-specific fields.
Show a summary per file
| File | Description |
|---|---|
| src/logs/log-test-fixtures.test-utils.ts | Introduces shared factories for canonical parsed log entries and raw Squid log lines. |
| src/logs/log-streamer.test.ts | Replaces duplicated raw log strings with createRawLogLine() usage. |
| src/logs/log-formatter.test.ts | Switches allowed/denied ParsedLogEntry fixtures to createLogEntry() with overrides. |
| src/logs/log-aggregator.test.ts | Uses shared fixture helpers for parsed entries and selected raw log inputs; removes local helper duplication. |
| src/logs/audit-enricher.test.ts | Updates the local makeEntry() wrapper to compose from the shared createLogEntry() fixture. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 1
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Smoke Test: Claude Engine
Result: PASS
|
|
Recent merged PRs:\n- refactor(api-proxy): extract duplicate collectLogOutput() into shared test helper\n- [Test Coverage] container-lifecycle.ts branch coverage\n\nChecks:\n- GitHub reads ✅\n- Playwright ✅\n- File write/read ✅\n- Discussion lookup/comment ✅\n- Build ✅\n\nOverall: PASS Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
🔥 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( PR author: Overall: PARTIAL (pre-step outputs not injected into prompt)
|
🔬 Smoke Test Results
PR: Deduplicate shared ParsedLogEntry fixtures across log tests Overall: PASS
|
Chroot Smoke Test Results
Result: FAILED — Python and Node.js versions differ between host and chroot.
|
|
Gemini Smoke Test Results:
Overall Status: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results — Services Connectivity
Overall: FAIL
|
Several log tests were each carrying their own copy of the same canonical
ParsedLogEntryand Squid access log line, which made the test fixture shape drift-prone. This consolidates those defaults into one test utility and updates the affected log suites to consume the shared fixture.Shared log test fixture
src/logs/log-test-fixtures.test-utils.tscreateLogEntry(overrides)createRawLogLine(overrides)so tests using raw Squid lines derive from the same source of truthUpdated affected log test suites
log-formatter.test.tsnow builds allowed/denied entries from the shared fixturelog-aggregator.test.tsimports the shared parsed-entry factory and raw log-line helper instead of defining its own local defaultsaudit-enricher.test.tskeeps its localmakeEntry()wrapper but now composes it from the shared fixturelog-streamer.test.tsreplaces duplicated raw Squid log strings withcreateRawLogLine()Result