From 6848755a428c33c5482bd31763140d24e9d5b2ea Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 20 Dec 2021 13:30:55 -0700 Subject: [PATCH] added gitdir test Signed-off-by: Richard Jones --- tests/tasks.bats | 1 + tests/tasks/gitPull/gitdir.cue | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tests/tasks/gitPull/gitdir.cue diff --git a/tests/tasks.bats b/tests/tasks.bats index 9d893739..6b77d043 100644 --- a/tests/tasks.bats +++ b/tests/tasks.bats @@ -96,4 +96,5 @@ setup() { @test "task: #GitPull" { cd "$TESTDIR"/tasks/gitPull/ "$DAGGER" --europa up ./exists.cue + "$DAGGER" --europa up ./gitdir.cue } diff --git a/tests/tasks/gitPull/gitdir.cue b/tests/tasks/gitPull/gitdir.cue new file mode 100644 index 00000000..93861b02 --- /dev/null +++ b/tests/tasks/gitPull/gitdir.cue @@ -0,0 +1,36 @@ +package testing + +import "alpha.dagger.io/europa/dagger/engine" + +engine.#Plan & { + actions: { + repo1: engine.#GitPull & { + remote: "https://github.com/blocklayerhq/acme-clothing.git" + ref: "master" + } + + repo2: engine.#GitPull & { + remote: "https://github.com/blocklayerhq/acme-clothing.git" + ref: "master" + keepGitDir: true + } + + image: engine.#Pull & { + source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" + } + + verify: engine.#Exec & { + input: image.output + args: ["sh", "-c", """ + set -eu + [ ! -d /repo1/.git ] + [ -d /repo2/.git ] + """] + mounts: { + repo_1: {dest: "/repo1", contents: repo1.output} + repo_2: {dest: "/repo2", contents: repo2.output} + } + } + + } +}