зеркало из https://github.com/microsoft/presidio.git
Run E2E Integration Tests on Deployment (#502)
* Run e2e integration tests after deployment * Add stage name * build * Take from vars, bump * rebase * Change path * retest Co-authored-by: sharon <sharon.hart@microsoft.com>
This commit is contained in:
Родитель
30cb33067e
Коммит
b96af984c8
|
@ -100,6 +100,11 @@ jobs:
|
|||
echo analyzer status code is $ANALYZER_STATUS_CODE
|
||||
echo anonymizer status code is $ANONYMIZER_STATUS_CODE
|
||||
done
|
||||
- template: ./e2e-tests.yml
|
||||
parameters:
|
||||
test_suite: 'integration'
|
||||
analyzer_base_url: $(ANALYZER_STAGING_URI)
|
||||
anonymizer_base_url: $(ANONYMIZER_STAGING_URI)
|
||||
|
||||
- job: SwapBothSlots
|
||||
condition: eq(dependencies.TestDeployment.result, 'Succeeded')
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
parameters:
|
||||
- name: test_suite
|
||||
type: string
|
||||
default: ''
|
||||
- name: analyzer_base_url
|
||||
type: string
|
||||
default: ''
|
||||
- name: anonymizer_base_url
|
||||
type: string
|
||||
default: ''
|
||||
steps:
|
||||
- task: DockerCompose@0
|
||||
displayName: Start Presidio Cluster
|
||||
|
@ -22,6 +32,12 @@ steps:
|
|||
- script: |
|
||||
set -eux # fail on error
|
||||
source env/bin/activate
|
||||
pytest
|
||||
if [ -z ${TEST_SUITE} ]; then pytest -v; else pytest -v -m ${TEST_SUITE}; fi
|
||||
workingDirectory: e2e-tests
|
||||
env:
|
||||
${{ if ne(parameters.analyzer_base_url, '') }}:
|
||||
ANALYZER_BASE_URL: ${{ parameters.analyzer_base_url }}
|
||||
${{ if ne(parameters.anonymizer_base_url, '') }}:
|
||||
ANONYMIZER_BASE_URL: ${{ parameters.anonymizer_base_url }}
|
||||
TEST_SUITE: ${{ parameters.test_suite }}
|
||||
displayName: Run tests
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
stages:
|
||||
- stage: LintBuildTest
|
||||
# displayNames are defined below to avoid duplicate descriptions in the PR
|
||||
displayName:
|
||||
displayName: Presidio Build
|
||||
jobs:
|
||||
#- job: validate
|
||||
# displayName: 'Validate PR pre-requisites'
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1,2 +1,2 @@
|
|||
1.10.0
|
||||
1.11.0
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import os
|
||||
import requests
|
||||
from common.constants import ANONYMIZER_BASE_URL, ANALYZER_BASE_URL
|
||||
|
||||
DEFAULT_HEADERS = {"Content-Type": "application/json"}
|
||||
ANALYZER_BASE_URL = os.environ.get("ANALYZER_BASE_URL", ANALYZER_BASE_URL)
|
||||
ANONYMIZER_BASE_URL = os.environ.get("ANONYMIZER_BASE_URL", ANONYMIZER_BASE_URL)
|
||||
|
||||
|
||||
def anonymize(data):
|
||||
|
|
|
@ -53,9 +53,7 @@ def test_given_anonymize_called_with_empty_text_then_invalid_input_message_retur
|
|||
assert equal_json_strings(expected_response, response_content)
|
||||
|
||||
|
||||
pytest.mark.api
|
||||
|
||||
|
||||
@pytest.mark.api
|
||||
def test_given_anonymize_called_with_empty_analyzer_results_then_invalid_input_message_returned():
|
||||
request_body = """
|
||||
{
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import pytest
|
||||
|
||||
from common.methods import analyzer_supported_entities
|
||||
|
||||
|
||||
# TODO: [ADO-2763] Stub, remove and replace with real integration scenarios
|
||||
@pytest.mark.integration
|
||||
def test_given_a_correct_input_for_supported_entities_then_expect_a_correct_response():
|
||||
language_query_parameter = "language=en"
|
||||
|
||||
response_status, response_content = analyzer_supported_entities(
|
||||
language_query_parameter
|
||||
)
|
||||
|
||||
assert response_status == 200
|
||||
|
Загрузка…
Ссылка в новой задаче