You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No coverage report generated when used with @embroider/compat@^2.1.0 #374
I've noticed that with starting from @embroider/compat@2.1.0, the code coverage report no longer gets generated. The test build still success, but nothing is outputted in the log and no /coverage folder is generated.
Once I downgrade @embroider/compat@2.0.2, everything seems to work again.
Reacted by Cesare Puliatti, Eli Dupuis, Amaury and Corentin
Same problem here. Nothing is generated when @embroider/compat is at version ~2.1.0.
When downgrading, the coverage folder is only generated when using COVERAGE=true ember s and then going to http://localhost:4200/tests.
Doing COVERAGE=true ember test does not generate the coverage folder.
Just ran into this issue as well after upgrading embroider to 2.1.1 and ember-cli-code-coverage to 2.0.0. Reverting the embroider packages to ~2.0.2 appears to fix it for now.
Note that, for me, after reverting embroider everything is generated properly regardless of the command:
After some digging in Embroider and Ember-cli-code-coverage, I found the problem. (thanks @tniezurawski for the idea to look at the diff between the 2 releases).
Internally, ember-cli-code-coverage uses stableWorkspaceDir from @embroider/compat 0.x for getting the CWD generated by embroider. This method uses a md5 hash to get a semi-random project directory. But the method has changed in @embroider/compat 2.1.0 with a new environment parameter added to the hash. This mismatch in the function implementation will result in a wrong directory guess from ember-cli-code-coverage.
Maybe making @embroider/compat an optionalPeerDependency will solve the problem. The idea is to always have the same resolution mechanism than the installed embroider version. I will make a PR shortly.
I'm using "ember-cli-code-coverage": "file:../amaury-ember-cli-code-coverage/packages/ember-cli-code-coverage" for testing.
I think the github link does not work because the real package is in packages/ember-cli-code-coverage.
@AmauryD That works for me 👍 The report is generated.
@mansona#379 doesn't fix it for me. Actually, I'm getting an error that I don't observe on version 2.0.0 of ember-cli-code-coverage:
Cannot read properties of undefined (reading 'cleanup')
Stack Trace and Error Report: /var/folders/d8/h8767lqn0jb3h53qj9v70_l80000gn/T/error.dump.a194e2bae6ccc119c6ef41ed659b8792.log
The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
Stack Trace and Error Report: /var/folders/d8/h8767lqn0jb3h53qj9v70_l80000gn/T/error.dump.c50bde80232c21ff2c1df26192fec2f5.log
@tniezurawski I just noticed that my PR is out of date now so it wouldn't have the effect of making sure to use the right embroider version since 3.0 was released 🙈
Activity
AmauryD commentedon Feb 18, 2023
Same problem here. Nothing is generated when @embroider/compat is at version ~2.1.0.
When downgrading, the coverage folder is only generated when using
COVERAGE=true ember sand then going tohttp://localhost:4200/tests.Doing
COVERAGE=true ember testdoes not generate the coverage folder.Repro repository: https://github.com/TRIPTYK/ember-boilerplate .
elidupuis commentedon Mar 22, 2023
Just ran into this issue as well after upgrading embroider to
2.1.1and ember-cli-code-coverage to2.0.0. Reverting the embroider packages to~2.0.2appears to fix it for now.Note that, for me, after reverting embroider everything is generated properly regardless of the command:
COVERAGE=true ember testCOVERAGE=true ember test -sCOVERAGE=true ember sand using http://localhost:4200/testsAmauryD commentedon Mar 28, 2023
This problem was on my side. There was a misconfiguration of a service worker. It now works when downgrading to ~2.0.2.
tniezurawski commentedon May 19, 2023
Same here. I guess the changelog might help to understand where the issue came from:
Does anything ring a bell to anyone?
AmauryD commentedon May 19, 2023
After some digging in Embroider and Ember-cli-code-coverage, I found the problem. (thanks @tniezurawski for the idea to look at the diff between the 2 releases).
The culprit is this line : https://github.com/embroider-build/embroider/blob/34fec6c15b65ed79a31b9ad9066b5b0004cd4876/packages/compat/src/default-pipeline.ts#L20
Internally, ember-cli-code-coverage uses stableWorkspaceDir from @embroider/compat 0.x for getting the CWD generated by embroider. This method uses a md5 hash to get a semi-random project directory. But the method has changed in @embroider/compat 2.1.0 with a new environment parameter added to the hash. This mismatch in the function implementation will result in a wrong directory guess from ember-cli-code-coverage.
Maybe making @embroider/compat an optionalPeerDependency will solve the problem. The idea is to always have the same resolution mechanism than the installed embroider version. I will make a PR shortly.
tniezurawski commentedon May 22, 2023
@AmauryD That makes sense! I had a feeling that hashing can play a role here.
btw I wanted to try your chance to confirm it works for me, but I am getting an error:
Do you know if I pointed to the fork in the wrong way or if that's something else? 🤔 (it's installing without problems)
AmauryD commentedon May 22, 2023
I'm using
"ember-cli-code-coverage": "file:../amaury-ember-cli-code-coverage/packages/ember-cli-code-coverage"for testing.I think the github link does not work because the real package is in
packages/ember-cli-code-coverage.mansona commentedon May 22, 2023
Does #379 fix this? Does anyone know? or is it not just because of a mismatch of embroider versions?
tniezurawski commentedon May 22, 2023
@AmauryD That works for me 👍 The report is generated.
@mansona #379 doesn't fix it for me. Actually, I'm getting an error that I don't observe on version
2.0.0ofember-cli-code-coverage:I'm not sure what is the direct reason 🤷♂️
mansona commentedon May 23, 2023
@tniezurawski I just noticed that my PR is out of date now so it wouldn't have the effect of making sure to use the right embroider version since 3.0 was released 🙈