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

[FormRecognizer] Changing test location to West Central US + Live tests fix #12677

Merged
merged 3 commits into from
Jun 10, 2020
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
2 changes: 0 additions & 2 deletions sdk/formrecognizer/Azure.AI.FormRecognizer/src/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ internal static class Constants
{
public const string AuthorizationHeader = "Ocp-Apim-Subscription-Key";

public const string LocationHeader = "Location";

public const string OperationLocationHeader = "Operation-Location";

public const string DefaultCognitiveScope = "https://cognitiveservices.azure.com/.default";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ internal static string GetVersionString(ServiceVersion version)
/// </summary>
private void AddLoggedHeadersAndQueryParameters()
{
Diagnostics.LoggedHeaderNames.Add(Constants.LocationHeader);
Diagnostics.LoggedHeaderNames.Add(Constants.OperationLocationHeader);
Diagnostics.LoggedHeaderNames.Add("apim-request-id");
Diagnostics.LoggedHeaderNames.Add("Location");
Diagnostics.LoggedHeaderNames.Add("Strict-Transport-Security");
Diagnostics.LoggedHeaderNames.Add("X-Content-Type-Options");
Diagnostics.LoggedHeaderNames.Add("x-envoy-upstream-service-time");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public virtual CopyModelOperation StartCopyModel(string modelId, CopyAuthorizati
new CopyAuthorizationResult(target.ModelId, target.AccessToken, target.ExpiresOn/*.ToUnixTimeSeconds()*/));

Response response = ServiceClient.CopyCustomModel(guid, request, cancellationToken);
string location = ClientCommon.GetResponseHeader(response.Headers, Constants.LocationHeader);
string location = ClientCommon.GetResponseHeader(response.Headers, Constants.OperationLocationHeader);

return new CopyModelOperation(ServiceClient, Diagnostics, location, target.ModelId);
}
Expand All @@ -344,7 +344,7 @@ public virtual async Task<CopyModelOperation> StartCopyModelAsync(string modelId
new CopyAuthorizationResult(target.ModelId, target.AccessToken, target.ExpiresOn/*.ToUnixTimeSeconds()*/));

Response response = await ServiceClient.CopyCustomModelAsync(guid, request, cancellationToken).ConfigureAwait(false);
string location = ClientCommon.GetResponseHeader(response.Headers, Constants.LocationHeader);
string location = ClientCommon.GetResponseHeader(response.Headers, Constants.OperationLocationHeader);

return new CopyModelOperation(ServiceClient, Diagnostics, location, target.ModelId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ public async Task StartRecognizeCustomFormsWithoutLabelsCanParseMultipageFormWit
/// Recognizer cognitive service and handle returned errors.
/// </summary>
[Test]
[TestCase(true)]
[TestCase(true, Ignore = "https://github.com/Azure/azure-sdk-for-net/issues/12319")]
[TestCase(false)]
public async Task StartRecognizeCustomFormsFromUriThrowsForNonExistingContent(bool useTrainingLabels)
{
Expand Down
2 changes: 1 addition & 1 deletion sdk/formrecognizer/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"defaultValue": "westcentralus",
"metadata": {
"description": "The location of the resource. By default, this is the same as the resource group."
}
Expand Down