From 9fbe69f1b28ca643910df07569613203747b2014 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Thu, 30 Sep 2021 15:00:15 -0400 Subject: [PATCH 1/3] add tests.yml file --- sdk/cognitivelanguage/tests.yml | 35 ++++++++------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/sdk/cognitivelanguage/tests.yml b/sdk/cognitivelanguage/tests.yml index 77ea573acbbc..aa074972e605 100644 --- a/sdk/cognitivelanguage/tests.yml +++ b/sdk/cognitivelanguage/tests.yml @@ -1,33 +1,10 @@ -trigger: - branches: - include: - - master - - main - - hotfix/* - - release/* - - restapi* - paths: - include: - - sdk/cognitivelanguage/ - - scripts/ - -pr: - branches: - include: - - master - - main - - feature/* - - hotfix/* - - release/* - - restapi* - paths: - include: - - sdk/cognitivelanguage/ +trigger: none stages: - template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: AllocateResourceGroup: false + BuildTargetingString: $(BuildTargetingString) ServiceDirectory: cognitivelanguage MatrixReplace: - TestSamples=.*/true @@ -35,9 +12,13 @@ stages: AZURE_QUESTIONANSWERING_KEY: $(qna-key) AZURE_QUESTIONANSWERING_PROJECT: 190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c AZURE_QUESTIONANSWERING_ENDPOINT: $(qna-uri) + AZURE_CONVERSATIONS_ENDPOINT: $(conversations-endpoint) + AZURE_CONVERSATIONS_KEY: $(conversations-key) + AZURE_CONVERSATIONS_PROJECT: $(conversations-project) + AZURE_CONVERSATIONS_WORKFLOW_PROJECT: $(conversations-workflow-project) AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) AZURE_SUBSCRIPTION_ID: $(azure-subscription-id) AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - TEST_MODE: 'RunLiveNoRecord' # use when allowing preparers to create the rgs for you - AZURE_TEST_RUN_LIVE: 'true' # use when utilizing the New-TestResources Script + TEST_MODE: "RunLiveNoRecord" # use when allowing preparers to create the rgs for you + AZURE_TEST_RUN_LIVE: "true" # use when utilizing the New-TestResources Script From 09aeb2cf877a71cea012806f3b327f24684772b7 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Thu, 30 Sep 2021 18:17:35 -0400 Subject: [PATCH 2/3] fix build targeting string --- sdk/cognitivelanguage/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cognitivelanguage/tests.yml b/sdk/cognitivelanguage/tests.yml index aa074972e605..cbe99bfbe34a 100644 --- a/sdk/cognitivelanguage/tests.yml +++ b/sdk/cognitivelanguage/tests.yml @@ -4,7 +4,7 @@ stages: - template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: AllocateResourceGroup: false - BuildTargetingString: $(BuildTargetingString) + BuildTargetingString: azure* ServiceDirectory: cognitivelanguage MatrixReplace: - TestSamples=.*/true From 16b5b6648a3815b16ec4fbb5bf8399fc19f02640 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Thu, 30 Sep 2021 19:51:44 -0400 Subject: [PATCH 3/3] make samples 2.7 compatible --- .../samples/sample_chat.py | 8 ++++---- .../samples/sample_query_text.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_chat.py b/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_chat.py index f7a065b77179..033c59be5529 100644 --- a/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_chat.py +++ b/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_chat.py @@ -51,8 +51,8 @@ def sample_chit_chat(): deployment_name="test" ) best_candidate = [a for a in output.answers if a.confidence_score > 0.9][0] - print("Q: {}".format(first_question.question)) - print("A: {}".format(best_candidate.answer)) + print(u"Q: {}".format(first_question.question)) + print(u"A: {}".format(best_candidate.answer)) followup_question = qna.QueryKnowledgeBaseOptions( question="How long it takes to charge Surface?", @@ -75,8 +75,8 @@ def sample_chit_chat(): project_name=knowledge_base_project, deployment_name="test" ) - print("Q: {}".format(followup_question.question)) - print("A: {}".format(output.answers[0].answer)) + print(u"Q: {}".format(followup_question.question)) + print(u"A: {}".format(output.answers[0].answer)) # [END chit_chat] diff --git a/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_query_text.py b/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_query_text.py index 6d3cc65baafe..c394cf640c91 100644 --- a/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_query_text.py +++ b/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_query_text.py @@ -50,8 +50,8 @@ def sample_query_text(): output = client.query_text(input) best_answer = [a for a in output.answers if a.confidence_score > 0.9][0] - print("Q: {}".format(input.question)) - print("A: {}".format(best_answer.answer)) + print(u"Q: {}".format(input.question)) + print(u"A: {}".format(best_answer.answer)) # [END query_text]