-
Notifications
You must be signed in to change notification settings - Fork 1.1k
168 lines (148 loc) · 5.97 KB
/
run-test-manual.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
167
168
name: Run test manually
on: [workflow_dispatch]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
initialize-cloud:
runs-on: ubuntu-22.04
outputs:
POOL_NAME: ${{ steps.pool_variables.outputs.POOL_NAME }}
POOL_INSTANCE: ${{ steps.pool_variables.outputs.POOL_INSTANCE }}
BASE_URL: ${{ steps.cloud_variables.outputs.BASE_URL }}
API_URL: ${{ steps.cloud_variables.outputs.API_URL }}
BACKUP_ID: ${{ steps.cloud_variables.outputs.BACKUP_ID }}
BACKUP_VER: ${{ steps.cloud_variables.outputs.BACKUP_VER }}
BACKUP_NAME: ${{ steps.cloud_variables.outputs.BACKUP_NAME }}
ACCOUNTS: ${{ steps.accounts.outputs.ACCOUNTS }}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-qa-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-qa-${{ env.cache-name }}-
${{ runner.os }}-qa-
${{ runner.os }}-
- name: Install deps
run: npm ci
- name: Set variables mode
id: set_variables_mode
shell: bash
run: |
if [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
echo "MODE=main" >> $GITHUB_OUTPUT
else
echo "MODE=release" >> $GITHUB_OUTPUT
fi
- name: Generate variables
id: cloud_variables
uses: ./.github/actions/prepare-tests-variables
with:
CLI_TOKEN: ${{ secrets.STAGING_TOKEN }}
MODE: ${{ steps.set_variables_mode.outputs.MODE }}
- name: Prepare instances
id: pool_variables
uses: ./.github/actions/prepare-instance
with:
STRATEGY: reload
CLI_TOKEN: ${{ secrets.STAGING_TOKEN }}
BASE_URL: ${{ steps.cloud_variables.outputs.BASE_URL }}
API_URL: ${{ steps.cloud_variables.outputs.API_URL }}
POOL_NAME: ${{ steps.cloud_variables.outputs.POOL_NAME }}
POOL_INSTANCE: ${{ steps.cloud_variables.outputs.POOL_INSTANCE }}
BACKUP_ID: ${{ steps.cloud_variables.outputs.BACKUP_ID }}
- name: Prepare accounts
id: accounts
uses: ./.github/actions/prepare-accounts
with:
BASE_URL: ${{ steps.cloud_variables.outputs.BASE_URL }}
API_URL: ${{ steps.cloud_variables.outputs.API_URL }}
E2E_USER_NAME: ${{ secrets.E2E_USER_NAME }}
E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
E2E_ENCODE_PASS: ${{ secrets.E2E_ENCODE_PASS }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }}
create-run-on-testmo:
runs-on: ubuntu-22.04
needs: initialize-cloud
outputs:
testmo-run-id: ${{ steps.init-testmo.outputs.testmo-run-id }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/testmo/testmo-init
with:
testmoUrl: ${{ secrets.TESTMO_URL }}
testmoToken: ${{ secrets.TESTMO_TOKEN }}
testmoRunName: "Playwright run ${{github.ref_name}}"
id: init-testmo
run-tests:
runs-on: ubuntu-22.04
needs: ["initialize-cloud", "create-run-on-testmo"]
strategy:
fail-fast: false
matrix:
shard: [1/2, 2/2]
steps:
- uses: actions/checkout@v4
- name: Run playwright tests
uses: ./.github/actions/run-pw-tests
with:
SHARD: ${{ matrix.shard }}
BASE_URL: ${{ needs.initialize-cloud.outputs.BASE_URL }}
API_URL: ${{ needs.initialize-cloud.outputs.API_URL }}
E2E_USER_NAME: ${{ secrets.E2E_USER_NAME }}
E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }}
E2E_ENCODE_PASS: ${{ secrets.E2E_ENCODE_PASS }}
ACCOUNTS: ${{ needs.initialize-cloud.outputs.ACCOUNTS }}
MAILPITURL: ${{ secrets.MAILPITURL }}
PW_WORKERS: ${{ vars.PW_WORKERS }}
PW_RETRIES: ${{ vars.PW_RETRIES }}
URL_TO_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
PROJECT: "e2e apps-e2e"
- name: submit-results-to-testmo
if: always()
uses: ./.github/actions/testmo/testmo-threads-submit-playwright
with:
testmoUrl: ${{ secrets.TESTMO_URL }}
testmoToken: ${{ secrets.TESTMO_TOKEN }}
testmoRunId: ${{ needs.create-run-on-testmo.outputs.testmo-run-id }}
tests-complete:
if: '!cancelled()'
needs: ["initialize-cloud", "run-tests", "create-run-on-testmo"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Merge playwright reports
uses: ./.github/actions/merge-pw-reports
- name: complete testmo report
uses: ./.github/actions/testmo/testmo-finish
with:
testmoUrl: ${{ secrets.TESTMO_URL }}
testmoToken: ${{ secrets.TESTMO_TOKEN }}
testmoRunId: ${{ needs.create-run-on-testmo.outputs.testmo-run-id }}
- name: send message on slack
working-directory: ".github"
env:
run_id: ${{ needs.create-run-on-testmo.outputs.testmo-run-id }}
url_to_action: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
testmo_token: ${{ secrets.TESTMO_TOKEN }}
environment: ${{ needs.initialize-cloud.outputs.BASE_URL }}
slack_webhook_url: ${{ secrets.SLACK_QA_STATUSES_WEBHOOK_URL }}
ref_name: ${{github.ref_name}}
run: |
node workflows/postTestsResults.js \
--run_id "$run_id" \
--testmo_token "$testmo_token" \
--slack_webhook_url "$slack_webhook_url" \
--environment "$environment" \
--url_to_action "$url_to_action" \
--ref_name "$ref_name"