Skip to content
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

Improve error messages when running rustdoc GUI tests #100403

Merged
merged 2 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,11 @@ fn compare_browser_ui_test_version(installed_version: &str, src: &Path) {
one used in the CI (`{}`)",
installed_version, v
);
eprintln!(
"You can install this version using `npm update browser-ui-test` or by using \
`npm install browser-ui-test@{}`",
v,
);
}
}
Err(e) => eprintln!("Couldn't find the CI browser-ui-test version: {:?}", e),
Expand Down
16 changes: 16 additions & 0 deletions src/tools/rustdoc-gui/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,19 @@ async function main(argv) {
process.setMaxListeners(opts["jobs"] + 1);
}

// We catch this "event" to display a nicer message in case of unexpected exit (because of a
// missing `--no-sandbox`).
const exitHandling = (code) => {
if (!opts["no_sandbox"]) {
console.log("");
console.log(
"`browser-ui-test` crashed unexpectedly. Please try again with adding `--test-args \
--no-sandbox` at the end. For example: `x.py test src/test/rustdoc-gui --test-args --no-sandbox`");
console.log("");
}
};
process.on('exit', exitHandling);

const tests_queue = [];
let results = {
successful: [],
Expand Down Expand Up @@ -247,6 +260,9 @@ async function main(argv) {
}
status_bar.finish();

// We don't need this listener anymore.
process.removeListener("exit", exitHandling);

if (debug) {
results.successful.sort(by_filename);
results.successful.forEach(r => {
Expand Down