Skip to content

Commit 11bbac4

Browse files
fixup CI to merge configs for new matrix
1 parent 948efcb commit 11bbac4

File tree

2 files changed

+36
-22
lines changed

2 files changed

+36
-22
lines changed

.github/docker/docker-compose.sse.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ services:
3333
# using artesca container
3434
- ../../localData:/usr/src/app/localData
3535
- ../../localMetadata:/usr/src/app/localMetadata
36-
- ../../tests/functional/sse-kms-migration/config.${SSE_CONF}.json:/conf/config.json
36+
- ../../tests/functional/sse-kms-migration/config.json:/conf/config.json
3737
environment:
3838
- S3_CONFIG_FILE=/conf/config.json
3939
- S3VAULT=scality

.github/workflows/tests.yaml

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ jobs:
372372
source: /tmp/artifacts
373373
if: always()
374374

375+
# This test with the final yarn run ft_sse_arn covers more code than the kmip tests
375376
sse-kms-migration-tests:
376377
strategy:
377378
matrix:
@@ -387,7 +388,7 @@ jobs:
387388
globalEncryptionEnabled: false
388389
- kmsHideScalityArn: false
389390
globalEncryptionEnabled: false
390-
- kmsHideScalityArn: true
391+
- kmsHideScalityArn: false
391392
globalEncryptionEnabled: true
392393
# This matrix should create 6 different jobs
393394
# No need to test globalEncryption with hidden arn (not related)
@@ -418,9 +419,9 @@ jobs:
418419
sse-kms-migration-${{
419420
matrix.kms.provider
420421
}}-${{
421-
matrix.kmsHideScalityArn && 'hideArn' || 'showArn'
422+
matrix.opts.kmsHideScalityArn && 'hideArn' || 'showArn'
422423
}}${{
423-
matrix.globalEncryptionEnabled && 'global' || ''
424+
matrix.opts.globalEncryptionEnabled && '-global' || ''
424425
}}
425426
COMPOSE_FILE: docker-compose.yaml:docker-compose.sse.yaml
426427
steps:
@@ -437,21 +438,23 @@ jobs:
437438
password: ${{ github.token }}
438439
- name: Setup CI environment
439440
uses: ./.github/actions/setup-ci
440-
- name: Copy KMIP certs (kmip always configured even when aws is used)
441+
- name: Copy KMIP certs
441442
run: cp -r ./certs /tmp/ssl-kmip
442443
working-directory: .github/pykmip
443444
- name: Setup matrix job artifacts directory
444445
shell: bash
445446
run: |
446447
set -exu
447-
mkdir -p /tmp/artifacts/${{ matrix.job-name }}/
448+
mkdir -p /tmp/artifacts/${{ env.JOB_NAME }}/
449+
- name: Copy base config
450+
run: cp configs/base.json config.json
451+
working-directory: tests/functional/sse-kms-migration
448452
- name: Setup CI services (with old cloudserver image before sse migration)
449453
run: docker compose up -d --quiet-pull redis vault-sse-before-migration cloudserver-sse-before-migration
450454
working-directory: .github/docker
451455
env:
452456
CLOUDSERVER_IMAGE: ${{ env.CLOUDSERVER_IMAGE_BEFORE_SSE_MIGRATION }}
453457
VAULT_IMAGE: ${{ env.VAULT_IMAGE_BEFORE_SSE_MIGRATION }}
454-
SSE_CONF: before
455458
- name: Wait for services vault and s3
456459
run: |-
457460
bash wait_for_local_port.bash 8500 40
@@ -472,21 +475,32 @@ jobs:
472475
shell: bash # for pipefail
473476
env:
474477
# yarn run does a cd into the test folder
475-
S3_CONFIG_FILE: config.before.json
478+
S3_CONFIG_FILE: config.json
476479
S3KMS: file
477-
run: yarn run ft_sse_before_migration | tee /tmp/artifacts/${{ matrix.job-name }}/beforeMigration.log
480+
run: yarn run ft_sse_before_migration | tee /tmp/artifacts/${{ env.JOB_NAME }}/beforeMigration.log
481+
- name: Merge config.json files for options
482+
run: |
483+
jq -s '
484+
.[0] * .[1] * .[2] *
485+
{ kmsHideScalityArn: ${{ matrix.opts.kmsHideScalityArn }} } *
486+
{ globalEncryptionEnabled: ${{ matrix.opts.globalEncryptionEnabled }} }
487+
' \
488+
configs/base.json \
489+
configs/${{ matrix.kms.provider }}.json \
490+
configs/sseMigration.json \
491+
> config.json
492+
working-directory: tests/functional/sse-kms-migration
478493
- name: Replace old cloudserver image with current one
479494
run: |-
480495
docker compose down cloudserver-sse-before-migration vault-sse-before-migration
481-
docker compose up -d --quiet-pull ${{ matrix.kmsContainer }} vault-sse-migration cloudserver-sse-migration
496+
docker compose up -d --quiet-pull ${{ matrix.kms.container }} vault-sse-migration cloudserver-sse-migration
482497
working-directory: .github/docker
483498
env:
484-
SSE_CONF: sseMigration.${{ matrix.kmsHideScalityArn }}
485-
S3KMS: ${{ matrix.kmsProvider }} # S3
486-
KMS_BACKEND: ${{ matrix.kmsProvider == 'aws' && 'aws' || '' }} # vault only supports aws
499+
S3KMS: ${{ matrix.kms.provider }} # S3
500+
KMS_BACKEND: ${{ matrix.kms.provider == 'aws' && 'aws' || '' }} # vault only supports aws
487501
- name: Wait for services kms vault and s3
488502
run: |-
489-
bash wait_for_local_port.bash ${{ matrix.kmsPort }} 40
503+
bash wait_for_local_port.bash ${{ matrix.kms.port }} 40
490504
bash wait_for_local_port.bash 8500 40
491505
bash wait_for_local_port.bash 8000 40
492506
- name: Ensure latest version of cloudserver and vault is used
@@ -500,31 +514,31 @@ jobs:
500514
# Functional tests needs access to the running config to use the same
501515
# KMS provider and sseMigration
502516
# yarn run does a cd into the test folder
503-
S3_CONFIG_FILE: config.sseMigration.${{ matrix.kmsHideScalityArn }}.json
504-
S3KMS: ${{ matrix.kmsProvider }}
505-
run: yarn run ft_sse_migration | tee /tmp/artifacts/${{ matrix.job-name }}/migration.log
517+
S3_CONFIG_FILE: config.json
518+
S3KMS: ${{ matrix.kms.provider }}
519+
run: yarn run ft_sse_migration | tee /tmp/artifacts/${{ env.JOB_NAME }}/migration.log
506520
- name: Run SSE arnPrefix tests
507521
shell: bash # for pipefail
508522
env:
509523
# Functional tests needs access to the running config to use the same
510524
# KMS provider and sseMigration
511525
# yarn run does a cd into the test folder
512-
S3_CONFIG_FILE: config.sseMigration.${{ matrix.kmsHideScalityArn }}.json
513-
S3KMS: ${{ matrix.kmsProvider }}
514-
run: yarn run ft_sse_arn | tee /tmp/artifacts/${{ matrix.job-name }}/arnPrefix.log
526+
S3_CONFIG_FILE: config.json
527+
S3KMS: ${{ matrix.kms.provider }}
528+
run: yarn run ft_sse_arn | tee /tmp/artifacts/${{ env.JOB_NAME }}/arnPrefix.log
515529
- name: Print docker compose logs
516530
run: |-
517531
docker compose logs \
518532
cloudserver-sse-before-migration \
519533
cloudserver-sse-migration \
520534
vault-sse-before-migration \
521535
vault-sse-migration \
522-
${{ matrix.kmsContainer == 'localkms' && 'localkms' || '' }}
536+
${{ matrix.kms.container == 'localkms' && 'localkms' || '' }}
523537
# pykmip logs are already uploaded to artifacts, but not localkms
524538
working-directory: .github/docker
525539
if: failure()
526540
- name: Remove empty artifact files to simplify viewing artifacts
527-
run: find /tmp/artifacts/${{ matrix.job-name }}/ -size 0 -delete
541+
run: find /tmp/artifacts/${{ env.JOB_NAME }}/ -size 0 -delete
528542
if: always()
529543
- name: Upload logs to artifacts
530544
uses: scality/action-artifacts@v4

0 commit comments

Comments
 (0)