Add tests on AWS s3 upload directory
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
parent
226be80d56
commit
b3c29acb34
@ -41,5 +41,5 @@ setup() {
|
||||
@test "stdlib: s3" {
|
||||
skip_unless_secrets_available "$TESTDIR"/stdlib/aws/inputs.yaml
|
||||
|
||||
"$DAGGER" compute "$TESTDIR"/stdlib/aws/s3 --input-yaml "$TESTDIR"/stdlib/aws/inputs.yaml
|
||||
"$DAGGER" compute "$TESTDIR"/stdlib/aws/s3 --input-dir TestDirectory="$TESTDIR"/stdlib/aws/s3/testdata --input-yaml "$TESTDIR"/stdlib/aws/inputs.yaml
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package s3
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
"dagger.io/aws"
|
||||
"dagger.io/aws/s3"
|
||||
)
|
||||
@ -20,5 +21,25 @@ TestS3UploadFile: {
|
||||
target: "s3://\(bucket)/test.txt"
|
||||
}
|
||||
|
||||
verify: #VerifyS3
|
||||
verify: #VerifyS3 & {
|
||||
file: "test.txt"
|
||||
}
|
||||
}
|
||||
|
||||
TestDirectory: dagger.#Artifact
|
||||
|
||||
TestS3UploadDir: {
|
||||
deploy: s3.#Put & {
|
||||
config: TestConfig.awsConfig
|
||||
source: TestDirectory
|
||||
target: "s3://\(bucket)/"
|
||||
}
|
||||
|
||||
verifyFile: #VerifyS3 & {
|
||||
file: "dirFile.txt"
|
||||
}
|
||||
|
||||
verifyDir: #VerifyS3 & {
|
||||
file: "foo.txt"
|
||||
}
|
||||
}
|
||||
|
1
tests/stdlib/aws/s3/testdata/bar/foo.txt
vendored
Normal file
1
tests/stdlib/aws/s3/testdata/bar/foo.txt
vendored
Normal file
@ -0,0 +1 @@
|
||||
Test recursivity
|
1
tests/stdlib/aws/s3/testdata/dirFile.txt
vendored
Normal file
1
tests/stdlib/aws/s3/testdata/dirFile.txt
vendored
Normal file
@ -0,0 +1 @@
|
||||
Test directory
|
@ -19,12 +19,14 @@ import (
|
||||
// Script
|
||||
aws.#Script & {
|
||||
code: """
|
||||
aws s3 ls \(target) > /contents
|
||||
aws s3 ls --recursive \(target) >> /contents
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
#VerifyS3: {
|
||||
file: string
|
||||
|
||||
lists: #List & {
|
||||
config: TestConfig.awsConfig
|
||||
target: "s3://\(bucket)"
|
||||
@ -32,7 +34,7 @@ import (
|
||||
|
||||
#CheckFiles:
|
||||
"""
|
||||
grep -q test.txt /test
|
||||
grep -q \(file) /test
|
||||
"""
|
||||
|
||||
test: #up: [
|
||||
|
Reference in New Issue
Block a user