Merge pull request #693 from samalba/test-input-dir-ignore
test: added test for ignoring .dagger directory in input dir
This commit is contained in:
commit
8ccda8de0f
@ -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" {
|
||||
"$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