Skip to content

chore(tests): Correct regex that was supposed to filter Singer output from CI logs - #608

Merged
edgarrmondragon merged 1 commit into
mainfrom
fix/singer-output-filter-regex
Sep 1, 2026
Merged

chore(tests): Correct regex that was supposed to filter Singer output from CI logs#608
edgarrmondragon merged 1 commit into
mainfrom
fix/singer-output-filter-regex

Conversation

@edgarrmondragon

Copy link
Copy Markdown
Member

Summary

  • CI logs are heavily polluted with raw Singer protocol output ({"type":"RECORD",...}, {"type":"SCHEMA",...}, etc.), sometimes multi-KB per line (e.g. full PR diffs embedded in issue_comments records) — see this failing run for an example.
  • tests/fixtures.py already anticipated this: since CI runs pytest --capture=no, it installs sys.stdout = FilterStdOutput(sys.stdout, r'{"type": ') at collection time specifically to hide Singer messages from the live log.
  • The regex has a bug: r'{"type": ' has a space after the colon, but singer-sdk serializes messages with compact JSON separators — {"type":"RECORD",...}, no space. The pattern therefore never matched anything, so the filter has silently done nothing since it was added.

Changes

  • Fixed the pattern to r'{"type":"', matching the SDK's actual compact output.

Test plan

  • Reproduced locally: ran pytest tests/test_tap.py -k test_get_a_repository_in_repo_list_mode --capture=no -q before/after the fix. Before: raw {"type":"SCHEMA",...} lines print directly to the terminal. After: those lines are gone; only structured logging output (which goes through a separate channel, e.g. METRIC: {"type":"timer",...}) remains.
  • ruff check / ruff format --check pass
  • tests/test_authenticator.py (unaffected unit tests) still pass

…rom CI logs

tests/fixtures.py already installs a FilterStdOutput wrapper around
sys.stdout to hide RECORD/SCHEMA/STATE messages during test runs (CI
uses `pytest --capture=no`, so these otherwise print straight to the
job log). Its regex, r'{"type": ' (with a space after the colon),
never matched anything: singer-sdk serializes messages with compact
JSON separators, e.g. {"type":"RECORD",...} with no space. The filter
has therefore never actually filtered, letting every RECORD (including
large ones like PR diffs) print directly into CI logs.

Fix the pattern to match the real compact format.
@edgarrmondragon
edgarrmondragon requested a review from a team as a code owner September 1, 2026 17:08
@edgarrmondragon edgarrmondragon changed the title fix(tests): correct regex that was supposed to filter Singer output from CI logs chore(tests): correct regex that was supposed to filter Singer output from CI logs Sep 1, 2026
@edgarrmondragon edgarrmondragon changed the title chore(tests): correct regex that was supposed to filter Singer output from CI logs chore(tests): Correct regex that was supposed to filter Singer output from CI logs Sep 1, 2026
@edgarrmondragon
edgarrmondragon added this pull request to the merge queue Sep 1, 2026
Merged via the queue into main with commit aade4c0 Sep 1, 2026
9 checks passed
@edgarrmondragon
edgarrmondragon deleted the fix/singer-output-filter-regex branch September 1, 2026 18:26
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