mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
mark cafile tests as flaky (#11649)
This commit is contained in:
parent
15a763152f
commit
cd323612fd
3 changed files with 38 additions and 10 deletions
12
Cargo.lock
generated
12
Cargo.lock
generated
|
@ -596,6 +596,7 @@ dependencies = [
|
||||||
"exec",
|
"exec",
|
||||||
"fancy-regex",
|
"fancy-regex",
|
||||||
"filetime",
|
"filetime",
|
||||||
|
"flaky_test",
|
||||||
"fwdansi",
|
"fwdansi",
|
||||||
"http",
|
"http",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
|
@ -1257,6 +1258,17 @@ version = "0.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
|
checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "flaky_test"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "479cde5eb168cf5a056dd98f311cbfab7494c216394e4fb9eba0336827a8db93"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2 1.0.27",
|
||||||
|
"quote 1.0.9",
|
||||||
|
"syn 1.0.65",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flate2"
|
name = "flate2"
|
||||||
version = "1.0.20"
|
version = "1.0.20"
|
||||||
|
|
|
@ -101,6 +101,7 @@ winapi = { version = "0.3.9", features = ["knownfolders", "mswsock", "objbase",
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
# Used in benchmark
|
# Used in benchmark
|
||||||
chrono = "0.4.19"
|
chrono = "0.4.19"
|
||||||
|
flaky_test = "0.1.0"
|
||||||
os_pipe = "0.9.2"
|
os_pipe = "0.9.2"
|
||||||
test_util = { path = "../test_util" }
|
test_util = { path = "../test_util" }
|
||||||
tower-test = "0.4.0"
|
tower-test = "0.4.0"
|
||||||
|
|
|
@ -30,6 +30,21 @@ macro_rules! itest(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! itest_flaky(
|
||||||
|
($name:ident {$( $key:ident: $value:expr,)*}) => {
|
||||||
|
#[flaky_test::flaky_test]
|
||||||
|
fn $name() {
|
||||||
|
(test_util::CheckOutputIntegrationTest {
|
||||||
|
$(
|
||||||
|
$key: $value,
|
||||||
|
)*
|
||||||
|
.. Default::default()
|
||||||
|
}).run()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// These files have `_tests.rs` suffix to make it easier to tell which file is
|
// These files have `_tests.rs` suffix to make it easier to tell which file is
|
||||||
// the test (ex. `lint_tests.rs`) and which is the implementation (ex. `lint.rs`)
|
// the test (ex. `lint_tests.rs`) and which is the implementation (ex. `lint.rs`)
|
||||||
// when both are open, especially for two tabs in VS Code
|
// when both are open, especially for two tabs in VS Code
|
||||||
|
@ -445,39 +460,39 @@ fn broken_stdout() {
|
||||||
assert!(!stderr.contains("panic"));
|
assert!(!stderr.contains("panic"));
|
||||||
}
|
}
|
||||||
|
|
||||||
itest!(cafile_url_imports {
|
itest_flaky!(cafile_url_imports {
|
||||||
args: "run --quiet --reload --cert tls/RootCA.pem cafile_url_imports.ts",
|
args: "run --quiet --reload --cert tls/RootCA.pem cafile_url_imports.ts",
|
||||||
output: "cafile_url_imports.ts.out",
|
output: "cafile_url_imports.ts.out",
|
||||||
http_server: true,
|
http_server: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(cafile_ts_fetch {
|
itest_flaky!(cafile_ts_fetch {
|
||||||
args:
|
args:
|
||||||
"run --quiet --reload --allow-net --cert tls/RootCA.pem cafile_ts_fetch.ts",
|
"run --quiet --reload --allow-net --cert tls/RootCA.pem cafile_ts_fetch.ts",
|
||||||
output: "cafile_ts_fetch.ts.out",
|
output: "cafile_ts_fetch.ts.out",
|
||||||
http_server: true,
|
http_server: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(cafile_eval {
|
itest_flaky!(cafile_eval {
|
||||||
args: "eval --cert tls/RootCA.pem fetch('https://localhost:5545/cafile_ts_fetch.ts.out').then(r=>r.text()).then(t=>console.log(t.trimEnd()))",
|
args: "eval --cert tls/RootCA.pem fetch('https://localhost:5545/cafile_ts_fetch.ts.out').then(r=>r.text()).then(t=>console.log(t.trimEnd()))",
|
||||||
output: "cafile_ts_fetch.ts.out",
|
output: "cafile_ts_fetch.ts.out",
|
||||||
http_server: true,
|
http_server: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(cafile_info {
|
itest_flaky!(cafile_info {
|
||||||
args:
|
args:
|
||||||
"info --quiet --cert tls/RootCA.pem https://localhost:5545/cafile_info.ts",
|
"info --quiet --cert tls/RootCA.pem https://localhost:5545/cafile_info.ts",
|
||||||
output: "cafile_info.ts.out",
|
output: "cafile_info.ts.out",
|
||||||
http_server: true,
|
http_server: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(cafile_url_imports_unsafe_ssl {
|
itest_flaky!(cafile_url_imports_unsafe_ssl {
|
||||||
args: "run --quiet --reload --unsafely-ignore-certificate-errors=localhost cafile_url_imports.ts",
|
args: "run --quiet --reload --unsafely-ignore-certificate-errors=localhost cafile_url_imports.ts",
|
||||||
output: "cafile_url_imports_unsafe_ssl.ts.out",
|
output: "cafile_url_imports_unsafe_ssl.ts.out",
|
||||||
http_server: true,
|
http_server: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(cafile_ts_fetch_unsafe_ssl {
|
itest_flaky!(cafile_ts_fetch_unsafe_ssl {
|
||||||
args:
|
args:
|
||||||
"run --quiet --reload --allow-net --unsafely-ignore-certificate-errors cafile_ts_fetch.ts",
|
"run --quiet --reload --allow-net --unsafely-ignore-certificate-errors cafile_ts_fetch.ts",
|
||||||
output: "cafile_ts_fetch_unsafe_ssl.ts.out",
|
output: "cafile_ts_fetch_unsafe_ssl.ts.out",
|
||||||
|
@ -498,7 +513,7 @@ itest!(localhost_unsafe_ssl {
|
||||||
exit_code: 1,
|
exit_code: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
#[test]
|
#[flaky_test::flaky_test]
|
||||||
fn cafile_env_fetch() {
|
fn cafile_env_fetch() {
|
||||||
use deno_core::url::Url;
|
use deno_core::url::Url;
|
||||||
let _g = util::http_server();
|
let _g = util::http_server();
|
||||||
|
@ -517,7 +532,7 @@ fn cafile_env_fetch() {
|
||||||
assert!(output.status.success());
|
assert!(output.status.success());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[flaky_test::flaky_test]
|
||||||
fn cafile_fetch() {
|
fn cafile_fetch() {
|
||||||
use deno_core::url::Url;
|
use deno_core::url::Url;
|
||||||
let _g = util::http_server();
|
let _g = util::http_server();
|
||||||
|
@ -539,7 +554,7 @@ fn cafile_fetch() {
|
||||||
assert_eq!(out, "");
|
assert_eq!(out, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[flaky_test::flaky_test]
|
||||||
fn cafile_install_remote_module() {
|
fn cafile_install_remote_module() {
|
||||||
let _g = util::http_server();
|
let _g = util::http_server();
|
||||||
let temp_dir = TempDir::new().expect("tempdir fail");
|
let temp_dir = TempDir::new().expect("tempdir fail");
|
||||||
|
@ -581,7 +596,7 @@ fn cafile_install_remote_module() {
|
||||||
assert!(stdout.ends_with("foo"));
|
assert!(stdout.ends_with("foo"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[flaky_test::flaky_test]
|
||||||
fn cafile_bundle_remote_exports() {
|
fn cafile_bundle_remote_exports() {
|
||||||
let _g = util::http_server();
|
let _g = util::http_server();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue