-
Notifications
You must be signed in to change notification settings - Fork 14
166 lines (163 loc) · 6.21 KB
/
repo-checks-tests.yml
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# This workflow is executed during pull requests triggered by a user or by the GitHub dependabot.
# When created by the dependabot the access to the env variables is restricted, please see
# https://github.com/dependabot/dependabot-core/issues/3253 and
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
# To allow access to the secrets in both cases, the test users' passwords (or any other secret) are defined at the
# repository level and also at the `dependabot` secrets for now.
name: Repo Checks - Tests
on: [pull_request]
env:
PROJECT_NAME: aest-sims
BUILD_ID: ${{ github.event.number }}
POSTGRES_PASSWORD: bcgov!
BUILD_REF: ${{ github.base_ref }}
POSTGRES_DB: sims
POSTGRES_PORT: 5432
POSTGRES_USER: admin
DB_SCHEMA: sims
REDIS_PORT: 6379
REDIS_PASSWORD: redis
REDIS_STANDALONE_MODE: "true"
QUEUE_PREFIX: "{sims-local}"
CAMUNDA_OAUTH_DISABLED: true
CAMUNDA_SECURE_CONNECTION: false
CAMUNDA_PLATFORM_VERSION: 8.5.0
jobs:
api-e2e-tests:
name: SIMS API E2E Tests
runs-on: ubuntu-latest
env:
API_PORT: 3000
QUEUE_CONSUMERS_PORT: 3001
DISABLE_ORM_CACHE: "true"
IS_FULLTIME_ALLOWED: ${{ vars.IS_FULLTIME_ALLOWED }}
KEYCLOAK_REALM: ${{ vars.KEYCLOAK_REALM }}
KEYCLOAK_AUTH_URL: "https://dev.loginproxy.gov.bc.ca/auth/"
BCeID_WEB_SERVICE_WSDL: "https://gws1.test.bceid.ca/webservices/Client/V10/BCeIDService.asmx?wsdl"
E2E_TEST_STUDENT_USERNAME: student_e2e_test
E2E_TEST_STUDENT_PASSWORD: ${{ secrets.TEST_STUDENT_PASSWORD }}
E2E_TEST_AEST_BUSINESS_ADMINISTRATORS_USER: ministry-user-aest-business-administrators@e2e-tests
E2E_TEST_AEST_OPERATIONS_USER: ministry-user-aest-operations@e2e-tests
E2E_TEST_AEST_OPERATIONS_ADMINISTRATORS_USER: ministry-user-aest-operations-administrators@e2e-tests
E2E_TEST_AEST_MOF_OPERATIONS_USER: ministry-user-mof-operations@e2e-tests
E2E_TEST_AEST_READ_ONLY_USER: ministry-user-read-only@e2e-tests
E2E_TEST_PASSWORD: ${{ secrets.E2E_TEST_PASSWORD }}
steps:
# Checkout the PR branch.
- name: Checkout Target Branch
uses: actions/checkout@v4
# Generate the coverage report for API
- name: Run Tests
working-directory: "./sources/tests/"
run: |
make e2e-tests-api
- name: Tests Coverage
if: ${{ github.actor != 'dependabot[bot]' }}
uses: slavcodev/coverage-monitor-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
status_context: "E2E SIMS API Coverage Report"
comment_context: "E2E SIMS API Coverage Report"
coverage_path: "sources/tests/coverage/api/clover.xml"
threshold_alert: 1
threshold_warning: 50
threshold_metric: "lines"
comment_footer: false
workers-e2e-tests:
name: Workflow Workers E2E Tests
runs-on: ubuntu-latest
env:
WORKERS_PORT: 3020
DISABLE_ORM_CACHE: "true"
steps:
# Checkout the PR branch.
- name: Checkout Target Branch
uses: actions/checkout@v4
# Generate the coverage report for Workflow Workers
- name: Run Tests
working-directory: "./sources/tests/"
run: |
make e2e-tests-workers
- name: Tests Coverage
if: ${{ github.actor != 'dependabot[bot]' }}
uses: slavcodev/coverage-monitor-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
status_context: "E2E Workflow Workers Coverage Report"
comment_context: "E2E Workflow Workers Coverage Report"
coverage_path: "sources/tests/coverage/workers/clover.xml"
threshold_alert: 1
threshold_warning: 50
threshold_metric: "lines"
comment_footer: false
workflow-e2e-tests:
name: Workflow E2E Tests
runs-on: ubuntu-latest
steps:
# Checkout the PR branch.
- name: Checkout Target Branch
uses: actions/checkout@v4
# Run e2e tests for workflow.
- name: Run Tests
working-directory: "./sources/tests/"
run: |
make e2e-tests-workflow
queue-consumers-e2e-tests:
name: Queue Consumers E2E Tests
runs-on: ubuntu-latest
env:
QUEUE_CONSUMERS_PORT: 3001
DISABLE_ORM_CACHE: "true"
ESDC_REQUEST_FOLDER: MSFT-Request
ESDC_RESPONSE_FOLDER: MSFT-Response
ESDC_ENVIRONMENT_CODE: D
IS_FULLTIME_ALLOWED: ${{ vars.IS_FULLTIME_ALLOWED }}
steps:
# Checkout the PR branch.
- name: Checkout Target Branch
uses: actions/checkout@v4
# Generate the coverage report for Queue Consumers
- name: Run Tests
working-directory: "./sources/tests/"
run: |
make e2e-tests-queue-consumers
- name: Tests Coverage
if: ${{ github.actor != 'dependabot[bot]' }}
uses: slavcodev/coverage-monitor-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
status_context: "E2E Queue Consumers Coverage Report"
comment_context: "E2E Queue Consumers Coverage Report"
coverage_path: "sources/tests/coverage/queue-consumers/clover.xml"
threshold_alert: 1
threshold_warning: 50
threshold_metric: "lines"
comment_footer: false
backend-unit-tests:
name: Backend Unit Tests
runs-on: ubuntu-latest
steps:
# Checkout the PR branch.
- name: Checkout Target Branch
uses: actions/checkout@v4
- name: Setup Nodejs
uses: actions/setup-node@v4
with:
node-version: "18.x"
# Run units tests and generate the coverage report.
- name: Run Tests
working-directory: "./sources/tests/"
run: |
make backend-unit-tests
- name: Tests Coverage
if: ${{ github.actor != 'dependabot[bot]' }}
uses: slavcodev/coverage-monitor-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
status_context: "Backend Unit Tests Coverage Report"
comment_context: "Backend Unit Tests Coverage Report"
coverage_path: "sources/tests/coverage/unit-tests/clover.xml"
threshold_alert: 1
threshold_warning: 50
threshold_metric: "lines"
comment_footer: false