Skip to content

Commit 19449bf

Browse files
committed
Add AWS kms integration test
Signed-off-by: Paolo Di Tommaso <[email protected]>
1 parent 2902254 commit 19449bf

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
function check_kms_key() {
2+
aws s3api head-object --bucket nf-kms-xyz --key work/ci-test/publish-s3/HELLO.tsv | grep -c e5109f93-b42d-4c26-89ee-8b251029a41d
3+
}
4+
5+
# Skip test if AWS keys are missing
6+
if [ -z "$AWS_ACCESS_KEY_ID" ]; then
7+
echo "Missing AWS credentials -- Skipping test"
8+
exit 0
9+
fi
10+
11+
#
12+
# run normal mode
13+
#
14+
$NXF_RUN -c .config | tee .stdout
15+
[[ `grep INFO .nextflow.log | grep -c 'Submitted process'` == 1 ]] || false
16+
[[ `check_kms_key` == 1 ]] || false
17+
18+
#
19+
# run resume mode
20+
#
21+
$NXF_RUN -c .config -resume | tee .stdout
22+
[[ `grep INFO .nextflow.log | grep -c 'Cached process'` == 1 ]] || false
23+
[[ `check_kms_key` == 1 ]] || false
24+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
aws.client.storageEncryption = 'aws:kms'
2+
aws.client.storageKmsKeyId = 'arn:aws:kms:eu-west-1:195996028523:key/e5109f93-b42d-4c26-89ee-8b251029a41d'

tests/publish-s3-kms.nf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
process my_process {
3+
publishDir "s3://nf-kms-xyz/work/ci-test/publish-s3"
4+
5+
input:
6+
val(param)
7+
8+
output:
9+
file("HELLO.tsv")
10+
11+
script:
12+
"""
13+
echo "Hello, world" > HELLO.tsv
14+
"""
15+
}
16+
17+
workflow {
18+
Channel.of(1) | my_process
19+
}

0 commit comments

Comments
 (0)