-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core-rest-pipeline] WWW-Authenticate challenge perf-stress test (#14659
) This PR is a draft of how the WWW-Authenticate perf-stress would look. **What this first performance test does:** This initial test only sets up a pipeline that does a service request against a fake server that answers once with a WWW-Authenticate challenge, and the next time with a 200. So, the first request will fail, we'll get a challenge, the challenge will be parsed and another request will be sent afterwards, which will succeed. To run the test, we call to: `npm run perf-test:node -- BearerTokenChallengeAuthenticationPolicyTest --warmup 1 --iterations 1 --parallel 5`. Here's how it looks when it runs: ``` === Calling globalSetup() once for (all) the instance(s) of BearerTokenChallengeAuthenticationPolicyTest === === warmup mode, iteration 1. Logs every 1s === Current Total Average === warmup mode, results of iteration 1 === Completed 55,001 operations in a weighted-average of 1.00s (55,015.93 ops/s, 0.000 s/op) === test mode, iteration 1. Logs every 1s === Current Total Average === test mode, results of iteration 1 === Completed 537,426 operations in a weighted-average of 10.00s (53,741.61 ops/s, 0.000 s/op) ``` **Background:** Java's perf-stress for challenges uses the ARM kind of challenges, but on TypeScript our more immediate customer is not ARM, but Container Registry and then Key Vault. This PR uses a copy of the challenge test we have in the main challenge PR: #13888 (this PR hasn't been merged, the plan is to have it merged by next week). Keep in mind that this PR won't pass CI until #13888 is merged. The idea with this PR is that, besides perf-stress testing a basic scenario, we can use it as the base for further perf-stress tests for core-rest-pipeline. Fixes #14633
- Loading branch information
Showing
9 changed files
with
332 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Release History | ||
|
||
## 1.0.0-beta.1 (Unreleased) | ||
|
||
- Added a first performance test that processes WWW-Authenticate challenges. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### Guide | ||
|
||
1. Build the core-rest-pipeline perf tests package `rush build -t perf-core-rest-pipeline`. | ||
3. Copy the `sample.env` file and name it as `.env`. | ||
4. Populate the `.env` file with your Azure Credentials. | ||
5. Refer to the [rate limits](https://docs.microsoft.com/azure/active-directory/enterprise-users/directory-service-limits-restrictions) and then run the tests as follows: | ||
|
||
- `bearerTokenChallengeAuthenticationPolicy` test for the `challengeCallbacks`, for simple `WWW-Authenticate` challenges. | ||
- `npm run perf-test:node -- BearerTokenChallengeAuthenticationPolicyTest --warmup 1 --iterations 1 --parallel 5` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"name": "@azure-tests/perf-core-rest-pipeline", | ||
"version": "1.0.0-beta.1", | ||
"description": "", | ||
"main": "", | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@azure/core-rest-pipeline": "1.1.0-beta.1", | ||
"@azure/core-auth": "^1.3.0", | ||
"@azure/test-utils-perfstress": "^1.0.0", | ||
"dotenv": "^8.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/uuid": "^8.0.0", | ||
"eslint": "^7.15.0", | ||
"prettier": "^1.16.4", | ||
"rimraf": "^3.0.0", | ||
"ts-node": "^9.0.0", | ||
"tslib": "^2.0.0", | ||
"typescript": "~4.2.0" | ||
}, | ||
"private": true, | ||
"scripts": { | ||
"perf-test:node": "ts-node test/index.spec.ts", | ||
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", | ||
"build": "tsc -p .", | ||
"build:samples": "echo skipped", | ||
"build:test": "echo skipped", | ||
"check-format": "prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", | ||
"clean": "rimraf dist dist-esm test-dist typings *.tgz *.log", | ||
"format": "prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", | ||
"integration-test:browser": "echo skipped", | ||
"integration-test:node": "echo skipped", | ||
"integration-test": "echo skipped", | ||
"lint:fix": "eslint --no-eslintrc -c ../../../.eslintrc.internal.json package.json test --ext .ts --fix --fix-type [problem,suggestion]", | ||
"lint": "eslint --no-eslintrc -c ../../../.eslintrc.internal.json package.json test --ext .ts", | ||
"pack": "npm pack 2>&1", | ||
"prebuild": "npm run clean", | ||
"unit-test:browser": "echo skipped", | ||
"unit-test:node": "echo skipped", | ||
"unit-test": "echo skipped", | ||
"test:browser": "echo skipped", | ||
"test:node": "echo skipped", | ||
"test": "echo skipped" | ||
} | ||
} |
Empty file.
Oops, something went wrong.