diff --git a/crates/core/tests/integration.rs b/crates/core/tests/integration.rs index 5c12536a..6c768d7a 100644 --- a/crates/core/tests/integration.rs +++ b/crates/core/tests/integration.rs @@ -16,7 +16,7 @@ use std::{ sync::Arc, }; // uncomment for logging output -// use simplelog::{Config, SimpleLogger}; +use simplelog::{Config, SimpleLogger}; use tar::Archive; use tempfile::tempdir; @@ -57,9 +57,9 @@ fn tar_gz_testdata() -> Result { } #[fixture] -fn dir_testdata() -> Result { +fn dir_testdata() -> TestSource { let path = Path::new("tests/fixtures/backup-data/"); - Ok(TestSource::new(path)) + TestSource::new(path) } // Parts of the snapshot summary we want to test against references @@ -94,10 +94,10 @@ impl<'a> std::fmt::Debug for TestSummary<'a> { } #[rstest] -fn test_backup_with_dir_passes(dir_testdata: Result) -> Result<()> { +fn test_backup_with_dir_passes(dir_testdata: TestSource) -> Result<()> { // uncomment for logging output - // SimpleLogger::init(log::LevelFilter::Debug, Config::default())?; - let source = dir_testdata?; + SimpleLogger::init(log::LevelFilter::Debug, Config::default())?; + let source = dir_testdata; let paths = &source.path_list(); let repo = set_up_repo()?.to_indexed_ids()?; diff --git a/crates/core/tests/snapshots/integration__backup_dry_run_with_tar_gz_passes-2.snap.new b/crates/core/tests/snapshots/integration__backup_dry_run_with_tar_gz_passes-2.snap.new new file mode 100644 index 00000000..9930b527 --- /dev/null +++ b/crates/core/tests/snapshots/integration__backup_dry_run_with_tar_gz_passes-2.snap.new @@ -0,0 +1,30 @@ +--- +source: crates/core/tests/integration.rs +assertion_line: 208 +expression: TestSummary(&snap_dry_run) +--- +TestSnap { + hostname: "", + paths: StringList( + [ + "test", + ], + ), + label: "", + tags: StringList( + [], + ), + files_new: 0, + files_changed: 0, + files_unmodified: 0, + total_files_processed: 0, + total_bytes_processed: 0, + dirs_new: 0, + dirs_changed: 0, + dirs_unmodified: 1, + total_dirs_processed: 1, + data_blobs: 0, + tree_blobs: 0, + data_added_files: 0, + data_added_files_packed: 0, +} diff --git a/crates/core/tests/snapshots/integration__backup_dry_run_with_tar_gz_passes.snap.new b/crates/core/tests/snapshots/integration__backup_dry_run_with_tar_gz_passes.snap.new new file mode 100644 index 00000000..d4332951 --- /dev/null +++ b/crates/core/tests/snapshots/integration__backup_dry_run_with_tar_gz_passes.snap.new @@ -0,0 +1,30 @@ +--- +source: crates/core/tests/integration.rs +assertion_line: 190 +expression: TestSummary(&snap_dry_run) +--- +TestSnap { + hostname: "", + paths: StringList( + [ + "test", + ], + ), + label: "", + tags: StringList( + [], + ), + files_new: 0, + files_changed: 0, + files_unmodified: 0, + total_files_processed: 0, + total_bytes_processed: 0, + dirs_new: 1, + dirs_changed: 0, + dirs_unmodified: 0, + total_dirs_processed: 1, + data_blobs: 0, + tree_blobs: 1, + data_added_files: 0, + data_added_files_packed: 0, +} diff --git a/crates/core/tests/snapshots/integration__backup_with_dir_passes-2.snap.new b/crates/core/tests/snapshots/integration__backup_with_dir_passes-2.snap.new new file mode 100644 index 00000000..f55d9277 --- /dev/null +++ b/crates/core/tests/snapshots/integration__backup_with_dir_passes-2.snap.new @@ -0,0 +1,30 @@ +--- +source: crates/core/tests/integration.rs +assertion_line: 122 +expression: TestSummary(&snap2) +--- +TestSnap { + hostname: "", + paths: StringList( + [ + "test", + ], + ), + label: "", + tags: StringList( + [], + ), + files_new: 0, + files_changed: 0, + files_unmodified: 73, + total_files_processed: 73, + total_bytes_processed: 1125674, + dirs_new: 0, + dirs_changed: 0, + dirs_unmodified: 5, + total_dirs_processed: 5, + data_blobs: 0, + tree_blobs: 0, + data_added_files: 0, + data_added_files_packed: 0, +} diff --git a/crates/core/tests/snapshots/integration__backup_with_dir_passes.snap b/crates/core/tests/snapshots/integration__backup_with_dir_passes.snap new file mode 100644 index 00000000..baf201e1 --- /dev/null +++ b/crates/core/tests/snapshots/integration__backup_with_dir_passes.snap @@ -0,0 +1,29 @@ +--- +source: crates/core/tests/integration.rs +expression: TestSummary(&first_backup) +--- +TestSnap { + hostname: "", + paths: StringList( + [ + "test", + ], + ), + label: "", + tags: StringList( + [], + ), + files_new: 73, + files_changed: 0, + files_unmodified: 0, + total_files_processed: 73, + total_bytes_processed: 1125674, + dirs_new: 5, + dirs_changed: 0, + dirs_unmodified: 0, + total_dirs_processed: 5, + data_blobs: 70, + tree_blobs: 5, + data_added_files: 1125653, + data_added_files_packed: 78740, +} diff --git a/crates/core/tests/snapshots/integration__backup_with_tar_gz_passes-2.snap.new b/crates/core/tests/snapshots/integration__backup_with_tar_gz_passes-2.snap.new new file mode 100644 index 00000000..ca8ebded --- /dev/null +++ b/crates/core/tests/snapshots/integration__backup_with_tar_gz_passes-2.snap.new @@ -0,0 +1,30 @@ +--- +source: crates/core/tests/integration.rs +assertion_line: 163 +expression: TestSummary(&snap2) +--- +TestSnap { + hostname: "", + paths: StringList( + [ + "test", + ], + ), + label: "", + tags: StringList( + [], + ), + files_new: 0, + files_changed: 0, + files_unmodified: 0, + total_files_processed: 0, + total_bytes_processed: 0, + dirs_new: 0, + dirs_changed: 0, + dirs_unmodified: 1, + total_dirs_processed: 1, + data_blobs: 0, + tree_blobs: 0, + data_added_files: 0, + data_added_files_packed: 0, +} diff --git a/crates/core/tests/snapshots/integration__backup_with_tar_gz_passes.snap.new b/crates/core/tests/snapshots/integration__backup_with_tar_gz_passes.snap.new new file mode 100644 index 00000000..ab836c27 --- /dev/null +++ b/crates/core/tests/snapshots/integration__backup_with_tar_gz_passes.snap.new @@ -0,0 +1,30 @@ +--- +source: crates/core/tests/integration.rs +assertion_line: 150 +expression: TestSummary(&first_backup) +--- +TestSnap { + hostname: "", + paths: StringList( + [ + "test", + ], + ), + label: "", + tags: StringList( + [], + ), + files_new: 0, + files_changed: 0, + files_unmodified: 0, + total_files_processed: 0, + total_bytes_processed: 0, + dirs_new: 1, + dirs_changed: 0, + dirs_unmodified: 0, + total_dirs_processed: 1, + data_blobs: 0, + tree_blobs: 1, + data_added_files: 0, + data_added_files_packed: 0, +}