Skip to content

fix: propagate dataset parent status when no testSuiteFinished event is emitted#409

Closed
recca0120 wants to merge 2 commits into
mainfrom
fix/dataset-parent-status-propagation
Closed

fix: propagate dataset parent status when no testSuiteFinished event is emitted#409
recca0120 wants to merge 2 commits into
mainfrom
fix/dataset-parent-status-propagation

Conversation

@recca0120

Copy link
Copy Markdown
Owner

Fixes #404

Root Cause

When Pest runs dataset tests inside describe() blocks, it emits testStarted/testFinished events for each dataset child, but no testSuiteStarted/testSuiteFinished for the parent test node. The parent's icon therefore never updated even after all children passed.

Fix

TestResultObserver now tracks child completion state. When all tracked children of a parent have finished (passed/failed/skipped) and no suite event was received for the parent, the parent's status is automatically propagated:

  • All children passed → parent marked as passed
  • Any child failed → parent marked as failed
  • Parent already received testSuiteFinished → no double-marking

Test plan

  • pnpm -C packages/extension test -- --run passes (all tests green)
  • describe("something", fn() => it(...)->with([4, 8])) — parent icon updates after children finish
  • Normal PHPUnit tests (with testSuiteStarted/testSuiteFinished) unaffected

…s) dataset tests

Pest v4 emits php_qn:// locationHints pointing to TestCaseFactory.php (eval'd code)
instead of the actual test file. The __pest_evaluable__ encoding uses _ for space/
backslash/backtick and __ for literal underscore, with _→_ separating describe segments.

- TestIdentifierFactory: route php_qn:// with P\ class prefix to Pest identifier
- PestTestIdentifier: handle php_qn:// by extracting classFQN and deriving file path
- PestV2Fixer: add decodeEvaluableV4() with FQN heuristic for describe block names
…is emitted

When Pest runs dataset tests inside describe() blocks, it emits testStarted/
testFinished events for each dataset child but no testSuiteStarted/testSuiteFinished
for the parent test node. This caused the parent icon to remain unchanged even
after all children passed or failed.

TestResultObserver now tracks completed and failed children. When all tracked
children of a parent have finished and no suite event was received for the parent,
the parent's status is automatically propagated from its children's results.
@recca0120

Copy link
Copy Markdown
Owner Author

Closing - this should be part of #408. The approach also needs rethinking.

@recca0120 recca0120 closed this Mar 12, 2026
@recca0120 recca0120 deleted the fix/dataset-parent-status-propagation branch March 13, 2026 16:14
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.

Sections described as MyClass::class break the Test Explorer

1 participant