Updated iQsharp tests to expect non-failures for hardware caps

This commit is contained in:
Dmitry Vasilevsky 2023-01-25 13:02:14 -08:00
Родитель c5067085eb
Коммит 7dc5dddd91
3 изменённых файлов: 8 добавлений и 17 удалений

Просмотреть файл

@ -444,8 +444,8 @@ namespace Tests.IQSharp
var entryPoint = await entryPointGenerator.Generate("ValidEntryPoint", "ionq.simulator", TargetCapabilityModule.BasicQuantumFunctionality);
Assert.IsNotNull(entryPoint);
await Assert.ThrowsExceptionAsync<CompilationErrorsException>(async () =>
await entryPointGenerator.Generate("ClassicalControl", "ionq.simulator", TargetCapabilityModule.BasicQuantumFunctionality));
var entryPoint2 = entryPointGenerator.Generate("ClassicalControl", "ionq.simulator", TargetCapabilityModule.BasicQuantumFunctionality);
Assert.IsNotNull(entryPoint2);
}
[TestMethod]
@ -455,8 +455,8 @@ namespace Tests.IQSharp
var entryPoint = await entryPointGenerator.Generate("ValidEntryPoint", "ionq.simulator", TargetCapabilityModule.BasicQuantumFunctionality);
Assert.IsNotNull(entryPoint);
await Assert.ThrowsExceptionAsync<CompilationErrorsException>(async () =>
await entryPointGenerator.Generate("ClassicalControl", "ionq.simulator", TargetCapabilityModule.BasicQuantumFunctionality));
var entryPoint2 = entryPointGenerator.Generate("ClassicalControl", "ionq.simulator", TargetCapabilityModule.BasicQuantumFunctionality);
Assert.IsNotNull(entryPoint2);
}
}
}

Просмотреть файл

@ -386,7 +386,7 @@ namespace Tests.IQSharp
}
[DataTestMethod]
[DataRow("ionq.mock", AzureClientError.InvalidEntryPoint)]
[DataRow("ionq.mock", null)]
[DataRow("quantinuum.mock", null)]
public async Task TestRuntimeCapabilities(string targetId, AzureClientError? expectedError)
{
@ -395,7 +395,7 @@ namespace Tests.IQSharp
var packagesService = services.GetRequiredService<INugetPackages>();
// Choose an operation with measurement result comparison, which should
// fail to compile on QPRGen0 targets but succeed on QPRGen1 targets
// succeed for both QPRGen0 and QPRGen1 targets
var submissionContext = new AzureSubmissionContext() { OperationName = "Tests.qss.CompareMeasurementResult" };
ExpectSuccess<IEnumerable<TargetStatusInfo>>(ConnectToWorkspaceAsync(azureClient));
@ -404,7 +404,7 @@ namespace Tests.IQSharp
Assert.IsNotNull(azureWorkspace);
azureWorkspace?.AddProviders("ionq", "quantinuum");
// Verify that IonQ job fails to compile (QPRGen0)
// Verify that IonQ job does not fails to compile (QPRGen0)
ExpectSuccess<TargetStatusInfo>(azureClient.SetActiveTargetAsync(new MockChannel(), targetId));
var task = azureClient.SubmitJobAsync(new MockChannel(), submissionContext, CancellationToken.None);
if (expectedError is {} error)

Просмотреть файл

@ -963,16 +963,7 @@ namespace Tests.IQSharp
.Input("%azure.target ionq.mock")
.ExecutesSuccessfully()
.Input("%azure.submit RunTeleport")
.ExecutesWithError(errors => errors.Any(error =>
// Use StartsWith to avoid mismatching on newlines at
// the end.
error.StartsWith(
"The Q# operation RunTeleport could not be " +
"compiled as an entry point for job execution."
)
));
.ExecutesSuccessfully();
}