fix(workers): deserialize step events before emitting to master process#5565
Open
gololdf1sh wants to merge 1 commit into
Open
fix(workers): deserialize step events before emitting to master process#5565gololdf1sh wants to merge 1 commit into
gololdf1sh wants to merge 1 commit into
Conversation
Step events (started, finished, passed, failed) were emitted as raw plain objects from IPC serialization. Plugins listening to these events received objects without Step class methods (toString, toCliStyled), causing [object Object] in reporter output. Apply the same deserialization pattern already used for test events (deserializeTest) — wrap message.data in a Step instance via Object.assign(new Step(data.title), data). Ref: testomatio/e2e-tests#151 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In
run-workersmode, step events (step.started,step.finished,step.passed,step.failed) are emitted as raw plain objects from IPC serialization. These objects lack Step class methods (toString(),toCliStyled()), so any plugin or reporter callingstep.toString()gets"[object Object]"instead of the actual step description.This affects all consumers of step events in worker mode — for example,
@testomatio/reportershows:Test events already go through
deserializeTest()which restores a full object with methods. Step events had no equivalent deserialization — this PR adds it.Solution
Add
deserializeStep()— a one-liner that wraps the serialized data in aStepinstance viaObject.assign(new Step(data.title), data), matching the pattern already used insidedeserializeTestfortest.steps(seelib/mocha/test.js:80).Apply it to all four step event types before emitting.
Related