diff --git a/filesystem/replicator_test.go b/filesystem/replicator_test.go index 16940e8ad..a46ea86d0 100644 --- a/filesystem/replicator_test.go +++ b/filesystem/replicator_test.go @@ -25,8 +25,8 @@ import ( func TestReplicateProcessFileCallBack(t *testing.T) { t.Run("test for source file does not exist, should return an error", func(t *testing.T) { - sourceFilePath := "test_data/replicator_test/non_existent_file.txt" - destinationFilePath := "test_data/replicator_test/destination.txt" + sourceFilePath := "testdata/replicator_test/non_existent_file.txt" + destinationFilePath := "testdata/replicator_test/destination.txt" err := replicateProcessFileCallBack(sourceFilePath, destinationFilePath, nil) if err == nil { t.Errorf("Expected error for non-existent source file, got nil") @@ -34,8 +34,8 @@ import ( }) t.Run("test for destination file doesn't exist, should copy the source file", func(t *testing.T) { - sourceFilePath := "test_data/replicator_test/emptyfile.txt" - destinationFilePath := "test_data/replicator_test/destination_file.txt" + sourceFilePath := "testdata/replicator_test/emptyfile.txt" + destinationFilePath := "testdata/replicator_test/destination_file.txt" err := replicateProcessFileCallBack(sourceFilePath, destinationFilePath, nil) if err != nil { @@ -46,8 +46,8 @@ import ( }) t.Run("test for destination file exists but is different, should copy the source file", func(t *testing.T) { - sourceFilePath := "test_data/replicator_test/source_file.txt" - destinationFilePath := "test_data/replicator_test/destination_file.txt" + sourceFilePath := "testdata/replicator_test/source_file.txt" + destinationFilePath := "testdata/replicator_test/destination_file.txt" sourceFile, err := os.Create(sourceFilePath) if err != nil { @@ -99,8 +99,8 @@ import ( }) t.Run("test for destination file exists and is the same, should return nil without copying", func(t *testing.T) { - sourceFilePath := "test_data/replicator_test/source_same.txt" - destinationFilePath := "test_data/replicator_test/destination_same.txt" + sourceFilePath := "testdata/replicator_test/source_same.txt" + destinationFilePath := "testdata/replicator_test/destination_same.txt" // Store the destination file's modification time before calling replicateProcessFileCallBack info, err := os.Stat(destinationFilePath) diff --git a/filesystem/templatecopy_test.go b/filesystem/templatecopy_test.go index 982a77cba..2b611ce2f 100644 --- a/filesystem/templatecopy_test.go +++ b/filesystem/templatecopy_test.go @@ -36,7 +36,7 @@ func TestTemplateCopy(t *testing.T) { testfilledFile := "test_filled.yaml" testDataFile := "test.yaml" templateDir := "template" - testDir := "test_data" + testDir := "testdata" sourceFilePath := filepath.Join(testDir, templateDir, testDataFile) src, err := os.ReadFile(sourceFilePath) if err != nil { @@ -84,7 +84,7 @@ func TestTemplateCopy(t *testing.T) { addOnConfig := AddOnConfig{Config: TestTPLValues{TplVariable: "world"}} testDataFile := "test.yaml" sourceTestDir := "template" - testDataDir := "test_data" + testDataDir := "testdata" sourceFilePath := filepath.Join(testDataDir, sourceTestDir, testDataFile) destTempDir, err := ioutil.TempDir("", "destTempDir") if err != nil { @@ -105,7 +105,7 @@ func TestTemplateCopy(t *testing.T) { addOnConfig := AddOnConfig{Config: TestTPLValues{TplVariable: "World"}} testDataFile := "test.yaml" sourceTestDir := "template" - testDataDir := "test_data" + testDataDir := "testdata" sourceFilePath := filepath.Join(testDataDir, sourceTestDir, testDataFile) destTempDir, err := ioutil.TempDir("", "destTempDir") if err != nil { diff --git a/filesystem/test_data/copyfile/test.txt b/filesystem/testdata/copyfile/test.txt similarity index 100% rename from filesystem/test_data/copyfile/test.txt rename to filesystem/testdata/copyfile/test.txt diff --git a/filesystem/test_data/replicator_test/destination_same.txt b/filesystem/testdata/replicator_test/destination_same.txt similarity index 100% rename from filesystem/test_data/replicator_test/destination_same.txt rename to filesystem/testdata/replicator_test/destination_same.txt diff --git a/filesystem/test_data/replicator_test/emptyfile.txt b/filesystem/testdata/replicator_test/emptyfile.txt similarity index 100% rename from filesystem/test_data/replicator_test/emptyfile.txt rename to filesystem/testdata/replicator_test/emptyfile.txt diff --git a/filesystem/test_data/replicator_test/source_same.txt b/filesystem/testdata/replicator_test/source_same.txt similarity index 100% rename from filesystem/test_data/replicator_test/source_same.txt rename to filesystem/testdata/replicator_test/source_same.txt diff --git a/filesystem/test_data/template/test.yaml b/filesystem/testdata/template/test.yaml similarity index 100% rename from filesystem/test_data/template/test.yaml rename to filesystem/testdata/template/test.yaml diff --git a/filesystem/test_data/template/test_filled.yaml b/filesystem/testdata/template/test_filled.yaml similarity index 100% rename from filesystem/test_data/template/test_filled.yaml rename to filesystem/testdata/template/test_filled.yaml diff --git a/filesystem/utils_test.go b/filesystem/utils_test.go index 3d1cbb071..5e3c4fa62 100644 --- a/filesystem/utils_test.go +++ b/filesystem/utils_test.go @@ -35,7 +35,7 @@ func TestFileSystemUtils(t *testing.T) { t.Fatal("Error creating temp directory:", err) } defer os.RemoveAll(destTempDir) - testDataDir := "test_data" + testDataDir := "testdata" sourceTempDir := "copyfile" destFilePath := filepath.Join(destTempDir, testDataFile)