-
Notifications
You must be signed in to change notification settings - Fork 2
137 lines (126 loc) · 5.24 KB
/
integration-test.yaml
File metadata and controls
137 lines (126 loc) · 5.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Integration test
permissions: {}
on:
pull_request:
merge_group:
jobs:
integration-test:
runs-on: ubuntu-latest
permissions:
packages: read
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version-file: .nvmrc
- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run install-all
- name: Configure frontend environment
run: |
cd solutions/frontend
cat > .env.integration-tests << 'EOF'
ENVIRONMENT=local
NODE_ENV=production
USE_LOCALSTACK=1
SESSIONS_SIGNER=localsessionsignerwhichmustbeatleast32chars
SESSIONS_TABLE_NAME=amc-SessionStore
ROOT_DOMAIN=localhost
ROOT_DOMAIN_WITH_ENV=localhost
AWS_REGION=eu-west-2
LOCALSTACK_ENDPOINT=http://localhost:4566
LOCAL_KMS_ENDPOINT=http://localhost:4567
LOCALSTACK_ACCESS_KEY_ID=test
LOCALSTACK_ACCESS_KEY=test
AUTHORIZE_ENDPOINT_URL=http://localhost:6002/authorize
AUTH_CODE_TABLE_NAME=amc-AuthCode
JOURNEY_OUTCOME_TABLE_NAME=amc-JourneyOutcome
AUTH_FRONTEND_URL=https://signin.account.gov.uk
ACCOUNT_DATA_API_URL=http://localhost:6003/account-data-api
ANALYTICS_COOKIE_DOMAIN=localhost
PASSKEYS_RP_ID=localhost
PASSKEYS_RP_NAME="GOV.UK One Login (local)"
PASSKEYS_EXPECTED_ORIGIN=http://localhost:6002
ACCOUNT_MANAGEMENT_API_URL=http://localhost:6003/account-management-api
GA4_CONTAINER_ID=GTM-KD86CMZ
ANALYTICS_ENABLED=1
YOUR_SERVICES_URL=https://home.dev.account.gov.uk/your-services
SECURITY_URL=https://home.dev.account.gov.uk/security
CONTACT_URL=https://home.dev.account.gov.uk/contact-gov-uk-one-login
JAR_RSA_ENCRYPTION_KEY_ALIAS=alias/amc-JARRSAEncryptionKey
REPLAY_ATTACK_TABLE_NAME=amc-ReplayAttack
NOTIFICATIONS_QUEUE_URL=http://sqs.eu-west-2.localhost.localstack.cloud:4566/000000000000/amc-NotificationsQueue
AUDIT_EVENTS_QUEUE_URL=http://sqs.eu-west-2.localhost.localstack.cloud:4566/000000000000/amc-TxMASQSProducerAuditEventQueue
EOF
- name: Configure stubs environment
run: |
cd solutions/stubs
cat > .env.integration-tests << 'EOF'
ENVIRONMENT=local
NODE_ENV=production
USE_LOCALSTACK=1
MOCK_CLIENT_EC_PRIVATE_KEY_SSM_NAME=/amc/MockClientEcPrivateKey
MOCK_CLIENT_EC_PUBLIC_KEY_SSM_NAME=/amc/MockClientEcPublicKey
MOCK_CLIENT_RSA_PRIVATE_KEY_SSM_NAME=/amc/MockClientRsaPrivateKey
MOCK_CLIENT_RSA_PUBLIC_KEY_SSM_NAME=/amc/MockClientRsaPublicKey
JAR_RSA_ENCRYPTION_KEY_ALIAS=alias/amc-JARRSAEncryptionKey
DEFAULT_AUDIENCE=http://localhost:6002/authorize
API_BASE_URL=http://localhost:6004
ACCESS_TOKEN_ISSUER=http://localhost:6003
AUTHORIZE_URL=http://localhost:6002/authorize
AWS_REGION=eu-west-2
LOCALSTACK_ENDPOINT=http://localhost:4566
LOCAL_KMS_ENDPOINT=http://localhost:4567
LOCALSTACK_ACCESS_KEY_ID=test
LOCALSTACK_ACCESS_KEY=test
ROOT_DOMAIN=localhost
EOF
- name: Configure API environment
run: |
cd solutions/api
cat > env.integration-tests.json << 'EOF'
{
"Parameters": {
"NODE_OPTIONS": "--enable-source-maps",
"ENVIRONMENT": "local",
"NODE_ENV": "production",
"USE_LOCALSTACK": "1",
"LOCALSTACK_ENDPOINT": "http://account-components-localstack:4566",
"LOCAL_KMS_ENDPOINT": "http://account-components-local-kms:8080",
"LOCALSTACK_ACCESS_KEY_ID": "test",
"LOCALSTACK_ACCESS_KEY": "test"
},
"ApiTokenLambda": {
"AUTH_TABLE_NAME": "amc-AuthCode",
"REPLAY_ATTACK_TABLE_NAME": "amc-ReplayAttack",
"JWT_SIGNING_KEY_ALIAS": "alias/amc-JWTSigningKey"
},
"ApiJourneyOutcomeLambda": {
"JWT_SIGNING_KEY_ALIAS": "alias/amc-JWTSigningKey",
"JOURNEY_OUTCOME_TABLE_NAME": "amc-JourneyOutcome"
}
}
EOF
- name: Run integration tests
run: |
cd solutions/integration-tests
touch .env
echo "PRE_OR_POST_DEPLOY=pre" >> .env
echo "PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:3000/" >> .env
npm run test
- name: Upload test results artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
if: always()
with:
name: integration-test-results
path: solutions/integration-tests/test-results/
retention-days: 7