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
Member

@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 self-assigned this Aug 18, 2020
@boneskull boneskull added this to In progress in Maintainer TODO via automation Aug 18, 2020
@coveralls
Copy link

@coveralls 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.

@segrey
Copy link
Contributor

@segrey 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 Aug 28, 2020
@boneskull
Copy link
Member Author

@boneskull boneskull commented Sep 29, 2020

@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 Sep 29, 2020
@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 Sep 30, 2020
@boneskull boneskull force-pushed the boneskull/issue/4403-object-ids branch 2 times, most recently from aaa8424 to 87bb39b Sep 30, 2020
@boneskull
Copy link
Member Author

@boneskull boneskull commented Sep 30, 2020

@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 Sep 30, 2020
@boneskull boneskull moved this from In progress to NEEDS REVIEW in Maintainer TODO Sep 30, 2020
@boneskull
Copy link
Member Author

@boneskull boneskull commented Sep 30, 2020

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

@segrey
Copy link
Contributor

@segrey 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.

boneskull added 3 commits Aug 18, 2020
- `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 Oct 7, 2020
@boneskull boneskull merged commit ca9bfc7 into master Oct 7, 2020
38 checks passed
38 checks passed
Retrive head commit message
Details
Retrive head commit message
Details
Check to skip CI
Details
Check to skip CI
Details
Smoke [Node.js v10 / ubuntu-latest]
Details
Smoke [Node.js v10 / ubuntu-latest]
Details
Smoke [Node.js v12 / ubuntu-latest]
Details
Smoke [Node.js v12 / ubuntu-latest]
Details
Smoke [Node.js v14 / ubuntu-latest]
Details
Smoke [Node.js v14 / ubuntu-latest]
Details
Smoke [Node.js v10 / windows-2019]
Details
Smoke [Node.js v10 / windows-2019]
Details
Smoke [Node.js v12 / windows-2019]
Details
Smoke [Node.js v12 / windows-2019]
Details
Smoke [Node.js v14 / windows-2019]
Details
Smoke [Node.js v14 / windows-2019]
Details
ESLint Check
Details
ESLint Check
Details
Markdown Check
Details
Markdown Check
Details
Node.js [v10 / ubuntu-latest]
Details
Node.js [v10 / ubuntu-latest]
Details
Node.js [v12 / ubuntu-latest]
Details
Node.js [v12 / ubuntu-latest]
Details
Node.js [v14 / ubuntu-latest]
Details
Node.js [v14 / ubuntu-latest]
Details
Node.js [v10 / windows-2019] Node.js [v10 / windows-2019]
Details
Node.js [v10 / windows-2019] Node.js [v10 / windows-2019]
Details
Node.js [v12 / windows-2019] Node.js [v12 / windows-2019]
Details
Node.js [v12 / windows-2019] Node.js [v12 / windows-2019]
Details
Node.js [v14 / windows-2019] Node.js [v14 / windows-2019]
Details
Node.js [v14 / windows-2019] Node.js [v14 / windows-2019]
Details
ESLint Results Checks Complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.1%) to 94.059%
Details
licence/cla Contributor License Agreement is signed.
Details
netlify/mocha/deploy-preview Deploy preview ready!
Details
Maintainer TODO automation moved this from NEEDS REVIEW to Done Oct 7, 2020
@boneskull boneskull deleted the boneskull/issue/4403-object-ids branch Oct 7, 2020
@boneskull boneskull added this to the v8.2.0 milestone Oct 7, 2020
@boneskull
Copy link
Member Author

@boneskull boneskull commented Oct 7, 2020

@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
Projects
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.