Repository navigation
143 lines (126 loc) · 4.9 KB
/
Copy pathreal-e2e.yml
File metadata and controls
143 lines (126 loc) · 4.9 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
138
139
140
141
142
143
name: Playwright Tests - Real APIs
on:
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
concurrency:
group: e2e_tests
cancel-in-progress: true
jobs:
run-tests:
runs-on: ubuntu-latest
environment: E2ETesting
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3]
shardTotal: [3]
env:
RGName : rg${{ github.run_id }}${{ github.run_attempt }}${{ matrix.shardIndex }}
steps:
- uses: actions/checkout@v5
- name: Azure login
uses: azure/login@v3
with:
client-id: ${{ secrets.AZURE_TESTING_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TESTING_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_TESTING_SUBSCRIPTION_ID }}
- name: Deploy Logic Apps For Testing
run: |
az group create -l westus --subscription ${{ secrets.AZURE_TESTING_SUBSCRIPTION_ID }} -n ${{ env.RGName }}
az deployment group create \
--resource-group ${{ env.RGName }} \
--subscription ${{ secrets.AZURE_TESTING_SUBSCRIPTION_ID }} \
--template-file ./e2e/testSetup/BlankLogicApp/logicAppStandard.bicep
- uses: pnpm/action-setup@v5
with:
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- name: Install Playwright Browsers
run: pnpm run e2e:setup
- name: Azure login
uses: azure/login@v3
with:
client-id: ${{ secrets.AZURE_TESTING_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TESTING_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_TESTING_SUBSCRIPTION_ID }}
- name: "extract AAD access token for Test Runs (valid for about an hour)"
run: |
export AZURE_MANAGEMENT_TOKEN=$(az account get-access-token --tenant ${{ secrets.AZURE_TESTING_TENANT_ID }} | jq -r .accessToken)
az account get-access-token --tenant ${{ secrets.AZURE_TESTING_TENANT_ID }} >> apps/Standalone/src/environments/jsonImport/armToken.json
echo "AZURE_MANAGEMENT_TOKEN=$AZURE_MANAGEMENT_TOKEN" >> $GITHUB_ENV
- name: Run Playwright tests
run: pnpm run test:e2e --grep @real --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
env:
AZURE_RESOURCE_GROUP: ${{env.RGName}}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_TESTING_SUBSCRIPTION_ID }}
AZURE_SITE_NAME: wapp-${{env.RGName}}
AZURE_MANAGEMENT_TOKEN: ${{ env.AZURE_MANAGEMENT_TOKEN }}
TEST_SHARDED: true
- name: Scrub Secrets From Trace
if: always()
run: pnpm run scrub-secrets:e2e
- name: Azure login
uses: azure/login@v3
if: always()
with:
client-id: ${{ secrets.AZURE_TESTING_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TESTING_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_TESTING_SUBSCRIPTION_ID }}
- name: Delete Resoruce Group
shell: bash
if: always()
run: |
az group delete -n ${{env.RGName}} --yes --no-wait
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v6
with:
name: blob-report-${{ matrix.shardIndex }}
path: blob-report
retention-days: 1
merge-reports:
# Merge reports after playwright-tests, even if some shards have failed
if: ${{ !cancelled() }}
needs: [run-tests]
runs-on: ubuntu-latest
environment: E2ETesting
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 24
package-manager-cache: false
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v7
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
- name: Azure login
uses: azure/login@v3
if: always()
with:
client-id: ${{ secrets.AZURE_TESTING_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TESTING_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_TESTING_SUBSCRIPTION_ID }}
- name: "Upload Playwright Report to Azure Blob Storage for static site access"
shell: bash
if: always()
run: |
REPORT_DIR='run-${{ github.run_id }}-${{ github.run_attempt }}'
az storage blob upload-batch --account-name lauxtestreport --auth-mode key -d "\$web/$REPORT_DIR" -s "./playwright-report"
echo "::notice title=HTML report url::https://lauxtestreport.z13.web.core.windows.net/$REPORT_DIR/index.html"
- name: Upload HTML report
uses: actions/upload-artifact@v6
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14