Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Conversation

@rmshaffer
Copy link
Contributor

@rmshaffer rmshaffer commented Jun 12, 2020

This PR contains end-to-end integration tests in C# and Python for IQ# Azure functionality. To avoid a dependency on the Azure service, mock classes MockAzureWorkspace, MockCloudJob, and MockQuantumMachine are added, which provide a fake implementation of all of the Azure-related functionality. When the environment variable AZURE_QUANTUM_ENV is set to mock, IQ# will use these mock classes rather than the real implementations.

The C# and Python tests set this environment variable. The C# tests validate the end-to-end functionality by making calls directly to the AzureClient object. The Python tests are even more comprehensive because they also include the magic command parsing code, which then in turn calls the AzureClient object.

Also as part of these changes, the Python API for Azure functionality is defined more explicitly, including specific types returned for each qsharp.azure method, and the AzureClient implementation is updated to always return the expected type.

Fixes AB#13627, fixes AB#15165.

@rmshaffer rmshaffer changed the title Mock AzureEnvironment and end-to-end tests Mock AzureEnvironment and end-to-end C# and Python tests Jun 12, 2020
@rmshaffer rmshaffer changed the title Mock AzureEnvironment and end-to-end C# and Python tests Python API, mock Azure classes, and end-to-end C# and Python tests Jun 15, 2020
@rmshaffer rmshaffer changed the title Python API, mock Azure classes, and end-to-end C# and Python tests Mock Azure classes, qsharp.azure Python API and end-to-end C# and Python tests Jun 15, 2020
@rmshaffer rmshaffer changed the title Mock Azure classes, qsharp.azure Python API and end-to-end C# and Python tests Add mock Azure classes, improve qsharp.azure Python API, implement end-to-end C# and Python tests Jun 15, 2020
@rmshaffer rmshaffer marked this pull request as ready for review June 15, 2020 21:26
@ricardo-espinoza ricardo-espinoza self-requested a review June 22, 2020 22:22
@rmshaffer
Copy link
Contributor Author

Thanks for the review, @ricardo-espinoza!

@rmshaffer rmshaffer merged commit 4896d9a into feature/azure-client Jun 22, 2020
@rmshaffer rmshaffer deleted the rmshaffer/azure-mock-tests branch June 22, 2020 23:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants