From d6bbbdda7580d74d78fecae6c99b850bc90414c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 14 Mar 2020 11:53:20 +0100 Subject: Update CLI for unit_test_runner.ts (#4352) * drop server guard before unit test result check To prevent cascading test failures when js_unit_test http server guard is dropped before asserting that tests were successful. This is really a band-aid and doesn't solve underlying issue with http server. * Update CLI for unit_test_runner.ts * Change cli/js/tests/unit_test_runner.ts command line interface to work in 3 modes: - "one-off" - run tests that match permissions of currently running process - "master" - run tests for all possible permission combinations, by spawning subprocesses running in "worker" mode and communicating via TCP socket; requires elevated permissions - "worker" - run tests for set of permissions provided by CLI arg; requires elevated permissions to setup TCP connection to "master"; after initial setup process drops permissions to given set * Support filtering of tests by string passed after "--" CLI arg * Update cli/js/tests/README.md --- cli/tests/integration_tests.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cli/tests') diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index f90e434da..0e6137782 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -274,12 +274,13 @@ fn js_unit_tests() { .arg("--reload") .arg("-A") .arg("cli/js/tests/unit_test_runner.ts") + .arg("--master") .spawn() .expect("failed to spawn script"); let status = deno.wait().expect("failed to wait for the child process"); + drop(g); assert_eq!(Some(0), status.code()); assert!(status.success()); - drop(g); } #[test] -- cgit v1.2.3