Skip to content

Commit

Permalink
Fix tests for the new cli that puts hash in migration filename (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
aljazerzen authored Apr 10, 2024
1 parent 53bdf61 commit 116d8aa
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions edgedb-tokio/tests/func/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ impl ServerGuard {
cmd.uid(1);
}

let process = cmd.spawn().unwrap_or_else(|_| panic!("Can run {}", bin_name));
let process = cmd
.spawn()
.unwrap_or_else(|_| panic!("Can run {}", bin_name));
let pipe = BufReader::new(unsafe { File::from_raw_fd(pipe_read) });
let mut result = Err(anyhow::anyhow!("no server info emitted"));
for line in pipe.lines() {
Expand Down Expand Up @@ -86,7 +88,14 @@ impl ServerGuard {
sinfo.push(ShutdownInfo { process });
let info = result.unwrap();

fs::remove_file("tests/func/dbschema/migrations/00001.edgeql").ok();
// delete all migration files generated in previous runs
if let Ok(read_dir) = fs::read_dir("tests/func/dbschema/migrations/") {
for entry in read_dir {
let dir_entry = entry.unwrap();
fs::remove_file(dir_entry.path()).ok();
}
}

assert!(Command::new("edgedb")
.current_dir("./tests/func")
.arg("--tls-security")
Expand Down

0 comments on commit 116d8aa

Please sign in to comment.