Skip to content

Commit 76d7a67

Browse files
committed
update github workflow
1 parent 450a570 commit 76d7a67

File tree

711 files changed

+2052
-586
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

711 files changed

+2052
-586
lines changed

.github/workflows/contoso-traders-cloud-testing.yml

Lines changed: 597 additions & 586 deletions
Large diffs are not rendered by default.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
displayName: Contoso Traders
2+
testPlan: contoso-traders-locust.py
3+
description: ''
4+
engineInstances: 3
5+
testId: 4e812758-7552-4d1e-a6e7-ae0c2d322076
6+
testType: Locust
7+
splitAllCSVs: False
8+
regionalLoadTestConfig:
9+
- region: eastus2
10+
engineInstances: 1
11+
- region: westus2
12+
engineInstances: 1
13+
- region: centralus
14+
engineInstances: 1
15+
failureCriteria: []
16+
env:
17+
- name: LOCUST_USERS
18+
value: 500
19+
- name: LOCUST_RUN_TIME
20+
value: 600
21+
- name: LOCUST_SPAWN_RATE
22+
value: 4
23+
autoStop:
24+
errorPercentage: 90
25+
timeWindow: 60
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from locust import task, run_single_user
2+
from locust import FastHttpUser
3+
4+
5+
class myrecording(FastHttpUser):
6+
host = "https://contoso-traders-ui2altig.azureedge.net"
7+
@task
8+
def t(self):
9+
with self.client.request(
10+
"GET",
11+
"/",
12+
catch_response=True,
13+
name="Home Page"
14+
) as resp:
15+
pass
16+
with self.rest(
17+
"GET",
18+
"https://contoso-traders-productsaltig.eastus2.cloudapp.azure.com/v1/products/?type=all-products",
19+
headers={
20+
"accept": "application/json, text/plain, */*",
21+
},
22+
name="All Products"
23+
) as resp:
24+
pass
25+
with self.rest(
26+
"GET",
27+
"https://contoso-traders-productsaltig.eastus2.cloudapp.azure.com/v1/Products/search/xbox",
28+
headers={
29+
"accept": "application/json, text/plain, */*",
30+
},
31+
name="Search Xbox"
32+
) as resp:
33+
pass
34+
with self.rest(
35+
"GET",
36+
"https://contoso-traders-productsaltig.eastus2.cloudapp.azure.com/v1/products/5",
37+
headers={
38+
"accept": "application/json, text/plain, */*",
39+
},
40+
name="Product Details"
41+
) as resp:
42+
pass
43+
44+
if __name__ == "__main__":
45+
run_single_user(myrecording)

demo-scripts/mpt-samples/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PLAYWRIGHT_SERVICE_URL=wss://eastus.api.playwright.microsoft.com/accounts/eastus_c15a9b33-9bbe-484c-a737-a501d9272a07/browsers
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# TODO: Place this file in the .github/workflows folder of your repository
2+
# This sample assumes the working directory is ./samples/get-started
3+
name: playwright-service-tests
4+
on:
5+
push:
6+
branches: [ main, master ]
7+
pull_request:
8+
branches: [ main, master ]
9+
workflow_dispatch:
10+
jobs:
11+
test:
12+
timeout-minutes: 60
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 16
19+
- name: Install dependencies
20+
working-directory: sample/
21+
run: npm ci
22+
- name: Run Playwright tests
23+
working-directory: sample/
24+
env:
25+
PLAYWRIGHT_SERVICE_ACCESS_TOKEN: ${{secrets.PLAYWRIGHT_SERVICE_ACCESS_TOKEN}}
26+
PLAYWRIGHT_SERVICE_URL: ${{ secrets.PLAYWRIGHT_SERVICE_URL }}
27+
PLAYWRIGHT_SERVICE_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }}
28+
run: npx playwright test -c playwright.service.config.ts --workers=30
29+
- uses: actions/upload-artifact@v3
30+
if: always()
31+
with:
32+
name: playwright-report
33+
path: samples/get-started/playwright-report/
34+
retention-days: 10

0 commit comments

Comments
 (0)