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

[FR] Adjust tests and re record #22065

Merged
merged 1 commit into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ public async Task StartRecognizeCustomFormsThrowsForDamagedFile(bool useTraining
/// Recognizer cognitive service and handle returned errors.
/// </summary>
[RecordedTest]
[TestCase(true, Ignore = "https://github.com/Azure/azure-sdk-for-net/issues/20961")]
[TestCase(true)]
[TestCase(false)]
public async Task StartRecognizeCustomFormsFromUriThrowsForNonExistingContent(bool useTrainingLabels)
{
Expand All @@ -598,13 +598,9 @@ public async Task StartRecognizeCustomFormsFromUriThrowsForNonExistingContent(bo

await using var trainedModel = await CreateDisposableTrainedModelAsync(useTrainingLabels);

var operation = await client.StartRecognizeCustomFormsFromUriAsync(trainedModel.ModelId, invalidUri);

RequestFailedException ex = Assert.ThrowsAsync<RequestFailedException>(async () => await operation.WaitForCompletionAsync());
RequestFailedException ex = Assert.ThrowsAsync<RequestFailedException>(async () => await client.StartRecognizeCustomFormsFromUriAsync(trainedModel.ModelId, invalidUri));

Assert.AreEqual("2003", ex.ErrorCode);
Assert.True(operation.HasCompleted);
Assert.False(operation.HasValue);
Assert.AreEqual("2001", ex.ErrorCode);
Copy link
Member

Choose a reason for hiding this comment

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

just wondering, did you see this change in both canary and prod?

Copy link
Member Author

Choose a reason for hiding this comment

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

I saw it in both. Because I only run canary on the weekends, prod started failing on Friday, so idk if in the middle of the week Canary already had the changes

}

[RecordedTest]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,14 @@ public async Task StartTrainingWithNoLabelsModelName()
}

[RecordedTest]
public async Task StartTrainingError()
public void StartTrainingError()
{
var client = CreateFormTrainingClient();

var containerUrl = new Uri("https://someUrl");

TrainingOperation operation = await client.StartTrainingAsync(containerUrl, useTrainingLabels: false);
RequestFailedException ex = Assert.ThrowsAsync<RequestFailedException>(async () => await operation.WaitForCompletionAsync());
Assert.AreEqual("2001", ex.ErrorCode);

Assert.False(operation.HasValue);
Assert.Throws<RequestFailedException>(() => operation.Value.GetType());
RequestFailedException ex = Assert.ThrowsAsync<RequestFailedException>(async () => await client.StartTrainingAsync(containerUrl, useTrainingLabels: false));
Assert.AreEqual("2011", ex.ErrorCode);
}

[RecordedTest]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading