diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentAnalysisClient/DocumentAnalysisClientLiveTests.cs b/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentAnalysisClient/DocumentAnalysisClientLiveTests.cs index d14eb8df0da6a..5a0d60241b9c5 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentAnalysisClient/DocumentAnalysisClientLiveTests.cs +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentAnalysisClient/DocumentAnalysisClientLiveTests.cs @@ -617,7 +617,14 @@ public async Task AnalyzeDocumentPopulatesDocumentPageJpg(bool useStream) Assert.True(style.IsHandwritten); - Assert.AreEqual(38, result.Paragraphs.Count); + if (_serviceVersion >= DocumentAnalysisClientOptions.ServiceVersion.V2023_02_28_Preview) + { + Assert.AreEqual(52, result.Paragraphs.Count); + } + else + { + Assert.AreEqual(38, result.Paragraphs.Count); + } DocumentParagraph sampleParagraph = result.Paragraphs[1]; @@ -918,9 +925,9 @@ public async Task AnalyzeDocumentPopulatesExtractedInvoiceJpg(bool useStream) var expectedItems = new List<(double Amount, DateTimeOffset Date, string Description, string ProductCode, double Quantity, string Unit, double UnitPrice)>() { - (60f, DateTimeOffset.Parse("2021-04-03 00:00:00+00:00"), "Consulting Services", "A123", 2, "hours", 30), - (30f, DateTimeOffset.Parse("2021-05-03 00:00:00+00:00"), "Document Fee", "B456", 3, null, 10), - (10f, DateTimeOffset.Parse("2021-06-03 00:00:00+00:00"), "Printing Fee", "C789", 10, "pages", 1) + (60f, DateTimeOffset.Parse("2021-03-04 00:00:00+00:00"), "Consulting Services", "A123", 2, "hours", 30), + (30f, DateTimeOffset.Parse("2021-03-05 00:00:00+00:00"), "Document Fee", "B456", 3, null, 10), + (10f, DateTimeOffset.Parse("2021-03-06 00:00:00+00:00"), "Printing Fee", "C789", 10, "pages", 1) }; // Include a bit of tolerance when comparing double types. @@ -1432,7 +1439,7 @@ public async Task AnalyzeDocumentCanParseMultipageReceipt(bool useStream) if (documentIndex == 0) { - Assert.AreEqual("$14,50", sampleField.Content); + Assert.AreEqual("$14.50", sampleField.Content); } else if (documentIndex == 1) { @@ -1474,7 +1481,7 @@ public async Task AnalyzeDocumentCanParseMultipageReceiptWithBlankPage() if (pageIndex == 0 || pageIndex == 2) { - var expectedContent = pageIndex == 0 ? "$14,50" : "1203.39"; + var expectedContent = pageIndex == 0 ? "$14.50" : "1203.39"; Assert.True(page.Words.Any(w => w.Content == expectedContent)); } diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentModelAdministrationClient/DocumentModelAdministrationLiveTests.cs b/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentModelAdministrationClient/DocumentModelAdministrationLiveTests.cs index 5ce3fdf26607c..6fbcd627cc4a2 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentModelAdministrationClient/DocumentModelAdministrationLiveTests.cs +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentModelAdministrationClient/DocumentModelAdministrationLiveTests.cs @@ -69,9 +69,8 @@ public async Task BuildDocumentModel(DocumentBuildMode buildMode) if (buildMode == DocumentBuildMode.Neural && Recording.Mode == RecordedTestMode.Live) { // Test takes too long to finish running, and seems to cause multiple failures in our - // live test pipeline. Until we find a way to run it without flakiness, this test will - // be ignored when running in Live mode. - Assert.Ignore("https://github.com/Azure/azure-sdk-for-net/issues/27042"); + // live test pipeline. For this reason, this test is ignored when running in Live mode. + Assert.Ignore(); } var client = CreateDocumentModelAdministrationClient(); @@ -118,14 +117,7 @@ public async Task BuildDocumentModel(DocumentBuildMode buildMode) } else { - // We have changed the following validation because of a service bug. This needs to be updated once the bug is fixed. - // More information: https://github.com/Azure/azure-sdk-for-net/issues/35809 - - // The expected behavior. This must be added back once the service bug is fixed. - // Assert.IsNull(model.ExpiresOn); - - // The current behavior. This assertion must be removed once the service bug is fixed. - Assert.Greater(model.ExpiresOn, model.CreatedOn); + Assert.IsNull(model.ExpiresOn); } CollectionAssert.AreEquivalent(options.Tags, model.Tags); @@ -272,7 +264,15 @@ public async Task ComposeDocumentModel(bool useTokenCredential) Assert.AreEqual(description, model.Description); Assert.AreEqual(ServiceVersionString, model.ApiVersion); Assert.Greater(model.CreatedOn, startTime); - Assert.Greater(model.ExpiresOn, model.CreatedOn); + + if (_serviceVersion >= DocumentAnalysisClientOptions.ServiceVersion.V2023_02_28_Preview) + { + Assert.Greater(model.ExpiresOn, model.CreatedOn); + } + else + { + Assert.IsNull(model.ExpiresOn); + } CollectionAssert.AreEquivalent(tags, model.Tags); @@ -323,13 +323,7 @@ public async Task GetDocumentModel(bool useTokenCredential) Assert.AreEqual(expected.Description, model.Description); Assert.AreEqual(expected.ApiVersion, model.ApiVersion); Assert.AreEqual(expected.CreatedOn, model.CreatedOn); - - // (TODO) This assertion should not need a conditional block but we need it because of a service issue. - // Remove the condition once this issue is fixed: https://github.com/Azure/azure-sdk-for-net/issues/35809 - if (_serviceVersion > DocumentAnalysisClientOptions.ServiceVersion.V2022_08_31) - { - Assert.AreEqual(expected.ExpiresOn, model.ExpiresOn); - } + Assert.AreEqual(expected.ExpiresOn, model.ExpiresOn); CollectionAssert.AreEquivalent(expected.Tags, model.Tags); @@ -397,13 +391,7 @@ public async Task GetDocumentModels(bool useTokenCredential) Assert.AreEqual(expected.Description, model.Description); Assert.AreEqual(expected.ApiVersion, model.ApiVersion); Assert.AreEqual(expected.CreatedOn, model.CreatedOn); - - // (TODO) This assertion should not need a conditional block but we need it because of a service issue. - // Remove the condition once this issue is fixed: https://github.com/Azure/azure-sdk-for-net/issues/35809 - if (_serviceVersion > DocumentAnalysisClientOptions.ServiceVersion.V2022_08_31) - { - Assert.AreEqual(expected.ExpiresOn, model.ExpiresOn); - } + Assert.AreEqual(expected.ExpiresOn, model.ExpiresOn); CollectionAssert.AreEquivalent(expected.Tags, model.Tags); } diff --git a/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentModelAdministrationClient/MiscellaneousOperationsLiveTests.cs b/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentModelAdministrationClient/MiscellaneousOperationsLiveTests.cs index e49f3523480ab..dc2e32e3023fa 100644 --- a/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentModelAdministrationClient/MiscellaneousOperationsLiveTests.cs +++ b/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/DocumentModelAdministrationClient/MiscellaneousOperationsLiveTests.cs @@ -176,18 +176,7 @@ private void ValidateDocumentModelDetails(DocumentModelDetails model, string des } else { - // We have changed the following validation because of a service bug. This needs to be updated once the bug is fixed. - // More information: https://github.com/Azure/azure-sdk-for-net/issues/35809 - - /* The expected behavior. This must be added back once the service bug is fixed. Assert.Null(model.ExpiresOn); - */ - - // The current behavior. This 'if' block must be completely removed once the service bug is fixed. - if (model.ExpiresOn.HasValue) - { - Assert.Greater(model.ExpiresOn, model.CreatedOn); - } } // TODO add validation for Doctypes https://github.com/Azure/azure-sdk-for-net-pr/issues/1432 diff --git a/sdk/formrecognizer/assets.json b/sdk/formrecognizer/assets.json index b2d85d5c8141c..38105060c8928 100644 --- a/sdk/formrecognizer/assets.json +++ b/sdk/formrecognizer/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/formrecognizer", - "Tag": "net/formrecognizer_3c6efa38b9" + "Tag": "net/formrecognizer_2475157f2c" }