use the workspace as the plan module

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-07-02 18:28:03 +02:00
parent 919d5576d0
commit 6e215b194e
7 changed files with 95 additions and 73 deletions

View File

@@ -27,7 +27,7 @@ setup() {
assert_success
refute_output
run "$DAGGER" new "test" --module "$DAGGER_WORKSPACE"
run "$DAGGER" new "test"
assert_success
run "$DAGGER" list
@@ -42,10 +42,10 @@ setup() {
@test "dagger new: modules" {
"$DAGGER" init
ln -s "$TESTDIR"/cli/input/simple "$DAGGER_WORKSPACE"/plan
cp -a "$TESTDIR"/cli/input/simple/* "$DAGGER_WORKSPACE"
"$DAGGER" new "a" --module "$DAGGER_WORKSPACE"/plan
"$DAGGER" new "b" --module "$DAGGER_WORKSPACE"/plan
"$DAGGER" new "a"
"$DAGGER" new "b"
"$DAGGER" input -e "a" text "input" "a"
"$DAGGER" input -e "b" text "input" "b"
@@ -60,6 +60,9 @@ setup() {
run "$DAGGER" query -l error -e "b" input -f text
assert_success
assert_output "b"
# run ls -la "$DAGGER_WORKSPACE"
# assert_failure
}
# create different environments from the same module,
@@ -67,10 +70,10 @@ setup() {
@test "dagger new: packages" {
"$DAGGER" init
ln -s "$TESTDIR"/cli/packages "$DAGGER_WORKSPACE"/plan
cp -a "$TESTDIR"/cli/packages/* "$DAGGER_WORKSPACE"
"$DAGGER" new "a" --module "$DAGGER_WORKSPACE"/plan --package alpha.dagger.io/test/a
"$DAGGER" new "b" --module "$DAGGER_WORKSPACE"/plan --package alpha.dagger.io/test/b
"$DAGGER" new "a" --package alpha.dagger.io/test/a
"$DAGGER" new "b" --package alpha.dagger.io/test/b
"$DAGGER" up -e "a"
"$DAGGER" up -e "b"

View File

@@ -20,11 +20,10 @@ common_setup() {
dagger_new_with_plan() {
local name="$1"
local sourcePlan="$2"
local targetPlan="$DAGGER_WORKSPACE"/"$name"
ln -s "$sourcePlan" "$targetPlan"
"$DAGGER" new "$name" --module "$targetPlan"
cp -a "$sourcePlan"/* "$DAGGER_WORKSPACE"
"$DAGGER" new "$name"
}
# dagger helper to execute the right binary