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" {
|
@test "stdlib: s3" {
|
||||||
skip_unless_secrets_available "$TESTDIR"/stdlib/aws/inputs.yaml
|
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
|
package s3
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"dagger.io/dagger"
|
||||||
"dagger.io/aws"
|
"dagger.io/aws"
|
||||||
"dagger.io/aws/s3"
|
"dagger.io/aws/s3"
|
||||||
)
|
)
|
||||||
@ -20,5 +21,25 @@ TestS3UploadFile: {
|
|||||||
target: "s3://\(bucket)/test.txt"
|
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
|
// Script
|
||||||
aws.#Script & {
|
aws.#Script & {
|
||||||
code: """
|
code: """
|
||||||
aws s3 ls \(target) > /contents
|
aws s3 ls --recursive \(target) >> /contents
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#VerifyS3: {
|
#VerifyS3: {
|
||||||
|
file: string
|
||||||
|
|
||||||
lists: #List & {
|
lists: #List & {
|
||||||
config: TestConfig.awsConfig
|
config: TestConfig.awsConfig
|
||||||
target: "s3://\(bucket)"
|
target: "s3://\(bucket)"
|
||||||
@ -32,7 +34,7 @@ import (
|
|||||||
|
|
||||||
#CheckFiles:
|
#CheckFiles:
|
||||||
"""
|
"""
|
||||||
grep -q test.txt /test
|
grep -q \(file) /test
|
||||||
"""
|
"""
|
||||||
|
|
||||||
test: #up: [
|
test: #up: [
|
||||||
|
Reference in New Issue
Block a user