Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple test environment for core features
Signed-off-by: Solomon Hykes <solomon@dagger.io>
- Loading branch information
Showing
5 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# dagger state | ||
state/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package testcore | ||
|
||
import ( | ||
"dagger.io/dagger" | ||
) | ||
|
||
name: string | *"world" @dagger(input) | ||
message: "Hello, \(name)!" @dagger(output) | ||
|
||
dir: dagger.#Artifact @dagger(input) | ||
samedir: dir @dagger(output) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
plan: | ||
module: .dagger/env/test-core/plan | ||
name: test-core | ||
inputs: | ||
dir: | ||
dir: | ||
path: ./tests | ||
sops: | ||
kms: [] | ||
gcp_kms: [] | ||
azure_kv: [] | ||
hc_vault: [] | ||
age: | ||
- recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk | ||
enc: | | ||
-----BEGIN AGE ENCRYPTED FILE----- | ||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBhOW1rUy9vNFBDaXRDUHJu | ||
ZVZYM1FucVorRDdUcmRaYmg3eTlTNzhhYWdjCndWZWxhZnhCZG4xZU9JQ1VyMXdR | ||
OHY0TS81bk9FL2JuUEhuTmcxa29ORGcKLS0tIGxJUzNrZmRBNHZGRFY2Z01QK2JP | ||
MlM1Ukdqbi9SQ0pqTi9FZ3MxN2E2QmsKHwd7P6KHPVdynOoto1jf3G4+5+vf87wU | ||
HX1KD7Od5wRdBwn7r3OS8mdvuNIYpJDUb5YDrfjQypt020ohLocNiA== | ||
-----END AGE ENCRYPTED FILE----- | ||
lastmodified: "2021-06-17T14:07:53Z" | ||
mac: ENC[AES256_GCM,data:afYut7wdvsJQgxlBg6NEV6DWk8vPi81mZgQAuWb4oe4WJeI1T9cYdtjOHPlmIpjqb86VQHJ29YTzektei2+k+VBawQxcsvefK7X1QboJTfMKLfsiug4qzNWjc7JZDvTb6dsDFM1U96gjSoAIVwdLMnucbu3681Fd7qSQgqNS61Q=,iv:ZQDHzXp0RJcUI4RtOVjdepV8zTa2kIHQhAltLkudDck=,tag:AnSFi1mKrEuXSqE4R+g7dw==,type:str] | ||
pgp: [] | ||
encrypted_suffix: secret | ||
version: 3.7.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Test core Dagger features & types | ||
|
||
setup() { | ||
load 'helpers' | ||
|
||
common_setup | ||
|
||
# Use native Dagger environment here | ||
unset DAGGER_WORKSPACE | ||
} | ||
|
||
@test "core: inputs" { | ||
# List available inputs | ||
run dagger -e test-core input list | ||
assert_success | ||
assert_output --partial 'name' | ||
assert_output --partial 'dir' | ||
|
||
# Set text input | ||
dagger -e test-core input text name Bob | ||
run dagger -e test-core up | ||
assert_success | ||
assert_output --partial 'Hello, Bob!' | ||
|
||
# Unset text input | ||
dagger -e test-core input unset name | ||
run dagger -e test-core up | ||
assert_success | ||
assert_output --partial 'Hello, world!' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters