From fc003040387ebcd79c986ced9b0c475d3db81320 Mon Sep 17 00:00:00 2001 From: Till Wegmueller Date: Thu, 31 Jul 2025 00:29:53 +0200 Subject: [PATCH] Remove redundant file checks and update test assertions for publisher-specific file paths - Eliminate obsolete assertions for the root `file` directory as it is no longer created. - Update tests to validate file paths in `publisher`-specific directories, aligning with the updated repository structure. - Simplify `create_directories` by removing unnecessary `file` directory creation. --- libips/src/repository/file_backend.rs | 1 - libips/src/repository/tests.rs | 5 ++--- pkg6repo/src/e2e_tests.rs | 2 -- pkg6repo/src/tests.rs | 1 - 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/libips/src/repository/file_backend.rs b/libips/src/repository/file_backend.rs index 365388e..062062d 100644 --- a/libips/src/repository/file_backend.rs +++ b/libips/src/repository/file_backend.rs @@ -1737,7 +1737,6 @@ impl FileBackend { fn create_directories(&self) -> Result<()> { // Create the main repository directories fs::create_dir_all(self.path.join("publisher"))?; - fs::create_dir_all(self.path.join("file"))?; fs::create_dir_all(self.path.join("index"))?; fs::create_dir_all(self.path.join("trans"))?; fs::create_dir_all(self.path.join("obsoleted"))?; diff --git a/libips/src/repository/tests.rs b/libips/src/repository/tests.rs index 2471bb5..bd847fa 100644 --- a/libips/src/repository/tests.rs +++ b/libips/src/repository/tests.rs @@ -182,7 +182,6 @@ mod tests { // Check that the repository was created assert!(repo_path.exists()); assert!(repo_path.join("publisher").exists()); - assert!(repo_path.join("file").exists()); assert!(repo_path.join("index").exists()); assert!(repo_path.join("trans").exists()); assert!(repo_path.join(REPOSITORY_CONFIG_FILENAME).exists()); @@ -270,8 +269,8 @@ mod tests { let manifest_path = manifest_dir.join("example.p5m"); publish_package(&mut repo, &manifest_path, &prototype_dir, "test").unwrap(); - // Check that the files were published - assert!(repo_path.join("file").exists()); + // Check that the files were published in the publisher-specific directory + assert!(repo_path.join("publisher").join("test").join("file").exists()); // Get repository information let repo_info = repo.get_info().unwrap(); diff --git a/pkg6repo/src/e2e_tests.rs b/pkg6repo/src/e2e_tests.rs index fc95b63..30c6df0 100644 --- a/pkg6repo/src/e2e_tests.rs +++ b/pkg6repo/src/e2e_tests.rs @@ -136,9 +136,7 @@ mod e2e_tests { // Check that the repository was created assert!(repo_path.exists()); assert!(repo_path.join("publisher").exists()); - assert!(repo_path.join("file").exists()); assert!(repo_path.join("index").exists()); - assert!(repo_path.join("pkg").exists()); assert!(repo_path.join("trans").exists()); assert!(repo_path.join("pkg6.repository").exists()); diff --git a/pkg6repo/src/tests.rs b/pkg6repo/src/tests.rs index 31a008e..8c2d3aa 100644 --- a/pkg6repo/src/tests.rs +++ b/pkg6repo/src/tests.rs @@ -48,7 +48,6 @@ mod tests { // Check that the repository was created assert!(repo_path.exists()); assert!(repo_path.join("publisher").exists()); - assert!(repo_path.join("file").exists()); assert!(repo_path.join("index").exists()); assert!(repo_path.join("trans").exists()); assert!(repo_path.join(REPOSITORY_CONFIG_FILENAME).exists());