Move private repository tests + implement env helper function

Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
This commit is contained in:
Guillaume de Rouville 2021-08-26 12:14:17 +02:00
parent a987d1dc34
commit 3b0e3f6919
8 changed files with 42 additions and 5 deletions

View File

@ -8,11 +8,6 @@ setup() {
dagger -e sanity-check up dagger -e sanity-check up
} }
@test "op-fetch-git" {
# This test should be in `tests/ops.bats` but dagger compute doesn't handle `dagger.#Secret`
dagger -e op-fetch-git up
}
@test "os" { @test "os" {
dagger -e os up dagger -e os up
} }

View File

@ -26,6 +26,13 @@ dagger_new_with_plan() {
"$DAGGER" new "$name" "$DAGGER" new "$name"
} }
dagger_new_with_env() {
local sourcePlan="$1"
"$DAGGER" init -w "$DAGGER_WORKSPACE"
rsync -av "$sourcePlan"/ "$DAGGER_WORKSPACE"
}
# dagger helper to execute the right binary # dagger helper to execute the right binary
dagger() { dagger() {
"${DAGGER}" "$@" "${DAGGER}" "$@"

View File

@ -108,6 +108,10 @@ setup() {
run "$DAGGER" compute "$TESTDIR"/ops/fetch-git/gitdir run "$DAGGER" compute "$TESTDIR"/ops/fetch-git/gitdir
assert_success assert_success
dagger_new_with_env "$TESTDIR"/ops/fetch-git/private-repo
run "$DAGGER" up -e op-fetch-git
assert_success
# FIXME: distinguish missing inputs from incorrect config # FIXME: distinguish missing inputs from incorrect config
# run "$DAGGER" compute "$TESTDIR"/ops/fetch-git/invalid # run "$DAGGER" compute "$TESTDIR"/ops/fetch-git/invalid
# assert_failure # assert_failure

View File

@ -0,0 +1,2 @@
# dagger state
state/**

View File

@ -0,0 +1,26 @@
plan:
package: .
name: op-fetch-git
inputs:
TestPAT:
secret: ENC[AES256_GCM,data:TVMwgMe+Q/BzQ/rxKIr9lRPuu2FpVQXppufy33lWQ8An+c9cTSVLCQ==,iv:Xpe54Llfcu1aTWkzNxUtcRrrqIlI/i4pdshOCVKeREY=,tag:Ugwzcpmddzhq62gPKpAkkQ==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoamxhWnpyQzJRcE9TRldj
Rmd6eHV5TnpReENzNHI3MFZRZWpqaGJoRzFjClMyQW1raVNiSU84blhhSzRja01F
cjVpVmxJS1o0NEdlTXYvQ290Rjdma0kKLS0tIDkrTjRHTEtaaDY2QzhBaVJYRjhn
OXA2TkFjYlVNMFFEblA2MUZRWVB3T3MKhunM53KD+jGvdAInPbr+N6YrpirLIp4V
seb6c4bryHPL+zZWSX1H04sCWgGOypLfYq/fUyPOunbs/b+AWn8chw==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2021-08-26T09:34:51Z"
mac: ENC[AES256_GCM,data:JUo5COutVZMqJN2UNhqL842hhGsMdCLOFFo5g4HDFMQLG3M1iQ2M0i8AjnAlPGMukNoF3qr/rTf6FCNdpeXc/oXiOM+q0w9xp+jGup5uplhXUWw+au4YHXbSezxCVtmKCRIzkDBiN5x2zKLg7qBzsqKdzyeBiBI/QAPCoXuTk4g=,iv:m4GKvZ8g4dniAbTnUO+wjZlYx6uCJcCwkanoAzjciuY=,tag:vUUHFcGg5OIjDHeI0B+RGw==,type:str]
pgp: []
encrypted_suffix: secret
version: 3.7.1

View File

@ -0,0 +1 @@
module: ""

View File

@ -0,0 +1,2 @@
# dagger universe
alpha.dagger.io