Skip to content

refactor: extract testFilterArgs helper for consistent test filter handling#5

Merged
maatheusgois-dd merged 1 commit into
mainfrom
maatheusgois-dd/refactor-test-filter-args
May 20, 2026
Merged

refactor: extract testFilterArgs helper for consistent test filter handling#5
maatheusgois-dd merged 1 commit into
mainfrom
maatheusgois-dd/refactor-test-filter-args

Conversation

@maatheusgois-dd

Copy link
Copy Markdown
Contributor

Summary

  • Extracts duplicated --test_filter argument construction into a centralized testFilterArgs() helper in src/core/bazel.ts
  • Adds support for pipe-separated test filter values (e.g. "SuiteA |SuiteB") which are converted to comma-separated format for rules_apple compatibility
  • Replaces inline logic across 5 files (build.ts, device.ts, macos.ts, multi-platform.ts, streaming.ts) with the shared helper

Scope

  • Bazel build/test/discovery
  • MCP server/tools

Validation

  • npm run lint
  • npm run typecheck
  • npm test

Compatibility

  • No compatibility impact

Notes For Reviewers

The testFilterArgs function handles three cases:

  1. Falsy/empty input → returns []
  2. Simple string → returns ["--test_filter=value"]
  3. Pipe-separated string → splits on |, trims, joins with , → returns ["--test_filter=A,B,C"]

All 434 tests pass, including 4 new unit tests for the helper.

Made with Cursor

…ndling

Centralizes test filter argument construction into a single `testFilterArgs()` function in `src/core/bazel.ts`, replacing duplicated inline logic across 5 handler/streaming files. Adds support for pipe-separated values (e.g. "SuiteA |SuiteB") which are converted to comma-separated format for rules_apple compatibility.

Co-authored-by: Cursor <cursoragent@cursor.com>
@maatheusgois-dd maatheusgois-dd self-assigned this May 20, 2026
@codecov

codecov Bot commented May 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.33333% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tools/streaming.ts 0.00% 5 Missing ⚠️
src/tools/handlers/build.ts 50.00% 2 Missing ⚠️
src/tools/handlers/macos.ts 60.00% 2 Missing ⚠️
src/tools/handlers/device.ts 50.00% 1 Missing ⚠️
src/tools/handlers/multi-platform.ts 80.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@maatheusgois-dd
maatheusgois-dd marked this pull request as ready for review May 20, 2026 23:27
@maatheusgois-dd
maatheusgois-dd merged commit c6ddd06 into main May 20, 2026
7 checks passed
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