Skip to content

Commit ae4f35f

Browse files
authored
test: assert blue/green switchover calls resume and are routed (#1370)
1 parent 61234bb commit ae4f35f

13 files changed

Lines changed: 1212 additions & 112 deletions
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Blue/Green Integration Tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths-ignore:
9+
- '**/*.md'
10+
- '**/*.jpg'
11+
- '**/README.txt'
12+
- '**/LICENSE.txt'
13+
- 'docs/**'
14+
- 'ISSUE_TEMPLATE/**'
15+
- '**/remove-old-artifacts.yml'
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: false
20+
21+
permissions:
22+
id-token: write # This is required for requesting the JWT
23+
contents: read # This is required for actions/checkout
24+
25+
jobs:
26+
blue-green-integration-tests:
27+
name: Run Blue/Green Integration Tests
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 120
30+
strategy:
31+
fail-fast: false
32+
max-parallel: 2
33+
matrix:
34+
task: [ "mysql-aurora-sync", "mysql-aurora-async", "pg-aurora-sync", "pg-aurora-async" ]
35+
36+
steps:
37+
- name: 'Clone repository'
38+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
39+
40+
- name: 'Set up JDK 8'
41+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
42+
with:
43+
distribution: 'corretto'
44+
java-version: 8
45+
46+
- name: Install poetry
47+
shell: bash
48+
run: |
49+
pipx install poetry==1.8.2
50+
poetry config virtualenvs.prefer-active-python true
51+
52+
- name: Install dependencies
53+
run: poetry install
54+
55+
- name: 'Configure AWS Credentials'
56+
uses: aws-actions/configure-aws-credentials@d979d5b3a71173a29b74b5b88418bfda9437d885 # v6
57+
with:
58+
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_DEPLOY_ROLE }}
59+
role-session-name: python_bg_integration_tests
60+
role-duration-seconds: 21600
61+
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
62+
63+
- name: 'Run Blue/Green Integration Tests'
64+
run: |
65+
./gradlew --no-parallel --no-daemon test-bgd-${{ matrix.task }} --info
66+
env:
67+
RDS_DB_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
68+
MYSQL_VERSION: default
69+
PG_VERSION: default
70+
71+
- name: 'Archive Blue/Green results'
72+
if: always()
73+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
74+
with:
75+
name: pytest-integration-report-bgd-${{ matrix.task }}
76+
path: ./tests/integration/container/reports
77+
retention-days: 5

‎aws_advanced_python_wrapper/aio/blue_green_plugin.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ async def _open_connection_task(self) -> None:
961961
ip_host_info = copy(host_info)
962962
ip_host_info.host = ip_address
963963
props_copy = copy(self._props)
964-
WrapperProperties.IAM_HOST.set(props_copy, ip_host_info.host)
964+
WrapperProperties.IAM_HOST.set(props_copy, host_info.host)
965965

966966
logger.debug("BlueGreenStatusMonitor.OpeningConnectionWithIp", self._bg_role, ip_host_info.host)
967967
self._connection = await self._plugin_service.force_connect(ip_host_info, props_copy)

‎aws_advanced_python_wrapper/blue_green_plugin.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ def _open_connection_task(self):
953953
ip_host_info = copy(host_info)
954954
ip_host_info.host = ip_address
955955
props_copy = copy(self._props)
956-
WrapperProperties.IAM_HOST.set(props_copy, ip_host_info.host)
956+
WrapperProperties.IAM_HOST.set(props_copy, host_info.host)
957957

958958
logger.debug(
959959
"BlueGreenStatusMonitor.OpeningConnectionWithIp", self._bg_role, ip_host_info.host)

0 commit comments

Comments
 (0)