Skip to content

Commit

Permalink
206-doublestar-mount fixed tests, .drone-local.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bdebyl committed Aug 10, 2022
1 parent 9e955c9 commit f8ef0f9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
14 changes: 4 additions & 10 deletions .drone-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ clone:
depth: 50

steps:
# This is needed for the tags. And the tags are needed to determine version.
- name: fetch
image: docker:git
commands:
- git fetch --tags -f

- name: configure-buckets
image: minio/mc:RELEASE.2020-10-03T02-54-56Z
commands:
Expand All @@ -37,7 +31,7 @@ steps:
CGO_ENABLED: 0

- name: lint
image: golang:1.18.4
image: docker.io/golangci/golangci-lint:v1.46.2
commands:
- make lint
environment:
Expand Down Expand Up @@ -237,7 +231,7 @@ steps:

services:
- name: minio
image: minio/minio:RELEASE.2020-11-06T23-17-07Z
image: minio/minio:RELEASE.2022-07-15T03-44-22Z
commands:
- minio server /data
environment:
Expand All @@ -247,7 +241,7 @@ services:
ports:
- 9000
- name: fakegcs
image: fsouza/fake-gcs-server:1.18.3
image: fsouza/fake-gcs-server:1.38.3
ports:
- 4443
commands:
Expand All @@ -259,7 +253,7 @@ services:
commands:
- /entrypoint foo:pass:::sftp_test bar:pass:::plugin_test
- name: azurite
image: mcr.microsoft.com/azure-storage/azurite:3.10.0
image: mcr.microsoft.com/azure-storage/azurite:3.18.0
commands:
- azurite-blob --blobHost 0.0.0.0
ports:
Expand Down
10 changes: 5 additions & 5 deletions internal/plugin/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ func TestHandleMount(t *testing.T) {
},
{
name: "handle-mount-glob-notempty",
mounts: []string{fmt.Sprintf("%s/%s", testRootGlob, "test/**")},
mounts: []string{fmt.Sprintf("%s/%s", testRootGlob, "test/**/test")},
expectedMounts: []string{
fmt.Sprintf("%s/%s", testRootGlob, "test/nestedA"),
fmt.Sprintf("%s/%s", testRootGlob, "test/nestedB"),
fmt.Sprintf("%s/%s", testRootGlob, "test/nestedA/test"),
fmt.Sprintf("%s/%s", testRootGlob, "test/nestedB/test"),
},
makeFiles: func() {
// Make test directories for glob to work properly
os.MkdirAll(fmt.Sprintf("%s/%s", testRootGlob, "test/nestedA"), 0755)
os.MkdirAll(fmt.Sprintf("%s/%s", testRootGlob, "test/nestedB"), 0755)
os.MkdirAll(fmt.Sprintf("%s/%s", testRootGlob, "test/nestedA/test"), 0755)
os.MkdirAll(fmt.Sprintf("%s/%s", testRootGlob, "test/nestedB/test"), 0755)
},
},
}
Expand Down
28 changes: 18 additions & 10 deletions internal/plugin/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,20 +328,28 @@ func exampleFileTreeWithSymlinks(t *testing.T, name string, content []byte) []st
func exampleNestedFileTreeWithGlob(t *testing.T, name string, content []byte) []string {
name = sanitize(name)

dir, dirClean := test.CreateTempFilesInDir(t, name, content, testRootMounted)
t.Cleanup(dirClean)
dirA, dirAClean := test.CreateTempDir(t, name, testRootMounted)
t.Cleanup(dirAClean)

_, nestedDirClean := test.CreateTempFilesInDir(t, name, content, dir)
t.Cleanup(nestedDirClean)
nestedDirA := fmt.Sprintf("%s/test", dirA)
os.Mkdir(nestedDirA, 0o755)
t.Cleanup(func() { os.RemoveAll(nestedDirA) })

_, nestedDirClean1 := test.CreateTempFilesInDir(t, name, content, dir)
t.Cleanup(nestedDirClean1)
_, nestedFilesAClean := test.CreateTempFilesInDir(t, name, content, nestedDirA)
t.Cleanup(nestedFilesAClean)

file, fileClean := test.CreateTempFile(t, name, content, dir)
t.Cleanup(fileClean)
dirB, dirBClean := test.CreateTempDir(t, name, testRootMounted)
t.Cleanup(dirBClean)

nestedDirB := fmt.Sprintf("%s/test", dirB)
os.Mkdir(nestedDirB, 0o755)
t.Cleanup(func() { os.RemoveAll(nestedDirB) })

_, nestedFilesBClean := test.CreateTempFilesInDir(t, name, content, nestedDirB)
t.Cleanup(nestedFilesBClean)

globPath := fmt.Sprintf("%s/**/", testRootMounted)
return []string{file, globPath}
globPath := fmt.Sprintf("%s/**/test", testRootMounted)
return []string{globPath}
}

// Setup
Expand Down

0 comments on commit f8ef0f9

Please sign in to comment.