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:
@@ -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
2
tests/ignore/testdata/.daggerignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
a.txt
|
||||
*/*.json
|
0
tests/ignore/testdata/a.txt
vendored
Normal file
0
tests/ignore/testdata/a.txt
vendored
Normal file
0
tests/ignore/testdata/b.txt
vendored
Normal file
0
tests/ignore/testdata/b.txt
vendored
Normal file
0
tests/ignore/testdata/foo/bar.txt
vendored
Normal file
0
tests/ignore/testdata/foo/bar.txt
vendored
Normal file
0
tests/ignore/testdata/foo/cow.json
vendored
Normal file
0
tests/ignore/testdata/foo/cow.json
vendored
Normal file
Reference in New Issue
Block a user