Add test on op.#FetchGit for private repository

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau 2021-08-25 17:41:43 +02:00 committed by Guillaume de Rouville
parent d7194f161d
commit a987d1dc34
4 changed files with 54 additions and 0 deletions

View File

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

View File

@ -0,0 +1,26 @@
plan:
package: ./dagger/op/tests/fetch-git
name: op-fetch-git
inputs:
TestPAT:
secret: ENC[AES256_GCM,data:4rBqMc8jbs0mIl2tqxZZu6xhKWq1zb4Zmdd4eobZxmT5xkeVJM94KA==,iv:xj6wu5amzCACh8vvBbtqYK8MLsFvoFIYe2wsDLhbzhc=,tag:ZCInVlyCr41MfV9W9SK5iw==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1gxwmtwahzwdmrskhf90ppwlnze30lgpm056kuesrxzeuyclrwvpsupwtpk
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBjYUh0WC8yTEtaK2VlZEU4
c1pCTUNFWWt3WE5GSzZPU1VuWnVQWHMyWTF3CnVRN0ovd2tWUlU0Q1BneEEyQm9s
Rm9TNGVVK3g5aVJUOGNYRzdxbERnNUUKLS0tIDRvTlU2eUozZy9jYzFqOHB6SzNE
NnhoNTZYQVJBV1FKUHI1aWJZTnc0bEkKBNxuA26mtiAznfuGbLcqeIxvgg9kLjBl
ZofKLWu33k7aUQJADAEKoFD7B0B502LtQRMLk94ObzdhdLxl1F3JNA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2021-08-25T15:03:39Z"
mac: ENC[AES256_GCM,data:IwMHAYejWYenT9KCSSBQhQcRMS+6EJBwDlmP1iWBNs41sbFMSvLabRsh1QHfgN8IYMc02XSii3PM8nDW44CG3s2PYaejEbS0/Q4OnqDFWjW3oyaDxS5/4OvJALV5JWSyQYAItepI1B/M6vL8nXS8lUxxuythX5jyEq9LTGfB608=,iv:8ecze6Fz8BSnENS6cXTpZ6s5zAQMsnb3yqvCjDvwhMc=,tag:iHi/g9K8GX9hrJGN2oq7Jg==,type:str]
pgp: []
encrypted_suffix: secret
version: 3.7.1

View File

@ -0,0 +1,22 @@
package op
import (
"alpha.dagger.io/os"
"alpha.dagger.io/dagger"
"alpha.dagger.io/dagger/op"
)
// Github PAT
TestPAT: dagger.#Input & {dagger.#Secret}
TestRepo: #up: [op.#FetchGit & {
remote: "https://github.com/dagger/dagger.git"
ref: "main"
authTokenSecret: TestPAT
}]
TestContent: os.#Container & {
always: true
command: "ls -l /input/repo | grep 'universe -> stdlib'"
mount: "/input/repo": from: TestRepo
}

View File

@ -8,6 +8,10 @@ setup() {
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" {
dagger -e os up