tests: gcs: force dependency between deploy and verify

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2021-06-30 12:49:53 +02:00
parent c20c272940
commit 59281b38fc
2 changed files with 24 additions and 8 deletions

View File

@ -3,31 +3,41 @@ package gcs
import ( import (
"alpha.dagger.io/dagger" "alpha.dagger.io/dagger"
"alpha.dagger.io/gcp" "alpha.dagger.io/gcp"
"alpha.dagger.io/random"
) )
TestConfig: gcpConfig: gcp.#Config TestConfig: {
gcpConfig: gcp.#Config
bucket: "dagger-ci" bucket: string @dagger(input)
}
TestDirectory: dagger.#Artifact TestDirectory: dagger.#Artifact
TestGCSObject: { TestGCSObject: {
suffix: random.#String & {
seed: "gcs"
}
target: "gs://\(TestConfig.bucket)/\(suffix.out)/"
deploy: #Object & { deploy: #Object & {
always: true always: true
config: TestConfig.gcpConfig config: TestConfig.gcpConfig
source: TestDirectory source: TestDirectory
target: "gs://\(bucket)/" "target": target
} }
verifyFile: #VerifyGCS & { verifyFile: #VerifyGCS & {
config: TestConfig.gcpConfig config: TestConfig.gcpConfig
target: deploy.target target: deploy.target
url: deploy.url
file: "dirFile.txt" file: "dirFile.txt"
} }
verifyDir: #VerifyGCS & { verifyDir: #VerifyGCS & {
config: TestConfig.gcpConfig config: TestConfig.gcpConfig
target: deploy.target target: deploy.target
url: deploy.url
file: "foo.txt" file: "foo.txt"
} }
} }

View File

@ -11,7 +11,10 @@ import (
config: gcp.#Config config: gcp.#Config
// Target GCP URL (e.g. gs://<bucket-name>/<path>/<sub-path>) // Target GCP URL (e.g. gs://<bucket-name>/<path>/<sub-path>)
target?: string target: string
// URL: dummy URL, used to force a dependency
url: string
contents: { contents: {
string string
@ -35,6 +38,7 @@ import (
gsutil ls -r \#(target) > /contents gsutil ls -r \#(target) > /contents
"""#, """#,
] ]
env: URL: url
}, },
op.#Export & { op.#Export & {
@ -49,10 +53,12 @@ import (
file: string file: string
config: gcp.#Config config: gcp.#Config
target: string target: string
url: string
lists: #List & { lists: #List & {
"config": config "config": config
"target": target "target": target
"url": url
} }
test: #up: [ test: #up: [