fixup, check testing in CI

This commit is contained in:
Stas Kelvich
2021-04-13 18:36:02 +03:00
committed by Stas Kelvich
parent c5f379bff3
commit f35d13183e
3 changed files with 7 additions and 4 deletions

3
.gitignore vendored
View File

@@ -1,3 +1,4 @@
/target
/tmp_check/
/tmp_check
/tmp_install
/tmp_check_cli

View File

@@ -198,9 +198,11 @@ impl PostgresNode {
// initialize data directory
if self.is_test {
fs::remove_dir_all(self.pgdata().to_str().unwrap())?;
fs::remove_dir_all(self.pgdata().to_str().unwrap()).ok();
}
fs::create_dir_all(self.pgdata().to_str().unwrap())?;
let initdb_path = self.env.pg_bin_dir().join("initdb");
let initdb = Command::new(initdb_path)
.args(&["-D", self.pgdata().to_str().unwrap()])

View File

@@ -120,7 +120,7 @@ pub fn init() -> Result<()> {
// ok, we are good to go
// create dirs
let data_dir = cargo_path.join("tmp_check");
let data_dir = cargo_path.join("tmp_check_cli");
for &dir in &["compute", "pageserver"] {
fs::create_dir_all(data_dir.join(dir))
@@ -168,7 +168,7 @@ pub fn load_config() -> Result<LocalEnv> {
// local env for tests
pub fn test_env() -> LocalEnv {
let data_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("tmp_check");
let data_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("../tmp_check");
fs::create_dir_all(data_dir.clone()).unwrap();
LocalEnv {
data_dir,