test: added test for ignoring .dagger directory in input dir

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba 2021-06-21 15:14:18 +02:00
parent 21c76f2873
commit f4afe5d129
4 changed files with 35 additions and 0 deletions

View File

@ -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

View 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
},
]

View File

View File

@ -0,0 +1 @@
thisisatest