diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index ca76f3e1a9..e72c285d19 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -106,8 +106,6 @@ inputs: RESOURCE_PROCESSOR_NUMBER_PROCESSES_PER_INSTANCE: description: "The number of resource processor processes to create for parallel operations" required: false - E2E_TESTS_NUMBER_PROCESSES: - description: "Number of processes to run e2e tests" runs: using: composite diff --git a/.github/workflows/deploy_tre.yml b/.github/workflows/deploy_tre.yml index fa4b0375b9..9e93d6955d 100644 --- a/.github/workflows/deploy_tre.yml +++ b/.github/workflows/deploy_tre.yml @@ -59,4 +59,3 @@ jobs: CORE_APP_SERVICE_PLAN_SKU: ${{ secrets.CORE_APP_SERVICE_PLAN_SKU }} WORKSPACE_APP_SERVICE_PLAN_SKU: ${{ secrets.WORKSPACE_APP_SERVICE_PLAN_SKU }} RESOURCE_PROCESSOR_NUMBER_PROCESSES_PER_INSTANCE: ${{ secrets.RESOURCE_PROCESSOR_NUMBER_PROCESSES_PER_INSTANCE }} - E2E_TESTS_NUMBER_PROCESSES: ${{ secrets.E2E_TESTS_NUMBER_PROCESSES }} diff --git a/.github/workflows/deploy_tre_branch.yml b/.github/workflows/deploy_tre_branch.yml index f4506ed0a9..4108b9979a 100644 --- a/.github/workflows/deploy_tre_branch.yml +++ b/.github/workflows/deploy_tre_branch.yml @@ -86,4 +86,3 @@ jobs: CORE_APP_SERVICE_PLAN_SKU: ${{ secrets.CORE_APP_SERVICE_PLAN_SKU }} WORKSPACE_APP_SERVICE_PLAN_SKU: ${{ secrets.WORKSPACE_APP_SERVICE_PLAN_SKU }} RESOURCE_PROCESSOR_NUMBER_PROCESSES_PER_INSTANCE: ${{ secrets.RESOURCE_PROCESSOR_NUMBER_PROCESSES_PER_INSTANCE }} - E2E_TESTS_NUMBER_PROCESSES: ${{ secrets.E2E_TESTS_NUMBER_PROCESSES }} diff --git a/.github/workflows/deploy_tre_reusable.yml b/.github/workflows/deploy_tre_reusable.yml index fa19819a4d..48a397e589 100644 --- a/.github/workflows/deploy_tre_reusable.yml +++ b/.github/workflows/deploy_tre_reusable.yml @@ -109,9 +109,6 @@ on: # yamllint disable-line rule:truthy RESOURCE_PROCESSOR_NUMBER_PROCESSES_PER_INSTANCE: description: "Inputs" required: false - E2E_TESTS_NUMBER_PROCESSES: - description: "" - required: false # This will prevent multiple runs of this entire workflow. # We should NOT cancel in progress runs as that can destabilize the environment. @@ -625,7 +622,6 @@ jobs: TRE_ID: "${{ secrets.TRE_ID }}" IS_API_SECURED: false WORKSPACE_APP_SERVICE_PLAN_SKU: ${{ secrets.WORKSPACE_APP_SERVICE_PLAN_SKU }} - E2E_TESTS_NUMBER_PROCESSES: ${{ secrets.E2E_TESTS_NUMBER_PROCESSES }} - name: Upload Test Results if: always() diff --git a/Makefile b/Makefile index ffe3915575..872f2db717 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ IMAGE_NAME_PREFIX?="microsoft/azuretre" FULL_CONTAINER_REGISTRY_NAME?="$${ACR_NAME}.azurecr.io" FULL_IMAGE_NAME_PREFIX:=`echo "${FULL_CONTAINER_REGISTRY_NAME}/${IMAGE_NAME_PREFIX}" | tr A-Z a-z` LINTER_REGEX_INCLUDE?=all # regular expression used to specify which files to include in local linting (defaults to "all") +E2E_TESTS_NUMBER_PROCESSES_DEFAULT=4 # can be overridden in e2e_tests/.env target_title = @echo -e "\n\e[34m»»» 🧩 \e[96m$(1)\e[0m..." @@ -313,9 +314,13 @@ test-e2e-custom: $(call target_title, "Running E2E tests with custom selector ${SELECTOR}") \ && . ${MAKEFILE_DIR}/devops/scripts/load_env.sh ${MAKEFILE_DIR}/e2e_tests/.env \ && cd e2e_tests \ - && if [[ -n "$${E2E_TESTS_NUMBER_PROCESSES}" && "$${E2E_TESTS_NUMBER_PROCESSES}" -ne 1 ]]; then \ - python -m pytest -n "$${E2E_TESTS_NUMBER_PROCESSES}" -m "${SELECTOR}" --verify $${IS_API_SECURED:-true} --junit-xml "pytest_e2e_$${SELECTOR// /_}.xml"; else \ - python -m pytest -m "${SELECTOR}" --verify $${IS_API_SECURED:-true} --junit-xml "pytest_e2e_$${SELECTOR// /_}.xml"; fi + && \ + if [[ -n "$${E2E_TESTS_NUMBER_PROCESSES}" && "$${E2E_TESTS_NUMBER_PROCESSES}" -ne 1 ]]; then \ + python -m pytest -n "$${E2E_TESTS_NUMBER_PROCESSES}" -m "${SELECTOR}" --verify $${IS_API_SECURED:-true} --junit-xml "pytest_e2e_$${SELECTOR// /_}.xml"; \ + elif [[ "$${E2E_TESTS_NUMBER_PROCESSES}" -eq 1 ]]; then \ + python -m pytest -m "${SELECTOR}" --verify $${IS_API_SECURED:-true} --junit-xml "pytest_e2e_$${SELECTOR// /_}.xml"; \ + else \ + python -m pytest -n "${E2E_TESTS_NUMBER_PROCESSES_DEFAULT}" -m "${SELECTOR}" --verify $${IS_API_SECURED:-true} --junit-xml "pytest_e2e_$${SELECTOR// /_}.xml"; fi setup-local-debugging: $(call target_title,"Setting up the ability to debug the API and Resource Processor") \ diff --git a/docs/tre-admins/environment-variables.md b/docs/tre-admins/environment-variables.md index b0208a0b35..ea3392c046 100644 --- a/docs/tre-admins/environment-variables.md +++ b/docs/tre-admins/environment-variables.md @@ -57,4 +57,3 @@ | -------- | ----------- | | `AZURE_CREDENTIALS`| Credentials used to authorize CI/CD workflows to provision resources for the TRE workspaces and workspace services. This is basically your ARM client credentials in json format. Read more about how to create it and its format [here](./setup-instructions/workflows.md##create-a-service principal-for-provisioning-resources)| | `MS_TEAMS_WEBHOOK_URI` | URI for the Teams channel webhook | - | `E2E_TESTS_NUMBER_PROCESSES` | (Optional) Number of processes to run End-to-end tests | diff --git a/e2e_tests/.env.sample b/e2e_tests/.env.sample index 0201fe40e7..8d9199e916 100644 --- a/e2e_tests/.env.sample +++ b/e2e_tests/.env.sample @@ -20,5 +20,5 @@ WORKSPACE_APP_SERVICE_PLAN_SKU="P1v2" TEST_WORKSPACE_ID= TEST_AAD_WORKSPACE_ID=ID of pre-created AAD workspace> -# Uncomment this if you wish to run tests in parallel -# E2E_TESTS_NUMBER_PROCESSES=4 +# Run tests sequentially. Change this value if you want to run tests in parallel locally +E2E_TESTS_NUMBER_PROCESSES=1 diff --git a/e2e_tests/helpers.py b/e2e_tests/helpers.py index ddb237a68c..99c6dd33e0 100644 --- a/e2e_tests/helpers.py +++ b/e2e_tests/helpers.py @@ -85,7 +85,7 @@ async def check_aad_auth_redirect(endpoint, verify) -> None: while (True): try: response = await client.get(url=endpoint, timeout=TIMEOUT) - LOGGER.info(f"Endpoint Response: {response}") + LOGGER.info(f"Endpoint Response: {endpoint} {response}") if response.status_code in terminal_http_status: break