-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[textanalytics] convert to test proxy (#21696)
* try one test * test proxy initial work * adding sanitizer and recording, not working in playback yet * update conftest and testcases * analyze actions - add new recordings and delete old * analyze healthcare - add new recordings and delete old * analyze sentiment - add new recordings and delete old * auth tests should use get_credential, removes async base test class - not needed * detect language - add new recordings and delete old * test encoding - add new recordings and delete old * extract key phrases - add new recordings and delete old * recognize entities - add new recordings and delete old * recognize linked entities - add new recordings and delete old * recognize pii entities - add new recordings and delete old * add testproxy config to ci/tests.yml * delete unused recordings I missed * rstrip endpoint * add oauth sanitizer * fix rstrip endpoint, start the proxy automatically, rerecord a few tests * try something * more logging * update all recordings * ignore body for tests where we scrub * rerecord again * remove from tests.yml
- Loading branch information
1 parent
b818787
commit c95194a
Showing
1,272 changed files
with
78,270 additions
and
67,392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 0 additions & 40 deletions
40
sdk/textanalytics/azure-ai-textanalytics/tests/asynctestcase.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
129 changes: 129 additions & 0 deletions
129
...gs/test_analyze.pyTestAnalyzetest_all_successful_passing_dict_extract_summary_action.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
{ | ||
"Entries": [ | ||
{ | ||
"RequestUri": "https://fakeendpoint.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze", | ||
"RequestMethod": "POST", | ||
"RequestHeaders": { | ||
"Accept": "application/json, text/json", | ||
"Accept-Encoding": "gzip, deflate", | ||
"Connection": "keep-alive", | ||
"Content-Length": "2177", | ||
"Content-Type": "application/json", | ||
"User-Agent": "azsdk-python-ai-textanalytics/5.2.0b3 Python/3.10.0 (Windows-10-10.0.22000-SP0)", | ||
"x-ms-client-request-id": "25293ed1-5d0f-11ec-aac3-b831b58100e8" | ||
}, | ||
"RequestBody": "{\u0022tasks\u0022: {\u0022entityRecognitionTasks\u0022: [], \u0022entityRecognitionPiiTasks\u0022: [], \u0022keyPhraseExtractionTasks\u0022: [], \u0022entityLinkingTasks\u0022: [], \u0022sentimentAnalysisTasks\u0022: [], \u0022extractiveSummarizationTasks\u0022: [{\u0022parameters\u0022: {\u0022stringIndexType\u0022: \u0022UnicodeCodePoint\u0022}, \u0022taskName\u0022: \u00220\u0022}], \u0022customEntityRecognitionTasks\u0022: [], \u0022customSingleClassificationTasks\u0022: [], \u0022customMultiClassificationTasks\u0022: []}, \u0022analysisInput\u0022: {\u0022documents\u0022: [{\u0022id\u0022: \u00221\u0022, \u0022text\u0022: \u0022The government of British Prime Minster Theresa May has been plunged into turmoil with the resignation of two senior Cabinet ministers in a deep split over her Brexit strategy. The Foreign Secretary Boris Johnson, quit on Monday, hours after the resignation late on Sunday night of the minister in charge of Brexit negotiations, David Davis. Their decision to leave the government came three days after May appeared to have agreed a deal with herfractured Cabinet on the UK\u0027s post Brexit relationship with the EU. That plan is now in tatters and her political future appears uncertain. May appeared in Parliament on Monday afternoon to defend her plan, minutes after Downing Street confirmed the departure of Johnson. May acknowledged the splits in her statement to MPs, saying of the ministers who quit: We do not agree about the best way of delivering our shared commitment to honoring the result of the referendum. The Prime Minister\u0027s latest plitical drama began late on Sunday night when Davis quit, declaring he could not support May\u0027s Brexit plan. He said it involved too close a relationship with the EU and gave only an illusion of control being returned to the UK after it left the EU. It seems to me we\u0027re giving too much away, too easily, and that\u0027s a dangerous strategy at this time, Davis said in a BBC radio interview Monday morning. Johnson\u0027s resignation came Monday afternoon local time, just before the Prime Minister was due to make a scheduled statement in Parliament. This afternoon, the Prime Minister accepted the resignation of Boris Johnson as Foreign Secretary, a statement from Downing Street said.\u0022, \u0022language\u0022: \u0022en\u0022}, {\u0022id\u0022: \u00222\u0022, \u0022text\u0022: \u0022Microsoft fue fundado por Bill Gates y Paul Allen\u0022, \u0022language\u0022: \u0022es\u0022}]}}", | ||
"StatusCode": 202, | ||
"ResponseHeaders": { | ||
"apim-request-id": "a03b6b25-f013-4368-bd31-ad425c9179ac", | ||
"Date": "Tue, 14 Dec 2021 18:53:37 GMT", | ||
"operation-location": "https://fakeendpoint.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/0a0d1391-60f6-4b43-8d4f-41abe9f6f861", | ||
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", | ||
"Transfer-Encoding": "chunked", | ||
"X-Content-Type-Options": "nosniff", | ||
"x-envoy-upstream-service-time": "217" | ||
}, | ||
"ResponseBody": null | ||
}, | ||
{ | ||
"RequestUri": "https://fakeendpoint.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/0a0d1391-60f6-4b43-8d4f-41abe9f6f861?showStats=True", | ||
"RequestMethod": "GET", | ||
"RequestHeaders": { | ||
"Accept": "*/*", | ||
"Accept-Encoding": "gzip, deflate", | ||
"Connection": "keep-alive", | ||
"User-Agent": "azsdk-python-ai-textanalytics/5.2.0b3 Python/3.10.0 (Windows-10-10.0.22000-SP0)", | ||
"x-ms-client-request-id": "25293ed1-5d0f-11ec-aac3-b831b58100e8" | ||
}, | ||
"RequestBody": null, | ||
"StatusCode": 200, | ||
"ResponseHeaders": { | ||
"apim-request-id": "3fa18449-f763-4f73-b925-eae5942bf462", | ||
"Content-Type": "application/json; charset=utf-8", | ||
"Date": "Tue, 14 Dec 2021 18:53:42 GMT", | ||
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", | ||
"Transfer-Encoding": "chunked", | ||
"X-Content-Type-Options": "nosniff", | ||
"x-envoy-upstream-service-time": "114" | ||
}, | ||
"ResponseBody": { | ||
"jobId": "0a0d1391-60f6-4b43-8d4f-41abe9f6f861", | ||
"lastUpdateDateTime": "2021-12-14T18:53:41Z", | ||
"createdDateTime": "2021-12-14T18:53:37Z", | ||
"expirationDateTime": "2021-12-15T18:53:37Z", | ||
"status": "succeeded", | ||
"errors": [], | ||
"tasks": { | ||
"completed": 1, | ||
"failed": 0, | ||
"inProgress": 0, | ||
"total": 1, | ||
"extractiveSummarizationTasks": [ | ||
{ | ||
"lastUpdateDateTime": "2021-12-14T18:53:41.3509318Z", | ||
"taskName": "0", | ||
"state": "succeeded", | ||
"results": { | ||
"statistics": { | ||
"documentsCount": 2, | ||
"validDocumentsCount": 2, | ||
"erroneousDocumentsCount": 0, | ||
"transactionsCount": 3 | ||
}, | ||
"documents": [ | ||
{ | ||
"id": "1", | ||
"statistics": { | ||
"charactersCount": 1625, | ||
"transactionsCount": 2 | ||
}, | ||
"sentences": [ | ||
{ | ||
"text": "The government of British Prime Minster Theresa May has been plunged into turmoil with the resignation of two senior Cabinet ministers in a deep split over her Brexit strategy.", | ||
"rankScore": 0.57, | ||
"offset": 0, | ||
"length": 176 | ||
}, | ||
{ | ||
"text": "The Foreign Secretary Boris Johnson, quit on Monday, hours after the resignation late on Sunday night of the minister in charge of Brexit negotiations, David Davis.", | ||
"rankScore": 1.0, | ||
"offset": 177, | ||
"length": 164 | ||
}, | ||
{ | ||
"text": "Their decision to leave the government came three days after May appeared to have agreed a deal with herfractured Cabinet on the UK\u0027s post Brexit relationship with the EU.", | ||
"rankScore": 0.47, | ||
"offset": 342, | ||
"length": 171 | ||
} | ||
], | ||
"warnings": [] | ||
}, | ||
{ | ||
"id": "2", | ||
"statistics": { | ||
"charactersCount": 49, | ||
"transactionsCount": 1 | ||
}, | ||
"sentences": [ | ||
{ | ||
"text": "Microsoft fue fundado por Bill Gates y Paul Allen", | ||
"rankScore": 1.0, | ||
"offset": 0, | ||
"length": 49 | ||
} | ||
], | ||
"warnings": [] | ||
} | ||
], | ||
"errors": [], | ||
"modelVersion": "2021-08-01" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"Variables": {} | ||
} |
111 changes: 111 additions & 0 deletions
111
...ecordings/test_analyze.pyTestAnalyzetest_all_successful_passing_dict_key_phrase_task.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
{ | ||
"Entries": [ | ||
{ | ||
"RequestUri": "https://fakeendpoint.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze", | ||
"RequestMethod": "POST", | ||
"RequestHeaders": { | ||
"Accept": "application/json, text/json", | ||
"Accept-Encoding": "gzip, deflate", | ||
"Connection": "keep-alive", | ||
"Content-Length": "565", | ||
"Content-Type": "application/json", | ||
"User-Agent": "azsdk-python-ai-textanalytics/5.2.0b3 Python/3.10.0 (Windows-10-10.0.22000-SP0)", | ||
"x-ms-client-request-id": "ad73a7fb-5d0e-11ec-8699-b831b58100e8" | ||
}, | ||
"RequestBody": "{\u0022tasks\u0022: {\u0022entityRecognitionTasks\u0022: [], \u0022entityRecognitionPiiTasks\u0022: [], \u0022keyPhraseExtractionTasks\u0022: [{\u0022parameters\u0022: {}, \u0022taskName\u0022: \u00220\u0022}], \u0022entityLinkingTasks\u0022: [], \u0022sentimentAnalysisTasks\u0022: [], \u0022extractiveSummarizationTasks\u0022: [], \u0022customEntityRecognitionTasks\u0022: [], \u0022customSingleClassificationTasks\u0022: [], \u0022customMultiClassificationTasks\u0022: []}, \u0022analysisInput\u0022: {\u0022documents\u0022: [{\u0022id\u0022: \u00221\u0022, \u0022text\u0022: \u0022Microsoft was founded by Bill Gates and Paul Allen\u0022, \u0022language\u0022: \u0022en\u0022}, {\u0022id\u0022: \u00222\u0022, \u0022text\u0022: \u0022Microsoft fue fundado por Bill Gates y Paul Allen\u0022, \u0022language\u0022: \u0022es\u0022}]}}", | ||
"StatusCode": 202, | ||
"ResponseHeaders": { | ||
"apim-request-id": "7c5ba259-3eda-456a-9f46-a35de4ba0e09", | ||
"Date": "Tue, 14 Dec 2021 18:50:17 GMT", | ||
"operation-location": "https://fakeendpoint.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/307a5fae-a297-46da-b37d-bc28cf04eb24", | ||
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", | ||
"Transfer-Encoding": "chunked", | ||
"X-Content-Type-Options": "nosniff", | ||
"x-envoy-upstream-service-time": "318" | ||
}, | ||
"ResponseBody": null | ||
}, | ||
{ | ||
"RequestUri": "https://fakeendpoint.cognitiveservices.azure.com/text/analytics/v3.2-preview.2/analyze/jobs/307a5fae-a297-46da-b37d-bc28cf04eb24?showStats=True", | ||
"RequestMethod": "GET", | ||
"RequestHeaders": { | ||
"Accept": "*/*", | ||
"Accept-Encoding": "gzip, deflate", | ||
"Connection": "keep-alive", | ||
"User-Agent": "azsdk-python-ai-textanalytics/5.2.0b3 Python/3.10.0 (Windows-10-10.0.22000-SP0)", | ||
"x-ms-client-request-id": "ad73a7fb-5d0e-11ec-8699-b831b58100e8" | ||
}, | ||
"RequestBody": null, | ||
"StatusCode": 200, | ||
"ResponseHeaders": { | ||
"apim-request-id": "2b4749c7-31e2-4381-adb7-9a1a7c146612", | ||
"Content-Type": "application/json; charset=utf-8", | ||
"Date": "Tue, 14 Dec 2021 18:50:22 GMT", | ||
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", | ||
"Transfer-Encoding": "chunked", | ||
"X-Content-Type-Options": "nosniff", | ||
"x-envoy-upstream-service-time": "125" | ||
}, | ||
"ResponseBody": { | ||
"jobId": "307a5fae-a297-46da-b37d-bc28cf04eb24", | ||
"lastUpdateDateTime": "2021-12-14T18:50:22Z", | ||
"createdDateTime": "2021-12-14T18:50:17Z", | ||
"expirationDateTime": "2021-12-15T18:50:17Z", | ||
"status": "succeeded", | ||
"errors": [], | ||
"tasks": { | ||
"completed": 1, | ||
"failed": 0, | ||
"inProgress": 0, | ||
"total": 1, | ||
"keyPhraseExtractionTasks": [ | ||
{ | ||
"lastUpdateDateTime": "2021-12-14T18:50:22.069458Z", | ||
"taskName": "0", | ||
"state": "succeeded", | ||
"results": { | ||
"statistics": { | ||
"documentsCount": 2, | ||
"validDocumentsCount": 2, | ||
"erroneousDocumentsCount": 0, | ||
"transactionsCount": 2 | ||
}, | ||
"documents": [ | ||
{ | ||
"id": "1", | ||
"keyPhrases": [ | ||
"Bill Gates", | ||
"Paul Allen", | ||
"Microsoft" | ||
], | ||
"statistics": { | ||
"charactersCount": 50, | ||
"transactionsCount": 1 | ||
}, | ||
"warnings": [] | ||
}, | ||
{ | ||
"id": "2", | ||
"keyPhrases": [ | ||
"Bill Gates", | ||
"Paul Allen", | ||
"Microsoft" | ||
], | ||
"statistics": { | ||
"charactersCount": 49, | ||
"transactionsCount": 1 | ||
}, | ||
"warnings": [] | ||
} | ||
], | ||
"errors": [], | ||
"modelVersion": "2021-06-01" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"Variables": {} | ||
} |
Oops, something went wrong.