impl test, log patterns when .daggerignore found, lint, fix stdlib/file test imports

Signed-off-by: Tony Worm <tony@hofstadter.io>
This commit is contained in:
Tony Worm
2021-03-18 12:38:50 -04:00
parent a1ba7aa59c
commit 3dab86694e
9 changed files with 63 additions and 46 deletions

View File

@@ -1,21 +1,41 @@
package main
package test
import (
"dagger.io/alpine"
"dagger.io/dagger"
"dagger.io/llb"
)
dir: dagger.#Artifact
TestData: dagger.#Artifact
ignore: {
_expected: """
/src/b.txt
/src/foo:
bar.txt
"""
TestIgnore: {
string
#compute: [
llb.#FetchContainer & { ref: "debian:buster" },
llb.#Load & {from: alpine.#Image},
llb.#Exec & {
args: ["bash", "-c", "ls -lh /src > /out.txt"]
mount: "/src": { from: dir }
args: ["sh", "-c", "ls /src/* > /out.txt"]
mount: "/src": from: TestData
},
llb.#Export & {source: "/out.txt"},
llb.#Exec & {
args: [
"sh",
"-ec",
"""
cat > /test.txt << EOF
\(_expected)
EOF
test "$(cat /out.txt)" = "$(cat /test.txt)"
""",
]
},
llb.#Export & { source: "/out.txt" },
]
}

2
tests/ignore/testdata/.daggerignore vendored Normal file
View File

@@ -0,0 +1,2 @@
a.txt
*/*.json

0
tests/ignore/testdata/a.txt vendored Normal file
View File

0
tests/ignore/testdata/b.txt vendored Normal file
View File

0
tests/ignore/testdata/foo/bar.txt vendored Normal file
View File

0
tests/ignore/testdata/foo/cow.json vendored Normal file
View File