Skip to content

Commit d4309d1

Browse files
author
Florian
committed
TestCopyToContainerTestable works now. There were misunderstandings about the tested function.
1 parent 847a6ce commit d4309d1

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

pkg/devspace/sync/util_test.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ func TestCopyToContainerTestable(t *testing.T) {
1717
}
1818

1919
remote, local := initTestDirs(t)
20-
defer os.RemoveAll(remote)
21-
defer os.RemoveAll(local)
22-
containerPath := "/testDir"
23-
24-
syncClient := createTestSyncClient(local, remote)
25-
26-
syncClient.errorChan = make(chan error)
2720

2821
excludePaths := []string{}
2922

@@ -45,7 +38,7 @@ func TestCopyToContainerTestable(t *testing.T) {
4538

4639
ioutil.WriteFile(path.Join(local, "ignoredFolder", "testFile1"), []byte(fileContents), 0666)
4740

48-
err := copyToContainerTestable(syncClient.Kubectl, syncClient.Pod, syncClient.Container, local, containerPath, excludePaths, true)
41+
err := copyToContainerTestable(nil, nil, nil, local, remote, excludePaths, true)
4942
if err != nil {
5043
t.Error(err)
5144
return
@@ -108,14 +101,6 @@ func TestCopyToContainerTestable(t *testing.T) {
108101

109102
checkFilesAndFolders(t, filesToCheck, foldersToCheck, local, remote, 10*time.Second)
110103

111-
// Check if there is an error in the error channel
112-
select {
113-
case err = <-syncClient.errorChan:
114-
t.Error(err)
115-
return
116-
default:
117-
}
118-
119104
}
120105

121106
type checkedFileOrFolder struct {

0 commit comments

Comments
 (0)