Skip to content

build: unable to run schematics tests through test script #19230

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

Merged
merged 1 commit into from
May 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions scripts/run-component-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ if (!components.length) {
process.exit(1);
}

const testTargetName = `unit_tests_${local ? 'local' : browserName}`;
const bazelAction = local ? 'run' : 'test';
const testLabels = components
.map(t => correctTypos(t))
.map(t => `${getBazelPackageOfComponentName(t)}:${testTargetName}`);
.map(t => `${getBazelPackageOfComponentName(t)}:${getTargetName(t)}`);

// Runs Bazel for the determined test labels.
shelljs.exec(`${bazelBinary} ${bazelAction} ${testLabels.join(' ')} ${configFlag}`);
Expand Down Expand Up @@ -143,3 +142,13 @@ function correctTypos(target) {
function convertPathToPosix(pathName) {
return pathName.replace(/\\/g, '/');
}

/** Gets the name of the target that should be run. */
function getTargetName(packageName) {
// Schematics don't have _local and browser targets.
if (packageName && packageName.endsWith('schematics')) {
return 'unit_tests';
}

return `unit_tests_${local ? 'local' : browserName}`;
}