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
Utilizing embroider >2 (as of writing, 3.2) coverage is not generated.
From initial debugging, a couple things ive noticed:
The stableWorkspaceDir (@embroider/compat) method returns a directory that does not match the build directory that is printed when the build completes before tests are run (Built in ....) -- Unsure if this is actually an issue, or Istanbul simply needs an empty directory to work from
testMiddleware method is registered, but the app never POSTs back (coverageHandler is never invoked)
If running with --server flag, sendCoverage is invoked, but window.__coverage__ is empty
But in later versions of embroider, i'm unsure what is used to determine that build dir:
embroider/compat v1.8.3 (older version)
functiondefaultPipeline(emberApp,packager,options={}){letoutputPath;letaddons;if(process.env.REUSE_WORKSPACE){addons=new_1.PrebuiltAddons(emberApp,options,process.env.REUSE_WORKSPACE);}else{if(process.env.SAVE_WORKSPACE){options.workspaceDir=process.env.SAVE_WORKSPACE;}else{options.workspaceDir=stableWorkspaceDir(emberApp.project.root);// <----------- Same method used here}emberApp.project.ui.write(`Building into ${options.workspaceDir}\n`);addons=new_1.Addons(emberApp,options);addons.ready().then(result=>{outputPath=result.outputPath;});}if(process.env.STAGE1_ONLY){return(0,broccoli_merge_trees_1.default)([addons.tree,(0,broccoli_file_creator_1.default)('.stage1-output',()=>outputPath)]);}letembroiderApp=new_1.App(emberApp,addons,options);if(process.env.STAGE2_ONLY||!packager){return(0,broccoli_merge_trees_1.default)([embroiderApp.tree,(0,broccoli_file_creator_1.default)('.stage2-output',()=>outputPath)]);}letBroccoliPackager=(0,core_1.toBroccoliPlugin)(packager);letvariants=(options&&options.variants)||defaultVariants(emberApp);returnnewBroccoliPackager(embroiderApp,variants,options&&options.packagerOptions);}
embroider/compat v3.2.1 (recent version)
// Method not used; unsure how build dir setfunctiondefaultPipeline(emberApp,packager,options={}){letoutputPath;letaddons;letembroiderApp=new_1.App(emberApp,options);addons=new_1.Addons(embroiderApp);addons.ready().then(result=>{outputPath=result.outputPath;});if(process.env.STAGE1_ONLY){return(0,broccoli_merge_trees_1.default)([addons.tree,(0,broccoli_file_creator_1.default)('.stage1-output',()=>outputPath)]);}if(process.env.STAGE2_ONLY||!packager){return(0,broccoli_merge_trees_1.default)([embroiderApp.asStage(addons).tree,(0,broccoli_file_creator_1.default)('.stage2-output',()=>outputPath)]);}letBroccoliPackager=(0,core_1.toBroccoliPlugin)(packager);letvariants=(options&&options.variants)||defaultVariants(emberApp);returnnewBroccoliPackager(embroiderApp.asStage(addons),variants,options&&options.packagerOptions);}
Looks like a new API was introduced to locate the embroider dir via this commit, locateEmbroiderWorkingDir, which when using, seems to do the trick for me.
This is a very recent addition, so there would likely need to use something like ember-cli-version-checker to decide on the method of resolving that embroider dir. @kategengler (or other maintainers) I may just be missing something entirely, but if you feel like that's a logical plan of action I can put up a PR for it
Activity
[-]Coverage not collected Embroider >2[/-][+]Coverage not collected in Embroider >2[/+]chrismllr commentedon Aug 8, 2023
Attempted to point to this version of the repo with no luck:
#382 (comment)
chrismllr commentedon Aug 8, 2023
Still digging, but It looks like the this package uses
stableWorkspaceDirto pass istanbul the correct directory (the one embroider will build into):But in later versions of embroider, i'm unsure what is used to determine that build dir:
embroider/compat v1.8.3 (older version)
embroider/compat v3.2.1 (recent version)
chrismllr commentedon Aug 9, 2023
Looks like a new API was introduced to locate the embroider dir via this commit,
locateEmbroiderWorkingDir, which when using, seems to do the trick for me.embroider-build/embroider@9e078f0
This is a very recent addition, so there would likely need to use something like ember-cli-version-checker to decide on the method of resolving that embroider dir. @kategengler (or other maintainers) I may just be missing something entirely, but if you feel like that's a logical plan of action I can put up a PR for it
kategengler commentedon Aug 9, 2023
cc @mansona since I believe at one point was going to look at compatibility and may know the answer
[-]Coverage not collected in Embroider >2[/-][+]Coverage not collected in Embroider >3.15[/+][-]Coverage not collected in Embroider >3.15[/-][+]Coverage not collected in Embroider >3.1[/+]chrismllr commentedon Aug 9, 2023
Took a stab at it, to give an example of what's working for me 👉 #387
chrismllr commentedon Jan 4, 2024
Closed via 2.0.3 🎉