Enable --no-sandbox
option by default for rustdoc GUI tests
This commit is contained in:
parent
9e3e517446
commit
32099dbc1e
@ -100,4 +100,4 @@ RUN /scripts/build-gccjit.sh /scripts
|
||||
# the local version of the package is different than the one used by the CI.
|
||||
ENV SCRIPT /tmp/checktools.sh ../x.py && \
|
||||
npm install browser-ui-test@$(head -n 1 /tmp/browser-ui-test.version) --unsafe-perm=true && \
|
||||
python3 ../x.py test tests/rustdoc-gui --stage 2 --test-args "'--no-sandbox --jobs 1'"
|
||||
python3 ../x.py test tests/rustdoc-gui --stage 2 --test-args "'--jobs 1'"
|
||||
|
@ -19,7 +19,6 @@ function showHelp() {
|
||||
console.log(" --debug : show extra information about script run");
|
||||
console.log(" --show-text : render font in pages");
|
||||
console.log(" --no-headless : disable headless mode");
|
||||
console.log(" --no-sandbox : disable sandbox mode");
|
||||
console.log(" --help : show this message then quit");
|
||||
console.log(" --tests-folder [PATH] : location of the .GOML tests folder");
|
||||
console.log(" --jobs [NUMBER] : number of threads to run tests on");
|
||||
@ -40,7 +39,6 @@ function parseOptions(args) {
|
||||
"no_headless": false,
|
||||
"jobs": -1,
|
||||
"executable_path": null,
|
||||
"no_sandbox": false,
|
||||
};
|
||||
const correspondences = {
|
||||
"--doc-folder": "doc_folder",
|
||||
@ -49,7 +47,6 @@ function parseOptions(args) {
|
||||
"--show-text": "show_text",
|
||||
"--no-headless": "no_headless",
|
||||
"--executable-path": "executable_path",
|
||||
"--no-sandbox": "no_sandbox",
|
||||
};
|
||||
|
||||
for (let i = 0; i < args.length; ++i) {
|
||||
@ -80,9 +77,6 @@ function parseOptions(args) {
|
||||
} else if (arg === "--help") {
|
||||
showHelp();
|
||||
process.exit(0);
|
||||
} else if (arg === "--no-sandbox") {
|
||||
console.log("`--no-sandbox` is being used. Be very careful!");
|
||||
opts[correspondences[arg]] = true;
|
||||
} else if (correspondences[arg]) {
|
||||
opts[correspondences[arg]] = true;
|
||||
} else {
|
||||
@ -203,6 +197,7 @@ async function main(argv) {
|
||||
const args = [
|
||||
"--variable", "DOC_PATH", opts["doc_folder"].split("\\").join("/"),
|
||||
"--enable-fail-on-js-error", "--allow-file-access-from-files",
|
||||
"--no-sandbox",
|
||||
];
|
||||
if (opts["debug"]) {
|
||||
debug = true;
|
||||
@ -211,9 +206,6 @@ async function main(argv) {
|
||||
if (opts["show_text"]) {
|
||||
args.push("--show-text");
|
||||
}
|
||||
if (opts["no_sandbox"]) {
|
||||
args.push("--no-sandbox");
|
||||
}
|
||||
if (opts["no_headless"]) {
|
||||
args.push("--no-headless");
|
||||
headless = false;
|
||||
@ -262,19 +254,6 @@ async function main(argv) {
|
||||
console.log(`Running ${files.length} rustdoc-gui ...`);
|
||||
}
|
||||
|
||||
// We catch this "event" to display a nicer message in case of unexpected exit (because of a
|
||||
// missing `--no-sandbox`).
|
||||
const exitHandling = () => {
|
||||
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 tests/rustdoc-gui --test-args --no-sandbox`");
|
||||
console.log("");
|
||||
}
|
||||
};
|
||||
process.on("exit", exitHandling);
|
||||
|
||||
const originalFilesLen = files.length;
|
||||
const results = createEmptyResults();
|
||||
const status_bar = char_printer(files.length);
|
||||
@ -299,9 +278,6 @@ async function main(argv) {
|
||||
Array.prototype.push.apply(results.failed, new_results.failed);
|
||||
Array.prototype.push.apply(results.errored, new_results.errored);
|
||||
|
||||
// We don't need this listener anymore.
|
||||
process.removeListener("exit", exitHandling);
|
||||
|
||||
if (debug) {
|
||||
results.successful.sort(by_filename);
|
||||
results.successful.forEach(r => {
|
||||
|
@ -23,12 +23,5 @@ $ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-headless
|
||||
|
||||
To see the supported options, use `--help`.
|
||||
|
||||
Important to be noted: if the chromium instance crashes when you run it, you might need to
|
||||
use `--no-sandbox` to make it work:
|
||||
|
||||
```bash
|
||||
$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-sandbox
|
||||
```
|
||||
|
||||
[browser-ui-test]: https://github.com/GuillaumeGomez/browser-UI-test/
|
||||
[puppeteer]: https://pptr.dev/
|
||||
|
Loading…
Reference in New Issue
Block a user