Skip to content

Commit

Permalink
[FormRecognizer] Changing test location to West Central US + Live tes…
Browse files Browse the repository at this point in the history
…ts fix (#12677)
  • Loading branch information
kinelski authored Jun 10, 2020
1 parent 6ed841c commit cdd3a31
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
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

0 comments on commit cdd3a31

Please sign in to comment.