changed workspace to project for tests

Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
Richard Jones
2021-09-23 12:07:09 -06:00
parent 7061ac816e
commit 68f18887da
7 changed files with 116 additions and 116 deletions

View File

@@ -42,7 +42,7 @@ setup() {
@test "dagger new: modules" {
"$DAGGER" init
cp -a "$TESTDIR"/cli/input/simple/* "$DAGGER_WORKSPACE"
cp -a "$TESTDIR"/cli/input/simple/* "$DAGGER_PROJECT"
"$DAGGER" new "a"
"$DAGGER" new "b"
@@ -61,7 +61,7 @@ setup() {
assert_success
assert_output "b"
# run ls -la "$DAGGER_WORKSPACE"
# run ls -la "$DAGGER_PROJECT"
# assert_failure
}
@@ -70,7 +70,7 @@ setup() {
@test "dagger new: packages" {
"$DAGGER" init
cp -a "$TESTDIR"/cli/packages/* "$DAGGER_WORKSPACE"
cp -a "$TESTDIR"/cli/packages/* "$DAGGER_PROJECT"
"$DAGGER" new "a" --package alpha.dagger.io/test/a
"$DAGGER" new "b" --package alpha.dagger.io/test/b
@@ -293,13 +293,13 @@ setup() {
dagger_new_with_plan input "$TESTDIR"/cli/input/artifact
# input dir outside the workspace
# input dir outside the project
run "$DAGGER" input -e "input" dir "source" /tmp
assert_failure
# input dir inside the workspace
cp -R "$TESTDIR"/cli/input/artifact/testdata/ "$DAGGER_WORKSPACE"/testdata
"$DAGGER" input -e "input" dir "source" "$DAGGER_WORKSPACE"/testdata
# input dir inside the project
cp -R "$TESTDIR"/cli/input/artifact/testdata/ "$DAGGER_PROJECT"/testdata
"$DAGGER" input -e "input" dir "source" "$DAGGER_PROJECT"/testdata
"$DAGGER" up -e "input"
run "$DAGGER" -l error query -e "input"
assert_success
@@ -331,8 +331,8 @@ setup() {
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
cp -R "$TESTDIR"/cli/input/ignore/testdata/ "$DAGGER_PROJECT"/testdata
"$DAGGER" input -e "input" dir "source" "$DAGGER_PROJECT"/testdata
"$DAGGER" up -e "input"
assert_success
}

View File

@@ -11,7 +11,7 @@ setup() {
# new-style tests: use 'dagger up'
#
# For new tests, please adopt new-style.
# NOTE: you will need to 'unset DAGGER_WORKSPACE'
# NOTE: you will need to 'unset DAGGER_PROJECT'
# at the beginning of each new-style test.
@test "core: inputs & outputs" {
@@ -26,7 +26,7 @@ setup() {
assert_output --partial 'dir'
# Set dir input
dagger -e test-core input dir dir "$DAGGER_WORKSPACE"
dagger -e test-core input dir dir "$DAGGER_PROJECT"
# Set text input
dagger -e test-core input text name Bob
@@ -160,5 +160,5 @@ setup() {
}
@test "compute: exclude" {
"$DAGGER" up -w "$TESTDIR"/compute/exclude
"$DAGGER" up --project "$TESTDIR"/compute/exclude
}

View File

@@ -10,8 +10,8 @@ common_setup() {
DAGGER_LOG_FORMAT="pretty"
export DAGGER_LOG_FORMAT
DAGGER_WORKSPACE="$(mktemp -d -t dagger-workspace-XXXXXX)"
export DAGGER_WORKSPACE
DAGGER_PROJECT="$(mktemp -d -t dagger-project-XXXXXX)"
export DAGGER_PROJECT
SOPS_AGE_KEY_FILE=~/.config/dagger/keys.txt
export SOPS_AGE_KEY_FILE
@@ -21,7 +21,7 @@ dagger_new_with_plan() {
local name="$1"
local sourcePlan="$2"
cp -a "$sourcePlan"/* "$DAGGER_WORKSPACE"
cp -a "$sourcePlan"/* "$DAGGER_PROJECT"
"$DAGGER" new "$name"
}
@@ -29,8 +29,8 @@ dagger_new_with_plan() {
dagger_new_with_env() {
local sourcePlan="$1"
"$DAGGER" init -w "$DAGGER_WORKSPACE"
rsync -av "$sourcePlan"/ "$DAGGER_WORKSPACE"
"$DAGGER" init --project "$DAGGER_PROJECT"
rsync -av "$sourcePlan"/ "$DAGGER_PROJECT"
}
# dagger helper to execute the right binary