Skip to content

Commit

Permalink
Remove secret for setting up E2E parallelism (#2872)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanya-borisova authored Nov 16, 2022
1 parent 81b4230 commit 885813a
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .github/actions/devcontainer_run_command/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy_tre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
1 change: 0 additions & 1 deletion .github/workflows/deploy_tre_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
4 changes: 0 additions & 4 deletions .github/workflows/deploy_tre_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()
Expand Down
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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..."

Expand Down Expand Up @@ -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") \
Expand Down
1 change: 0 additions & 1 deletion docs/tre-admins/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
4 changes: 2 additions & 2 deletions e2e_tests/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ WORKSPACE_APP_SERVICE_PLAN_SKU="P1v2"
TEST_WORKSPACE_ID=<ID of pre-created workspace>
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
2 changes: 1 addition & 1 deletion e2e_tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 885813a

Please sign in to comment.