Skip to content

Commit 2548e26

Browse files
committed
feat(test): FTRS-1542 Combine automated apim tests into main automated tests
1 parent 2e2bd74 commit 2548e26

File tree

5 files changed

+26
-222
lines changed

5 files changed

+26
-222
lines changed

.github/actions/service-automation-apim-test/action.yaml

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

.github/actions/service-automation-test/action.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ inputs:
2323
ref:
2424
description: "The branch, tag or SHA to build and deploy from"
2525
required: false
26+
api_name:
27+
description: "API name for APIM proxy generation, required if test_type is apim"
28+
required: false
29+
apim_env:
30+
description: "APIM environment for proxy generation, required if test_type is apim"
31+
required: false
32+
2633

2734
runs:
2835
using: "composite"
@@ -38,6 +45,8 @@ runs:
3845
TEST_TYPE: ${{ inputs.test_type }}
3946
COMMIT_HASH: ${{ inputs.commit_hash }}
4047
REF: ${{ inputs.ref }}
48+
API_NAME: ${{ inputs.api_name }}
49+
APIM_ENV: ${{ inputs.apim_env }}
4150
run: |
4251
set -euo pipefail
4352
/bin/bash ./scripts/workflow/service-automation-tests.sh

.github/workflows/pipeline-deploy-application.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,9 @@ jobs:
323323
type: "api"
324324
- tag: "data-migration"
325325
type: "data-migration"
326-
- tag: "apim-dos-search"
326+
- tag: "is-apim"
327327
type: "apim"
328328
api_name: "dos-search"
329-
apim_env: ""
330329
needs:
331330
- metadata
332331
- deploy-application-infrastructure
@@ -352,7 +351,6 @@ jobs:
352351
test_tag: ${{ matrix.tag }}
353352
test_type: ${{ matrix.type }}
354353
api_name: ${{ matrix.api_name || '' }}
355-
apim_env: ${{ matrix.type == 'apim' && (needs.metadata.outputs.environment == 'dev' && 'internal-dev' || needs.metadata.outputs.environment == 'test' && 'internal-qa' || needs.metadata.outputs.environment) || '' }}
356354
type: app
357355
deployment_type: "development"
358356
secrets: inherit

.github/workflows/service-automation-apim-test.yaml

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

.github/workflows/service-automation-test.yaml

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,22 @@ jobs:
167167
run: make install
168168
working-directory: "tests/service_automation"
169169

170-
- name: Install Python dependencies for JWT
171-
if: inputs.test_type == 'apim'
172-
shell: bash
173-
run: |
174-
set -euo pipefail
175-
python -m pip install --upgrade pip
176-
pip install pyjwt cryptography
170+
- name: Authenticate with APIM
171+
uses: ./.github/actions/authenticate-apim
172+
id: apim-auth
173+
with:
174+
api_name: ${{ inputs.api_name }}
175+
environment: ${{ inputs.environment }}
176+
aws_region: ${{ vars.AWS_REGION }}
177+
178+
- name: Get Apigee access token
179+
uses: ./.github/actions/authenticate-apim-pytest
180+
with:
181+
api_name: ${{ inputs.api_name }}
182+
access_token: ${{ steps.apim-auth.outputs.access_token }}
183+
proxygen_base_url: ${{ secrets.PROXYGEN_URL }}
177184

178185
- name: Run ${{ inputs.test_tag }} service automation tests
179-
if: inputs.test_type != 'apim'
180186
id: run-service_automation-tests
181187
uses: ./.github/actions/service-automation-test
182188
with:
@@ -185,24 +191,11 @@ jobs:
185191
workspace: ${{ inputs.workspace }}
186192
test_tag: ${{ inputs.test_tag }}
187193
test_type: ${{ inputs.test_type }}
194+
api_name: ${{ inputs.api_name }}
195+
apim_env: ${{ inputs.environment == 'dev' && 'internal-dev' || inputs.environment == 'test' && 'internal-qa' || inputs.environment }}
188196
commit_hash: ${{ inputs.commit_hash || github.sha }}
189197
ref: ${{ inputs.ref }}
190198

191-
- name: Run APIM service automation tests
192-
if: inputs.test_type == 'apim'
193-
id: run-service_automation-apim-tests
194-
uses: ./.github/actions/service-automation-apim-test
195-
env:
196-
PROXYGEN_URL: ${{ secrets.PROXYGEN_URL }}
197-
with:
198-
aws_region: ${{ vars.AWS_REGION }}
199-
environment: ${{ inputs.environment }}
200-
workspace: ${{ inputs.workspace }}
201-
api_name: ${{ inputs.api_name }}
202-
apim_env: ${{ inputs.apim_env }}
203-
commit_hash: ${{ inputs.commit_hash }}
204-
tag: ${{ inputs.tag }}
205-
206199
- name: Upload allure report
207200
if: always()
208201
id: upload_allure_report

0 commit comments

Comments
 (0)