From 8ecdad37f4e3f53af87a8d4b8aaeaea6ec559ea7 Mon Sep 17 00:00:00 2001 From: Mariana Rios Flores Date: Thu, 1 Apr 2021 16:02:10 -0700 Subject: [PATCH] use ClientDiagnostics and disable tests now that we have logs --- .../Infrastructure/DocumentTranslationLiveTestBase.cs | 9 ++++++++- .../tests/TranslationOperationLiveTests.cs | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/documenttranslation/Azure.AI.Translator.DocumentTranslation/tests/Infrastructure/DocumentTranslationLiveTestBase.cs b/sdk/documenttranslation/Azure.AI.Translator.DocumentTranslation/tests/Infrastructure/DocumentTranslationLiveTestBase.cs index d3acd989e3acd..f523cc282668a 100644 --- a/sdk/documenttranslation/Azure.AI.Translator.DocumentTranslation/tests/Infrastructure/DocumentTranslationLiveTestBase.cs +++ b/sdk/documenttranslation/Azure.AI.Translator.DocumentTranslation/tests/Infrastructure/DocumentTranslationLiveTestBase.cs @@ -39,7 +39,14 @@ public DocumentTranslationClient GetClient( DocumentTranslationClientOptions options = default) { var endpoint = new Uri(TestEnvironment.Endpoint); - options ??= new DocumentTranslationClientOptions(); + options ??= new DocumentTranslationClientOptions() + { + Diagnostics = + { + LoggedHeaderNames = { "x-ms-request-id", "X-RequestId" }, + IsLoggingContentEnabled = true + } + }; credential ??= new AzureKeyCredential(TestEnvironment.ApiKey); return InstrumentClient(new DocumentTranslationClient(endpoint, credential, InstrumentClientOptions(options))); diff --git a/sdk/documenttranslation/Azure.AI.Translator.DocumentTranslation/tests/TranslationOperationLiveTests.cs b/sdk/documenttranslation/Azure.AI.Translator.DocumentTranslation/tests/TranslationOperationLiveTests.cs index 0c09ed4306613..2918d1fb02b87 100644 --- a/sdk/documenttranslation/Azure.AI.Translator.DocumentTranslation/tests/TranslationOperationLiveTests.cs +++ b/sdk/documenttranslation/Azure.AI.Translator.DocumentTranslation/tests/TranslationOperationLiveTests.cs @@ -49,6 +49,7 @@ public async Task SingleSourceSingleTargetTest() } [RecordedTest] + [Ignore("Flaky test. Enable once service provides fix/information")] public async Task SingleSourceMultipleTargetsTest() { Uri source = await CreateSourceContainerAsync(oneTestDocuments); @@ -246,6 +247,7 @@ public async Task GetDocumentStatusTest() } [RecordedTest] + [Ignore("Flaky test. Enable once service provides fix/information")] public async Task WrongSourceRightTarget() { Uri source = new("https://idont.ex.ist"); @@ -266,6 +268,7 @@ public async Task WrongSourceRightTarget() } [RecordedTest] + [Ignore("Flaky test. Enable once service provides fix/information")] public async Task RightSourceWrongTarget() { Uri source = await CreateSourceContainerAsync(oneTestDocuments);