-
Notifications
You must be signed in to change notification settings - Fork 948
append mgmt test example in file testing.md #25682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
200513d
e126a04
6764b49
2f19fc9
85e9191
9c331d4
7a0c912
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,12 +1,12 @@ | ||||||||||
| # Testing SDKs | ||||||||||
|
|
||||||||||
| * [Write Tests](#write-tests) | ||||||||||
| * [Test Mode Options](#test-mode-options) | ||||||||||
| * [Routing Request to the Proxy](#routing-requests-to-the-proxy) | ||||||||||
| * [Writing Tests](#writing-tests) | ||||||||||
| * [Scrubbing Secrets](#scrubbing-secrets) | ||||||||||
| * [Live Test Resource Management](#live-test-resource-management) | ||||||||||
| * [Committing/Updating Recordings](#committingupdating-recordings) | ||||||||||
| * [Test Mode Options](#test-mode-options) | ||||||||||
| * [Routing Request to the Proxy](#routing-requests-to-the-proxy) | ||||||||||
| * [Writing Tests](#writing-tests) | ||||||||||
| * [Scrubbing Secrets](#scrubbing-secrets) | ||||||||||
| * [Live Test Resource Management](#live-test-resource-management) | ||||||||||
| * [Committing/Updating Recordings](#committingupdating-recordings) | ||||||||||
| * [Write Examples](#write-examples) | ||||||||||
|
|
||||||||||
| ## Write Tests | ||||||||||
|
|
@@ -94,6 +94,8 @@ NOTE: the path to the recordings **must** be in or under a directory named `test | |||||||||
|
|
||||||||||
| ### Writing Tests | ||||||||||
|
|
||||||||||
| #### example about `data plane` | ||||||||||
|
|
||||||||||
| A simple test for `aztables` is shown below: | ||||||||||
|
|
||||||||||
| ```go | ||||||||||
|
|
@@ -138,6 +140,149 @@ Check out the docs for more information about the methods available in the [`req | |||||||||
|
|
||||||||||
| If you set the environment variable `AZURE_RECORD_MODE` to "record" and run `go test` with this code and the proper environment variables this test would pass and you would be left with a new directory and file. Test recordings are saved to a `recording` directory in the same directory that your test code lives. Running the above test would also create a file `recording/TestCreateTable.json` with the HTTP interactions persisted on disk. Now you can set `AZURE_RECORD_MODE` to "playback" and run `go test` again, the test will have the same output but without reaching the service. | ||||||||||
|
|
||||||||||
| #### example about `management plane` | ||||||||||
jliusan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| A simple test for `armchaos` is shown below: | ||||||||||
| ##### The first step is to download prepared scripts to genrated asset.json in the path and create file utils_test.go | ||||||||||
jliusan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
JiaqiZhang-Dev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| 1. Run the following PowerShell commands to download necessary scripts: | ||||||||||
|
|
||||||||||
| ```ps | ||||||||||
|
||||||||||
| ```ps | |
| ```powershell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you adopt this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be assets.json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ``` | |
| asset.json | |
| `assets.json` | |
| ```json |
jliusan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make sure the indentation of code aligns with the data-plane example code
Uh oh!
There was an error while loading. Please reload this page.