You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "sarutak (via GitHub)" <gi...@apache.org> on 2023/08/08 20:20:57 UTC
[GitHub] [incubator-opendal] sarutak opened a new issue, #2822: Cleanup temporary files generated by tests
sarutak opened a new issue, #2822:
URL: https://github.com/apache/incubator-opendal/issues/2822
Some tests generate temporary files but they are not cleaned.
One example is `bin/oli/tests/cp.rs`.
```
async fn test_basic_cp() -> Result<()> {
let dir = env::temp_dir();
fs::create_dir_all(dir.clone())?;
let src_path = Path::new(&dir).join("src.txt");
let dst_path = Path::new(&dir).join("dst.txt");
let expect = "hello";
fs::write(&src_path, expect)?;
let mut cmd = Command::cargo_bin("oli")?;
cmd.arg("cp")
.arg(src_path.as_os_str())
.arg(dst_path.as_os_str());
cmd.assert().success();
let actual = fs::read_to_string(&dst_path)?;
assert_eq!(expect, actual);
Ok(())
}
```
If we run this test on Linux, `src.txt` and `dst.txt` are crated in `/tmp` but they are not automatically deleted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] Xuanwo closed issue #2822: Cleanup temporary files generated by tests
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo closed issue #2822: Cleanup temporary files generated by tests
URL: https://github.com/apache/incubator-opendal/issues/2822
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-opendal] Xuanwo commented on issue #2822: Cleanup temporary files generated by tests
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #2822:
URL: https://github.com/apache/incubator-opendal/issues/2822#issuecomment-1670590929
Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org