Skip to content

Commit a23cded

Browse files
authored
Fix AWS token used in tests (#1405)
The change in #1393 was not correct - although it exposed the new role, it never _used_ it anywhere and the net result was that the tests failed due to missing environment variables: https://github.com/hazelcast/hazelcast-cpp-client/blob/eb19e7f9f8789be79d79fbc1b29a3cf6f2bb98ad/hazelcast/test/src/HazelcastTests7.cpp#L1558-L1566 Added step to generate the required credentials, but still _without_ any hardcoded tokens. From the [PR job logs](https://github.com/hazelcast/hazelcast-cpp-client/actions/runs/21203887140/job/60995646608) I can see the credentials are now being passed through: <img width="961" height="953" alt="image" src="https://github.com/user-attachments/assets/f5078623-7f9f-4c04-9ec0-cf5711722649" />
1 parent eb19e7f commit a23cded

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

.github/actions/build-test/unix/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,22 @@ runs:
4646
-DBUILD_TESTS=ON \
4747
-DBUILD_EXAMPLES=OFF
4848
49+
- name: Configure AWS credentials
50+
if: ${{ inputs.RUN_TESTS == 'true' }}
51+
id: aws-credentials
52+
uses: aws-actions/configure-aws-credentials@v5
53+
with:
54+
role-to-assume: ${{ inputs.AWS_ROLE_TO_ASSUME }}
55+
aws-region: 'us-east-1'
56+
output-credentials: true
57+
4958
- name: Test
5059
if: ${{ inputs.RUN_TESTS == 'true' }}
5160
env:
5261
BUILD_DIR: build
5362
HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }}
54-
AWS_ROLE_TO_ASSUME: ${{ inputs.AWS_ROLE_TO_ASSUME }}
63+
AWS_ACCESS_KEY_ID: ${{ steps.aws-credentials.outputs.aws-access-key-id }}
64+
AWS_SECRET_ACCESS_KEY: ${{ steps.aws-credentials.outputs.aws-secret-access-key }}
5565
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
5666
BUILD_TYPE: ${{ inputs.BUILD_TYPE }}
5767
shell: bash

.github/actions/build-test/windows/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,23 @@ runs:
147147
-DBUILD_TESTS=ON `
148148
-DBUILD_EXAMPLES=OFF
149149
150+
- name: Configure AWS credentials
151+
if: ${{ inputs.RUN_TESTS == 'true' }}
152+
id: aws-credentials
153+
uses: aws-actions/configure-aws-credentials@v5
154+
with:
155+
role-to-assume: ${{ inputs.AWS_ROLE_TO_ASSUME }}
156+
aws-region: 'us-east-1'
157+
output-credentials: true
158+
150159
- name: Test
151160
if: ${{ inputs.RUN_TESTS == 'true' }}
152161
env:
153162
BUILD_DIR: build
154163
BUILD_CONFIGURATION: ${{ inputs.BUILD_TYPE }}
155164
HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }}
156-
AWS_ROLE_TO_ASSUME: ${{ inputs.AWS_ROLE_TO_ASSUME }}
165+
AWS_ACCESS_KEY_ID: ${{ steps.aws-credentials.outputs.aws-access-key-id }}
166+
AWS_SECRET_ACCESS_KEY: ${{ steps.aws-credentials.outputs.aws-secret-access-key }}
157167
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
158168
SSL_CERT_FILE: 'C:\cacert.pem'
159169
shell: pwsh

.github/actions/coverage-report/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,22 @@ runs:
6969
-DBUILD_TESTS=ON \
7070
-DBUILD_EXAMPLES=OFF
7171
72+
- name: Configure AWS credentials
73+
if: ${{ inputs.RUN_TESTS == 'true' }}
74+
id: aws-credentials
75+
uses: aws-actions/configure-aws-credentials@v5
76+
with:
77+
role-to-assume: ${{ inputs.AWS_ROLE_TO_ASSUME }}
78+
aws-region: 'us-east-1'
79+
output-credentials: true
80+
7281
- name: Test
7382
if: ${{ inputs.RUN_TESTS == 'true' }}
7483
env:
7584
BUILD_DIR: build
7685
HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }}
77-
AWS_ROLE_TO_ASSUME: ${{ inputs.AWS_ROLE_TO_ASSUME }}
86+
AWS_ACCESS_KEY_ID: ${{ steps.aws-credentials.outputs.aws-access-key-id }}
87+
AWS_SECRET_ACCESS_KEY: ${{ steps.aws-credentials.outputs.aws-secret-access-key }}
7888
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
7989
BUILD_TYPE: ${{ env.BUILD_TYPE }}
8090
shell: bash

0 commit comments

Comments
 (0)