Skip to content

build: minor improvements to testing script #18363

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
Feb 4, 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
6 changes: 4 additions & 2 deletions scripts/run-component-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ shelljs.exec(`yarn -s ${bazelBinary} ${bazelAction} ${testLabels.join(' ')}`);
function getBazelPackageOfComponentName(name) {
// Before guessing any Bazel package, we test if the name contains the
// package name already. If so, we just use that for Bazel package.
const targetName = convertPathToBazelLabel(name);
const targetName = convertPathToBazelLabel(name) ||
convertPathToBazelLabel(path.join(packagesDir, name));
if (targetName !== null) {
return targetName;
}
Expand All @@ -89,8 +90,9 @@ function getBazelPackageOfComponentName(name) {
return guessTargetName;
}
}
throw Error(chalk.red(`Could not find test target for specified component: ` +
console.error(chalk.red(`Could not find test target for specified component: ` +
`${chalk.yellow(name)}. Looked in packages: ${orderedGuessPackages.join(', ')}`));
process.exit(1);
}

/** Converts a path to a Bazel label. */
Expand Down