Skip to content

Update test name on tests-start, guard updateTestName against double-prefixing - #1535

Merged
NullVoxPopuli merged 3 commits into
ember-cli:mainfrom
NullVoxPopuli:update-test-name-on-tests-start
Jul 28, 2026
Merged

Update test name on tests-start, guard updateTestName against double-prefixing#1535
NullVoxPopuli merged 3 commits into
ember-cli:mainfrom
NullVoxPopuli:update-test-name-on-tests-start

Conversation

@NullVoxPopuli

Copy link
Copy Markdown
Contributor

Important

made with claude

I'm not an expert in this codebase, and could be way off base, and I apologize if this is a waste of time / completely wrong


At AuditBoard we've been carrying this as a local patch to ember-exam for a while and it seems worth upstreaming.

Problem

patchTestemOutput only renames tests on the test-result event. Anything consuming testem's live progress reporting (the tests-start event) sees the unprefixed name, so a currently-running test can't be attributed to its partition/browser — which matters when tracking down which browser a hung or slow test belongs to.

Changes

  • patchTestemOutput now also subscribes to tests-start and applies the same rename (guarded with test?.name, since not every tests-start payload has a name).
  • updateTestName returns early if the name already contains the Exam Partition / Browser Id prefix, so renaming on both events doesn't stack prefixes onto the same test object.

Testing

Added unit tests to tests/unit/testem-output-test.js:

  • updateTestName is idempotent for already-prefixed names (partition and browser variants)
  • patchTestemOutput (with a stubbed Testem global) renames on tests-start, doesn't double-prefix on the subsequent test-result, and tolerates a tests-start payload without a name

All 12 tests in the module pass locally via ember test --filter="patch-testem-output".

🤖 Generated with Claude Code

When only the test-result event renames tests, live progress reporting
(the tests-start event) still shows the unprefixed name, so a running
test cannot be attributed to its partition/browser. Renaming on
tests-start as well fixes that, and updateTestName now returns early
if the name already carries the prefix so the two hooks do not stack
prefixes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
NullVoxPopuli and others added 2 commits July 28, 2026 15:36
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@NullVoxPopuli
NullVoxPopuli merged commit 7659905 into ember-cli:main Jul 28, 2026
13 of 16 checks passed
@NullVoxPopuli
NullVoxPopuli deleted the update-test-name-on-tests-start branch July 28, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant