Skip to content

Comments

Fix: restore “Run tests by group” command after refactor#346

Merged
recca0120 merged 2 commits intorecca0120:mainfrom
Jhuntenburg:fix/run-group-command
Feb 15, 2026
Merged

Fix: restore “Run tests by group” command after refactor#346
recca0120 merged 2 commits intorecca0120:mainfrom
Jhuntenburg:fix/run-group-command

Conversation

@Jhuntenburg
Copy link
Contributor

@Jhuntenburg Jhuntenburg commented Feb 15, 2026

Summary

Restores end-to-end “run tests by group” support by bringing back the missing command + runner wiring.

Problem

Group tags/filtering exist in the UI, but after the recent refactor there was no longer a way to run an entire group (the phpunit.run-by-group command + execution path were missing), so the correct --group=<name> CLI args were never invoked.

Changes

  • Re-added command contribution + wiring:
    • PHPUnit: Run tests by group (phpunit.run-by-group)
  • Implemented the command flow to:
    • discover available groups
    • QuickPick a group
    • run that group using --group=<selected>
  • Added a dedicated group-run path in the run handler using single-process mode so the group arg is respected consistently.
  • Added regression coverage for:
    • group discovery (findGroups, findTestsByGroup)
    • command registration and execution behavior

How to test (manual)

  1. npm ci
  2. npm run compile
  3. Press F5 to launch the Extension Development Host
  4. Open a workspace with tests containing @group / #[Group]
  5. Run: PHPUnit: Run tests by group
  6. Select a group (e.g. integration)
  7. Confirm the runner includes --group=<name> and only those tests execute

Add phpunit.run-by-group command that displays a quick pick menu of all
available PHPUnit groups (from @group annotations or #[Group] attributes)
and runs the selected group's tests.

- Add TestCollection.findGroups() to collect unique group tags
- Add TestCollection.findTestsByGroup() to filter tests by group tag
- Add TestRunHandler.startGroupTestRun() to execute group-filtered runs
  with --group flag and force single process mode
- Add show
…empty

Reload test files before showing group picker if findGroups() returns
empty, ensuring groups are available even when tests haven't been
preloaded. Pass TestRunProfile to startGroupTestRun() so the request
uses the correct profile context.

- Add reloadAll() call in runByGroup() when groups.length === 0
- Add profile parameter to TestRunHandler.startGroupTestRun()
- Pass profile to TestRunRequest constructor in startGroupTestRun()
@Jhuntenburg Jhuntenburg changed the title Fix/run group command Fix: restore “Run tests by group” command after refactor Feb 15, 2026
@Jhuntenburg Jhuntenburg marked this pull request as ready for review February 15, 2026 01:36
@recca0120 recca0120 merged commit 1ca073f into recca0120:main Feb 15, 2026
9 checks passed
@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (8d508bf) to head (57231e1).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #346   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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