tests: gcs: force dependency between deploy and verify
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
parent
c20c272940
commit
59281b38fc
@ -3,31 +3,41 @@ package gcs
|
||||
import (
|
||||
"alpha.dagger.io/dagger"
|
||||
"alpha.dagger.io/gcp"
|
||||
"alpha.dagger.io/random"
|
||||
)
|
||||
|
||||
TestConfig: gcpConfig: gcp.#Config
|
||||
|
||||
bucket: "dagger-ci"
|
||||
TestConfig: {
|
||||
gcpConfig: gcp.#Config
|
||||
bucket: string @dagger(input)
|
||||
}
|
||||
|
||||
TestDirectory: dagger.#Artifact
|
||||
|
||||
TestGCSObject: {
|
||||
suffix: random.#String & {
|
||||
seed: "gcs"
|
||||
}
|
||||
|
||||
target: "gs://\(TestConfig.bucket)/\(suffix.out)/"
|
||||
|
||||
deploy: #Object & {
|
||||
always: true
|
||||
config: TestConfig.gcpConfig
|
||||
source: TestDirectory
|
||||
target: "gs://\(bucket)/"
|
||||
always: true
|
||||
config: TestConfig.gcpConfig
|
||||
source: TestDirectory
|
||||
"target": target
|
||||
}
|
||||
|
||||
verifyFile: #VerifyGCS & {
|
||||
config: TestConfig.gcpConfig
|
||||
target: deploy.target
|
||||
url: deploy.url
|
||||
file: "dirFile.txt"
|
||||
}
|
||||
|
||||
verifyDir: #VerifyGCS & {
|
||||
config: TestConfig.gcpConfig
|
||||
target: deploy.target
|
||||
url: deploy.url
|
||||
file: "foo.txt"
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,10 @@ import (
|
||||
config: gcp.#Config
|
||||
|
||||
// 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: {
|
||||
string
|
||||
@ -35,6 +38,7 @@ import (
|
||||
gsutil ls -r \#(target) > /contents
|
||||
"""#,
|
||||
]
|
||||
env: URL: url
|
||||
},
|
||||
|
||||
op.#Export & {
|
||||
@ -49,10 +53,12 @@ import (
|
||||
file: string
|
||||
config: gcp.#Config
|
||||
target: string
|
||||
url: string
|
||||
|
||||
lists: #List & {
|
||||
"config": config
|
||||
"target": target
|
||||
"url": url
|
||||
}
|
||||
|
||||
test: #up: [
|
||||
|
Reference in New Issue
Block a user