Skip to content
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

[Mgmt confidential ledger] Migrate recordings to asset repo #35186

Merged
merged 1 commit into from
May 31, 2023

Conversation

samvaity
Copy link
Member

This PR migrates the test recordings using test proxy for azure-resourcemanager-confidentialledger SDK to the assets repo.

Migrate recordings from language repositories to assets repo

Prerequisites:

  • The script generate-assets-json.ps1 will execute the initial migration of your recordings from within a language repo to the assets repo as well as creating the assets.json file for those assets.

  • Test-proxy needs to be on the machine and in the path. Instructions for that are here.

Running the script:

The script needs to be executed inside an sdk/ or deeper and from within an up-to-date language repository. A good rule here would be look at where the ci.yml is for a service directory. In the case where each library for a given service directory has its own pipelines, at the sdk// level, it is recommended that the assets.json is created there. If the ci.yml exists deeper than the sdk// level, then it is recommended to run the script from that directory.

C:/repo/sdk-for-java/sdk/formrecognizer/azure-ai-formrecognizer> ..\..\..\eng\common\testproxy\transition-scripts\generate-assets-json.ps1 -InitialPush

Examples of current assets.json locations:

After running a script, executing a git status from within the language repo, where the script was invoked from, will reflect two primary results:

  • A new assets.json will be present in the directory from which they invoked the transition script.
  • A bunch of deleted files from where their recordings were before they were pushed to the assets repo.

Running the script without the -InitialPush option will just create the assets.json with an empty tag. No data movement.

Using test proxy going forward:

https://github.com/Azure/azure-sdk-for-java/wiki/Test-Proxy-Migration#3-using-test-proxy-going-forward

C:\repo\azure-sdk-for-java.assets\tag-ref\java\sdk\storage\azure-storage-queue\src\test\resources\session-records\QueueServiceAsyncApiTests.listQueues[3].json
locally is where you should find your local copy of recordings.

@haolingdong-msft
Copy link
Member

haolingdong-msft commented May 31, 2023

Thanks @samvaity! I would like to clarify below questions:

  1. generate-assets-json.ps1: is this script always run locally? Do we need to run the script locally every time when we update api-version and do recording?
  2. To update the recordings in asset repo, do we need to create pr to asset repo manually?

@samvaity
Copy link
Member Author

Thanks @samvaity! I would like to clarify below questions:

  1. generate-assets-json.ps1: is this script always run locally? Do we need to run the script locally every time we do recording?

No, generate-assets-json.ps1 is only to be run if the assets file is not already present i.e only for the first time when migrating recordings out of the main repo.

  1. To update the recordings in asset repo, do we need to create pr to asset repo manually?
    No, you don't need to deal with the assets repo manually.
    To update the recordings you need to use the test-proxy push command.
    Details about that are here: https://github.com/Azure/azure-sdk-for-java/wiki/Test-Proxy-Migration#running-tests-in-record-mode
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants