test: added test for ignoring .dagger directory in input dir
Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
parent
21c76f2873
commit
f4afe5d129
@ -308,6 +308,20 @@ setup() {
|
|||||||
}'
|
}'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "dagger input dir: ignore .dagger" {
|
||||||
|
"$DAGGER" init
|
||||||
|
|
||||||
|
dagger_new_with_plan input "$TESTDIR"/cli/input/ignore
|
||||||
|
|
||||||
|
run [ -d "$TESTDIR"/cli/input/ignore/testdata/.dagger ]
|
||||||
|
assert_success
|
||||||
|
|
||||||
|
cp -R "$TESTDIR"/cli/input/ignore/testdata/ "$DAGGER_WORKSPACE"/testdata
|
||||||
|
"$DAGGER" input -e "input" dir "source" "$DAGGER_WORKSPACE"/testdata
|
||||||
|
"$DAGGER" up -e "input"
|
||||||
|
assert_success
|
||||||
|
}
|
||||||
|
|
||||||
@test "dagger input git" {
|
@test "dagger input git" {
|
||||||
"$DAGGER" init
|
"$DAGGER" init
|
||||||
|
|
||||||
|
20
tests/cli/input/ignore/main.cue
Normal file
20
tests/cli/input/ignore/main.cue
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package testing
|
||||||
|
|
||||||
|
import (
|
||||||
|
"dagger.io/dagger/op"
|
||||||
|
"dagger.io/dagger"
|
||||||
|
)
|
||||||
|
|
||||||
|
source: dagger.#Artifact
|
||||||
|
|
||||||
|
#up: [
|
||||||
|
op.#FetchContainer & {ref: "busybox"},
|
||||||
|
op.#Exec & {
|
||||||
|
args: ["sh", "-c", """
|
||||||
|
set -exu
|
||||||
|
[ -f /source/testfile ]
|
||||||
|
[ ! -d /source/.dagger ]
|
||||||
|
"""]
|
||||||
|
mount: "/source": from: source
|
||||||
|
},
|
||||||
|
]
|
0
tests/cli/input/ignore/testdata/.dagger/foo
vendored
Normal file
0
tests/cli/input/ignore/testdata/.dagger/foo
vendored
Normal file
1
tests/cli/input/ignore/testdata/testfile
vendored
Normal file
1
tests/cli/input/ignore/testdata/testfile
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
thisisatest
|
Reference in New Issue
Block a user