-
Notifications
You must be signed in to change notification settings - Fork 108
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
Coverage not collected in Embroider >3.1 #386
Comments
Attempted to point to this version of the repo with no luck: |
Still digging, but It looks like the this package uses if (opts.embroider === true) {
let {
stableWorkspaceDir,
} = require('@embroider/compat/src/default-pipeline');
cwd = stableWorkspaceDir(cwd, process.env.EMBER_ENV);
} But in later versions of embroider, i'm unsure what is used to determine that build dir: embroider/compat v1.8.3 (older version) function defaultPipeline(emberApp, packager, options = {}) {
let outputPath;
let addons;
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)]);
}
let embroiderApp = 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)]);
}
let BroccoliPackager = (0, core_1.toBroccoliPlugin)(packager);
let variants = (options && options.variants) || defaultVariants(emberApp);
return new BroccoliPackager(embroiderApp, variants, options && options.packagerOptions);
} embroider/compat v3.2.1 (recent version) // Method not used; unsure how build dir set
function defaultPipeline(emberApp, packager, options = {}) {
let outputPath;
let addons;
let embroiderApp = 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)]);
}
let BroccoliPackager = (0, core_1.toBroccoliPlugin)(packager);
let variants = (options && options.variants) || defaultVariants(emberApp);
return new BroccoliPackager(embroiderApp.asStage(addons), variants, options && options.packagerOptions);
} |
Looks like a new API was introduced to locate the embroider dir via this commit, 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 |
cc @mansona since I believe at one point was going to look at compatibility and may know the answer |
Took a stab at it, to give an example of what's working for me 👉 #387 |
Closed via 2.0.3 🎉 |
Versions:
Utilizing embroider >2 (as of writing, 3.2) coverage is not generated.
From initial debugging, a couple things ive noticed:
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 fromtestMiddleware
method is registered, but the app never POSTs back (coverageHandler
is never invoked)--server
flag,sendCoverage
is invoked, butwindow.__coverage__
is emptyThe text was updated successfully, but these errors were encountered: