Skip to content

fix: replacing the default e2e workspace and fixing e2e tests#8808

Merged
necusjz merged 1 commit intoAzure:mainfrom
kikomiss:users/kikomiss/fix/quantum-e2e-tests
May 29, 2025
Merged

fix: replacing the default e2e workspace and fixing e2e tests#8808
necusjz merged 1 commit intoAzure:mainfrom
kikomiss:users/kikomiss/fix/quantum-e2e-tests

Conversation

@kikomiss
Copy link
Copy Markdown
Contributor


Only fixes for unit and E2E tests. No extension release required.

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az quantum

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings May 28, 2025 23:41
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented May 28, 2025

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @kikomiss,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 28, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issues with the default e2e workspace settings and updates e2e test behavior. Key changes include updating default workspace and storage names, modifying workspace creation commands to include the "--auto-accept" flag, and adjusting assertions in job submission tests while cleaning up outdated recording files.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/quantum/tests.live/Run.ps1 Updated SAS token redaction regex to remove the trailing capture group.
src/quantum/azext_quantum/tests/latest/utils.py Revised default subscription, workspace, and storage values.
src/quantum/azext_quantum/tests/latest/test_quantum_workspace.py Added "--auto-accept" flag in workspace creation commands and introduced a fixed sleep interval.
src/quantum/azext_quantum/tests/latest/test_quantum_targets.py Added the "--auto-accept" flag in workspace creation commands.
src/quantum/azext_quantum/tests/latest/test_quantum_jobs.py Updated job submission tests and assertions to reflect redacted URIs.
Various recordings files Removed outdated error recording files to align with current test behavior.
src/quantum/azext_quantum/tests/latest/recordings/* Updated recorded response values (dates, user-agent, etc.) to reflect new test environments.
Comments suppressed due to low confidence (1)

src/quantum/tests.live/Run.ps1:24

  • The updated regex no longer preserves the trailing delimiter (e.g., '&' or end-of-line) that was captured before. Please verify that this change does not unintentionally alter the URL structure when additional query parameters exist.
(Get-Content $PathToRecording) -replace 'sig=[\w%]+','sig=REDACTED' | Set-Content $PathToRecording

self.check("name", test_workspace_temp)
])

time.sleep(10) # Wait for the workspace to be created before fetching quotas
Copy link

Copilot AI May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a fixed sleep interval may lead to flakiness in tests; consider replacing it with a polling mechanism that waits until the workspace is confirmed to be ready.

Suggested change
time.sleep(10) # Wait for the workspace to be created before fetching quotas
# Poll until the workspace is ready or timeout occurs
timeout = 60 # Maximum wait time in seconds
interval = 5 # Polling interval in seconds
elapsed_time = 0
while elapsed_time < timeout:
workspace_status = self.cmd(f'az quantum workspace show -g {test_resource_group} -w {test_workspace_temp} -o json').get_output_in_json()
if workspace_status.get("properties", {}).get("provisioningState") == "Succeeded":
break
time.sleep(interval)
elapsed_time += interval
else:
raise TimeoutError(f"Workspace '{test_workspace_temp}' did not become ready within {timeout} seconds.")

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

Hi @kikomiss

Release Suggestions

Module: quantum

  • Please log updates into to src/quantum/HISTORY.rst
  • Update VERSION to 1.0.0b7 in src/quantum/setup.py

Notes

@necusjz necusjz merged commit 6e3e3ef into Azure:main May 29, 2025
38 checks passed
@kikomiss kikomiss deleted the users/kikomiss/fix/quantum-e2e-tests branch May 29, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Quantum az quantum

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants