Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallel mode: enable custom worker reporters and object references #4409

Merged
merged 3 commits into from
Oct 7, 2020

Conversation

boneskull
Copy link
Contributor

@boneskull boneskull commented Aug 18, 2020

@segrey please see this one. It will allow a reporter to call runner.linkPartialObjects(true) (see example in docstring) to replace duplicated deserialized objects with references. The objects themselves are still shallow, but if there's a particular property you need that is missing, we can likely add it.

I didn't test this too hard, but please let me know if this would help. I'm not sure about the missing root prop issue...

Ref: #4403

  • fixed an issue in rollup config causing weird problems
  • changed how we define global.Mocha in browser-entry.js (tangential)
  • removed object.assign polyfill (tangential)
  • renamed misnamed buffered-runner.spec.js to parallel-buffered-runner.spec.js

@boneskull boneskull added type: feature enhancement proposal area: node.js command-line-or-Node.js-specific area: parallel mode Regarding parallel mode labels Aug 18, 2020
@boneskull boneskull self-assigned this Aug 18, 2020
@coveralls
Copy link

coveralls commented Aug 18, 2020

Coverage Status

Coverage increased (+0.1%) to 94.059% when pulling 1288205 on boneskull/issue/4403-object-ids into df8e9e6 on master.

@boneskull boneskull added the status: waiting for author waiting on response from OP - more information needed label Aug 26, 2020
@segrey
Copy link
Contributor

segrey commented Aug 26, 2020

@boneskull Great! I've just tried it with the example from #4403, and now test objects are the same across different events. This fixes "started: false instead of started: true" sub-problem from #4403 description.

@boneskull boneskull force-pushed the boneskull/issue/4403-object-ids branch from de5bdfc to bf91eac Compare August 28, 2020 19:32
@boneskull
Copy link
Contributor Author

@segrey So this looks good as-is? I'll wrap it up then.

@boneskull boneskull force-pushed the boneskull/issue/4403-object-ids branch 4 times, most recently from 8211cd6 to 169593a Compare September 30, 2020 00:09
@boneskull boneskull changed the title POC for unique test/hook/suite identifiers parallel mode: enable custom worker reporters and object references Sep 30, 2020
@boneskull boneskull marked this pull request as ready for review September 30, 2020 00:11
@boneskull boneskull removed the status: waiting for author waiting on response from OP - more information needed label Sep 30, 2020
@boneskull boneskull force-pushed the boneskull/issue/4403-object-ids branch 2 times, most recently from aaa8424 to 87bb39b Compare September 30, 2020 00:12
@boneskull
Copy link
Contributor Author

@segrey if you can share it, I'd love to see the implementation you've built with this

@boneskull boneskull force-pushed the boneskull/issue/4403-object-ids branch from 87bb39b to 6f8a242 Compare September 30, 2020 00:25
@boneskull
Copy link
Contributor Author

@mochajs/core please review, otherwise will merge in next couple days

@segrey
Copy link
Contributor

segrey commented Sep 30, 2020

@boneskull Please see mocha-intellij.zip. Main reporter is mocha-intellij/lib/mochaIntellijReporter.js. There is some code duplication in main reporter and worker reporter, but it's just a proof-of-concept :)

There are some minor questions left in #4403 (comment). Would be great if you could take a look.

- `Suite`s, `Test`s, etc., now have unique identifiers which can optionally be used to re-created object references by a reporter which opts-in to the behavior
- A reporter can swap out the worker’s reporter for a custom one
- fixed an issue in rollup config causing weird problems
- changed how we define `global.Mocha` in `browser-entry.js` (tangential)
- removed `object.assign` polyfill (tangential)
- renamed misnamed `buffered-runner.spec.js` to `parallel-buffered-runner.spec.js`
- added a few unit tests
- refactored some tests; mainly modernizing some syntax
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
the only time this should happen in a non-unit-test context is when a mocha developer introduces a bug

also fix a `rewiremock` call in `ParallelBuffered` reporter tests
@boneskull boneskull force-pushed the boneskull/issue/4403-object-ids branch from 16d7960 to 1288205 Compare October 7, 2020 23:00
@boneskull boneskull merged commit ca9bfc7 into master Oct 7, 2020
@boneskull boneskull deleted the boneskull/issue/4403-object-ids branch October 7, 2020 23:20
@boneskull boneskull added the semver-minor implementation requires increase of "minor" version number; "features" label Oct 7, 2020
@boneskull boneskull added this to the v8.2.0 milestone Oct 7, 2020
@boneskull
Copy link
Contributor Author

@segrey This has landed... will be released in next version which will be v8.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: node.js command-line-or-Node.js-specific area: parallel mode Regarding parallel mode semver-minor implementation requires increase of "minor" version number; "features" type: feature enhancement proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants