Skip to content

test(worker): gate test utility diagnostic logs#11

Merged
zebbern merged 1 commit into
mainfrom
codex/quiet-worker-test-utils
Jun 20, 2026
Merged

test(worker): gate test utility diagnostic logs#11
zebbern merged 1 commit into
mainfrom
codex/quiet-worker-test-utils

Conversation

@zebbern

@zebbern zebbern commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • gate worker test helper TRACE:/LOG: console mirroring behind SENTRIS_DEBUG_TESTS=1
  • keep trace/log collector behavior unchanged for assertions
  • add a regression test covering default quiet behavior and explicit debug opt-in

Verification

  • red test first: bun test worker/src/testing/__tests__/test-utils.test.ts failed with 2 default console.log calls
  • bun test worker/src/testing
  • bun test worker/src/components/it-automation
  • git diff --check
  • bun run lint
  • bun run test
  • bun run typecheck
  • git push -u origin codex/quiet-worker-test-utils pre-push hook

Signed-off-by: zebbern <185730623+zebbern@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 20, 2026 17:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces noise in worker tests by gating the createMockTrace() / createMockLogCollector() console mirroring behind an opt-in env var (SENTRIS_DEBUG_TESTS=1), while preserving the underlying event/log collection used for assertions.

Changes:

  • Add shouldMirrorTestDiagnostics() to conditionally mirror TRACE: / LOG: output only when SENTRIS_DEBUG_TESTS === '1'.
  • Keep trace/log collection behavior unchanged (events/logs are still recorded for tests to assert on).
  • Add a regression test verifying default quiet behavior and explicit debug opt-in.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
worker/src/testing/test-utils.ts Gates diagnostic console.log mirroring behind SENTRIS_DEBUG_TESTS=1 without changing collected trace/log data.
worker/src/testing/__tests__/test-utils.test.ts Adds coverage ensuring console mirroring is off by default and on when explicitly enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zebbern zebbern merged commit 17b1d5a into main Jun 20, 2026
6 checks passed
@zebbern zebbern deleted the codex/quiet-worker-test-utils branch June 20, 2026 17:09
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.

2 participants