Skip to content

Commit 85785f1

Browse files
committed
Revert "[DRAFT] Refactor S3 integration tests into different actions"
This reverts commit 25afb2d.
1 parent 63cf81b commit 85785f1

5 files changed

Lines changed: 72 additions & 115 deletions

File tree

.github/actions/s3-integration-run-aws-assume/action.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/actions/s3-integration-run-aws-iam/action.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/actions/s3-integration-run-aws/action.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Run AWS S3 Integration Tests
2+
description: Runs integration tests against to aws infrastructure.
3+
4+
inputs:
5+
access_key_id:
6+
description: 'AWS Access Key ID'
7+
required: true
8+
secret_access_key:
9+
description: 'AWS Secret Access Key'
10+
required: true
11+
region_name:
12+
description: 'AWS Region Name'
13+
required: true
14+
stack_name:
15+
description: 'CloudFormation Stack Name (required for aws and aws-iam tests)'
16+
required: false
17+
default: ''
18+
test_type:
19+
description: 'Type of test to run (e.g.,aws, aws-iam, aws-assume)'
20+
required: true
21+
label_filter:
22+
description: 'Ginkgo Label Filter for tests to run'
23+
required: true
24+
s3_endpoint_host:
25+
description: 'Custom S3 Endpoint Host'
26+
required: false
27+
role_arn:
28+
description: 'AWS Role ARN to test assume role functionality'
29+
required: false
30+
default: ''
31+
32+
runs:
33+
using: 'composite'
34+
steps:
35+
- name: Run AWS S3 Integration Tests
36+
shell: bash
37+
run: |
38+
set -e
39+
export access_key_id="${{inputs.access_key_id}}"
40+
export secret_access_key="${{inputs.secret_access_key}}"
41+
export region_name="${{inputs.region_name}}"
42+
export stack_name="${{inputs.stack_name}}"
43+
44+
if [[ "${{inputs.test_type}}" == "aws" ]]; then
45+
export role_arn="${{inputs.role_arn}}"
46+
export s3_endpoint_host="${{inputs.s3_endpoint_host}}"
47+
export label_filter="${{inputs.label_filter}}"
48+
echo "Running standard AWS integration tests..."
49+
./.github/scripts/s3/run-integration-aws.sh
50+
elif [[ "${{inputs.test_type}}" == "aws-iam" ]]; then
51+
export label_filter="${{inputs.label_filter}}"
52+
echo "Running AWS IAM role tests..."
53+
./.github/scripts/s3/run-integration-aws-iam.sh
54+
elif [[ "${{inputs.test_type}}" == "aws-assume" ]]; then
55+
export assume_role_arn="${{inputs.role_arn}}"
56+
export label_filter="${{inputs.label_filter}}"
57+
echo "Running AWS assume role tests..."
58+
./.github/scripts/s3/run-integration-aws-assume.sh
59+
else
60+
echo "Error: Unknown test_type '${{inputs.test_type}}'"
61+
echo "Valid options are: aws, aws-iam, aws-assume"
62+
exit 1
63+
fi

.github/workflows/s3-integration.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,32 +46,36 @@ jobs:
4646
stack_name: ${{ env.STACK_NAME }}
4747

4848
- name: Test Static Credentials
49-
uses: ./.github/actions/s3-integration-run-aws
49+
uses: ./.github/actions/s3-integration-run
5050
with:
5151
access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
5252
secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
5353
region_name: ${{ env.REGION_NAME }}
5454
stack_name: ${{ env.STACK_NAME }}
5555
s3_endpoint_host: ${{ env.S3_ENDPOINT_HOST }}
5656
label_filter: 'aws && static && (general || us-east-1)'
57+
test_type: 'aws'
5758

5859
- name: Test IAM Roles
59-
uses: ./.github/actions/s3-integration-run-aws-iam
60+
uses: ./.github/actions/s3-integration-run
6061
with:
6162
access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
6263
secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6364
region_name: ${{ env.REGION_NAME }}
6465
stack_name: ${{ env.STACK_NAME }}
6566
label_filter: 'aws && iam-role'
67+
test_type: 'aws-iam'
6668

6769
- name: Test Assume Roles
68-
uses: ./.github/actions/s3-integration-run-aws-assume
70+
uses: ./.github/actions/s3-integration-run
6971
with:
7072
access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
7173
secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
7274
region_name: ${{ env.REGION_NAME }}
75+
stack_name: ${{ env.STACK_NAME }}
7376
role_arn: ${{ secrets.AWS_ROLE_ARN }}
7477
label_filter: 'aws && assume-role'
78+
test_type: 'aws-assume'
7579

7680
- name: Teardown AWS infrastructure
7781
if: always()
@@ -129,14 +133,15 @@ jobs:
129133
stack_name: ${{ matrix.stack_name }}
130134

131135
- name: Run regional tests
132-
uses: ./.github/actions/s3-integration-run-aws
136+
uses: ./.github/actions/s3-integration-run
133137
with:
134138
access_key_id: ${{ matrix.use_esc_credentials && secrets.AWS_ESC_ACCESS_KEY_ID || secrets.AWS_ACCESS_KEY_ID }}
135139
secret_access_key: ${{ matrix.use_esc_credentials && secrets.AWS_ESC_SECRET_ACCESS_KEY || secrets.AWS_SECRET_ACCESS_KEY }}
136140
region_name: ${{ matrix.region_name }}
137141
stack_name: ${{ matrix.stack_name }}
138142
s3_endpoint_host: ${{ matrix.s3_endpoint_host }}
139143
label_filter: ${{ matrix.label_filter }}
144+
test_type: 'aws'
140145

141146
- name: Teardown AWS infrastructure
142147
if: always()

0 commit comments

Comments
 (0)