diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2021-05-21 22:57:00 +0900 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2021-05-31 16:37:32 +0200 |
commit | 195808a53879d73a4d79d0e2252783de64acea48 (patch) | |
tree | 267d91d95825ca8ca59843d95ce7ffe738e44550 | |
parent | 7b1fd3d146292df01f61e9eb0202779be8d7da33 (diff) |
fix(test): ensure coverage dir exists (#10717)
-rw-r--r-- | cli/main.rs | 1 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/cli/main.rs b/cli/main.rs index 3b147ffcc..aa144d1de 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -925,6 +925,7 @@ async fn test_command( concurrent_jobs: usize, ) -> Result<(), AnyError> { if let Some(ref coverage_dir) = flags.coverage_dir { + std::fs::create_dir_all(&coverage_dir)?; env::set_var( "DENO_UNSTABLE_COVERAGE_DIR", PathBuf::from(coverage_dir).canonicalize()?, diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index aff073d0d..d3e578476 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -4425,12 +4425,13 @@ console.log("finish"); #[test] fn branch() { let tempdir = TempDir::new().expect("tempdir fail"); + let tempdir = tempdir.path().join("cov"); let status = util::deno_cmd() .current_dir(util::root_path()) .arg("test") .arg("--quiet") .arg("--unstable") - .arg(format!("--coverage={}", tempdir.path().to_str().unwrap())) + .arg(format!("--coverage={}", tempdir.to_str().unwrap())) .arg("cli/tests/coverage/branch_test.ts") .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::inherit()) @@ -4444,7 +4445,7 @@ console.log("finish"); .arg("coverage") .arg("--quiet") .arg("--unstable") - .arg(format!("{}/", tempdir.path().to_str().unwrap())) + .arg(format!("{}/", tempdir.to_str().unwrap())) .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::inherit()) .output() @@ -4473,7 +4474,7 @@ console.log("finish"); .arg("--quiet") .arg("--unstable") .arg("--lcov") - .arg(format!("{}/", tempdir.path().to_str().unwrap())) + .arg(format!("{}/", tempdir.to_str().unwrap())) .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::inherit()) .output() |