-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Quantum CLI Extension Live E2E Client Validation Tests (#3943)
* Add Quantum CLI extension tests.live files * Delete commented-out code * Add azdev setup * Fix azdev setup path params * Add Set-Location in Run.ps1 * Omit --cli param for azdev setup * Use environment variable for Subscription ID * Update environment variable names * Update 'Running locally' instructions in README.md * Skip test if provider not in AZURE_QUANTUM_CAPABILITIES * Convert capabilities string to lowercase * Use --xml-path param to save test output with the recordings * Handle multiple providers in capabilities logic * Test re-run * Test re-run, Take 2 * Remove test_results.xml
- Loading branch information
Warren Jones
authored
Oct 21, 2021
1 parent
5f4a94f
commit f61c5ab
Showing
4 changed files
with
75 additions
and
19 deletions.
There are no files selected for viewing
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
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,18 @@ | ||
# Quantum CLI Extension Live tests | ||
|
||
This folder contains Run.ps1, a script the will run all of the live tests for the Quantum CLI Extension. Live tests are end-to-end tests that require an actual connection with Azure Quantum | ||
to complete successfully. | ||
|
||
|
||
## Running locally | ||
|
||
1. Set the following environment variable to the Subscription ID of the "QuArC Internal Consumption" subscription: | ||
* `$Env:AZURE_QUANTUM_SUBSCRIPTION_ID = "[Subscription ID]"` | ||
|
||
2. Login to Azure using either: | ||
* the [Azure Account extension in VS Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account) | ||
* `az login` from the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/) | ||
|
||
3. Make this folder your current directory location: src\quantum\tests.live | ||
|
||
4. Use [`.\Run.ps1 -SkipInstall`](.\Run.ps1) to run all the tests. |
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,21 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
param ( | ||
[Parameter()] | ||
[switch] | ||
$SkipInstall=$False | ||
) | ||
|
||
# For debug, print all relevant environment variables: | ||
Get-ChildItem env:AZURE*, env:*VERSION, env:*OUTDIR | Format-Table | Out-String | Write-Host | ||
|
||
# Run the Quantum CLI Extension tests in an azdev environment | ||
Set-Location ../../.. | ||
python -m venv env | ||
env\Scripts\activate.ps1 | ||
python -m pip install -U pip | ||
pip install azdev | ||
azdev setup --repo . | ||
azdev extension add quantum | ||
az account set -s $Env:AZURE_QUANTUM_SUBSCRIPTION_ID | ||
azdev test quantum --live --verbose --xml-path src\quantum\azext_quantum\tests\latest\recordings |