diff options
author | Luca Casonato <hello@lcas.dev> | 2024-09-27 16:07:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-27 14:07:20 +0000 |
commit | 3134abefa462ead8bb8e2e4aa8a5b57910f3d430 (patch) | |
tree | 0f01cca8ca91ea6fb06347f17a77091259749c28 /tests/integration | |
parent | 88a4f8dd97704b8905d05def949b137a75286b18 (diff) |
BREAKING(ext/net): improved error code accuracy (#25383)
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/js_unit_tests.rs | 15 | ||||
-rw-r--r-- | tests/integration/node_unit_tests.rs | 11 |
2 files changed, 20 insertions, 6 deletions
diff --git a/tests/integration/js_unit_tests.rs b/tests/integration/js_unit_tests.rs index 5efb0f268..577ca043c 100644 --- a/tests/integration/js_unit_tests.rs +++ b/tests/integration/js_unit_tests.rs @@ -143,8 +143,19 @@ fn js_unit_test(test: String) { deno = deno.arg("--unstable-worker-options"); } - // TODO(mmastrac): it would be better to just load a test CA for all tests - if test == "websocket_test" || test == "tls_sni_test" { + // Some tests require the root CA cert file to be loaded. + if test == "websocket_test" { + deno = deno.arg(format!( + "--cert={}", + util::testdata_path() + .join("tls") + .join("RootCA.pem") + .to_string_lossy() + )); + }; + + if test == "tls_sni_test" { + // TODO(lucacasonato): fix the SNI in the certs so that this is not needed deno = deno.arg("--unsafely-ignore-certificate-errors"); } diff --git a/tests/integration/node_unit_tests.rs b/tests/integration/node_unit_tests.rs index c8b5b25fb..d66db5a40 100644 --- a/tests/integration/node_unit_tests.rs +++ b/tests/integration/node_unit_tests.rs @@ -113,15 +113,18 @@ fn node_unit_test(test: String) { .arg("--no-lock") .arg("--unstable-broadcast-channel") .arg("--unstable-net") - // TODO(kt3k): This option is required to pass tls_test.ts, - // but this shouldn't be necessary. tls.connect currently doesn't - // pass hostname option correctly and it causes cert errors. - .arg("--unsafely-ignore-certificate-errors") .arg("-A"); + + // Some tests require the root CA cert file to be loaded. + if test == "http2_test" || test == "http_test" { + deno = deno.arg("--cert=./tests/testdata/tls/RootCA.pem"); + } + // Parallel tests for crypto if test.starts_with("crypto/") { deno = deno.arg("--parallel"); } + let mut deno = deno .arg( util::tests_path() |