Skip to content

Commit

Permalink
Comment out clean_command_ok test
Browse files Browse the repository at this point in the history
Reviewed By: diliop

Differential Revision: D64018129

fbshipit-source-id: 4e8879b05ed3d0d697c1b9b895f68bc710734775
  • Loading branch information
zertosh authored and facebook-github-bot committed Oct 8, 2024
1 parent dc4742b commit 3ade54d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
1 change: 1 addition & 0 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ impl DotSlashTestEnv {
Ok(self)
}

#[allow(dead_code)]
pub fn dotslash_cache(&self) -> &Path {
&self.tempdir_path
}
Expand Down
67 changes: 33 additions & 34 deletions tests/dotslash_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,40 +636,39 @@ caused by: expected no arguments but received some
// "clean" Command
//

/// TODO: The "clean" command currently has a bug where it will fail if any of
/// the entries in the cache are read-only. Re-enable this test once that has
/// been fixed.
#[ignore]
#[test]
fn clean_command_ok() {
let test_env = DotSlashTestEnv::try_new().unwrap();

let cache_dir = test_env.dotslash_cache();

// Cache dir exists, but should be empty.
assert!(cache_dir.exists());
let is_empty = std::fs::read_dir(cache_dir).unwrap().next().is_none();
assert!(is_empty);

test_env
.dotslash_command()
.arg("tests/fixtures/http__tar_gz__print_argv")
.assert()
.success();

assert!(cache_dir.exists());

test_env
.dotslash_command()
.arg("--")
.arg("clean")
.assert()
.code(0)
.stdout_eq("")
.stderr_matches("Cleaning `[DOTSLASHCACHEDIR]`\n");

assert!(!cache_dir.exists());
}
// TODO: The "clean" command currently has a bug where it will fail if any of
// the entries in the cache are read-only. Re-enable this test once that has
// been fixed.
// #[test]
// fn clean_command_ok() {
// let test_env = DotSlashTestEnv::try_new().unwrap();

// let cache_dir = test_env.dotslash_cache();

// // Cache dir exists, but should be empty.
// assert!(cache_dir.exists());
// let is_empty = std::fs::read_dir(cache_dir).unwrap().next().is_none();
// assert!(is_empty);

// test_env
// .dotslash_command()
// .arg("tests/fixtures/http__tar_gz__print_argv")
// .assert()
// .success();

// assert!(cache_dir.exists());

// test_env
// .dotslash_command()
// .arg("--")
// .arg("clean")
// .assert()
// .code(0)
// .stdout_eq("")
// .stderr_matches("Cleaning `[DOTSLASHCACHEDIR]`\n");

// assert!(!cache_dir.exists());
// }

#[test]
fn clean_command_extra_args() {
Expand Down

0 comments on commit 3ade54d

Please sign in to comment.