diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 93d006e01..4df0ca290 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -118,7 +118,7 @@ jobs: RUN_REGRESSION_TESTS: true REGRESSION_TEST_PRODUCT: PFP-AWS FORWARD_CSOC_LOGS: false - DEPLOY_APIGEE: false + DEPLOY_APIGEE: true ALLOW_NHS_NUMBER_OVERRIDE: true secrets: REGRESSION_TESTS_PEM: ${{ secrets.REGRESSION_TESTS_PEM }} diff --git a/.github/workflows/run_regression_tests.yml b/.github/workflows/run_regression_tests.yml index c92462e0f..e0c7af117 100644 --- a/.github/workflows/run_regression_tests.yml +++ b/.github/workflows/run_regression_tests.yml @@ -113,44 +113,44 @@ jobs: --regression_test_workflow_tag "${REGRESSION_TEST_WORKFLOW_TAG}" fi - # - name: Run Regression Testing Proxygen API - # working-directory: scripts - # env: - # TARGET_ENVIRONMENT: ${{ inputs.ENVIRONMENT }} - # VERSION_NUMBER: ${{ inputs.VERSION_NUMBER }} - # GITHUB-TOKEN: ${{ steps.generate-token.outputs.token }} - # run: | - # if [[ "$TARGET_ENVIRONMENT" != "prod" && "$TARGET_ENVIRONMENT" != "ref" ]]; then - # REGRESSION_TEST_REPO_TAG="v3.8.19" # This is the tag or branch of the regression test code to run, usually a version tag like v3.1.0 or a branch name - # REGRESSION_TEST_WORKFLOW_TAG="v3.8.19" # This is the tag of the github workflow to run, usually the same as REGRESSION_TEST_REPO_TAG - - # if [[ -z "$REGRESSION_TEST_REPO_TAG" || -z "$REGRESSION_TEST_WORKFLOW_TAG" ]]; then - # echo "Error: One or both tag variables are not set" >&2 - # exit 1 - # fi - - # # HELPER IF STATEMENT - It will automatically determine the correct Git URL to use based on the REGRESSION_TEST_WORKFLOW_TAG value - # if [[ "$REGRESSION_TEST_WORKFLOW_TAG" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then - # echo "REGRESSION_TEST_WORKFLOW_TAG is a version tag, using tag link" - # curl "https://raw.githubusercontent.com/NHSDigital/electronic-prescription-service-api-regression-tests/refs/tags/${REGRESSION_TEST_WORKFLOW_TAG}/scripts/run_regression_tests.py" -o run_regression_tests.py - # else - # echo "REGRESSION_TEST_WORKFLOW_TAG doesn't look like a version tag, using branch link" - # curl "https://raw.githubusercontent.com/NHSDigital/electronic-prescription-service-api-regression-tests/refs/heads/${REGRESSION_TEST_REPO_TAG}/scripts/run_regression_tests.py" -o run_regression_tests.py - # fi - - # if [[ ! -f run_regression_tests.py ]]; then - # echo "Error: run_regression_tests.py not found" >&2 - # exit 1 - # fi - - # poetry install - # echo Running regression tests in the "$TARGET_ENVIRONMENT" environment - # poetry run python -u run_regression_tests.py \ - # --env="$TARGET_ENVIRONMENT" \ - # --pr_label="$VERSION_NUMBER" \ - # --token=${{ steps.generate-token.outputs.token }} \ - # --is_called_from_github=true \ - # --product="PFP-PROXYGEN" \ - # --regression_test_repo_tag "${REGRESSION_TEST_REPO_TAG}" \ - # --regression_test_workflow_tag "${REGRESSION_TEST_WORKFLOW_TAG}" - # fi + - name: Run Regression Testing Proxygen API + working-directory: scripts + env: + TARGET_ENVIRONMENT: ${{ inputs.ENVIRONMENT }} + VERSION_NUMBER: ${{ inputs.VERSION_NUMBER }} + GITHUB-TOKEN: ${{ steps.generate-token.outputs.token }} + run: | + if [[ "$TARGET_ENVIRONMENT" != "prod" && "$TARGET_ENVIRONMENT" != "ref" ]]; then + REGRESSION_TEST_REPO_TAG="v3.8.19" # This is the tag or branch of the regression test code to run, usually a version tag like v3.1.0 or a branch name + REGRESSION_TEST_WORKFLOW_TAG="v3.8.19" # This is the tag of the github workflow to run, usually the same as REGRESSION_TEST_REPO_TAG + + if [[ -z "$REGRESSION_TEST_REPO_TAG" || -z "$REGRESSION_TEST_WORKFLOW_TAG" ]]; then + echo "Error: One or both tag variables are not set" >&2 + exit 1 + fi + + # HELPER IF STATEMENT - It will automatically determine the correct Git URL to use based on the REGRESSION_TEST_WORKFLOW_TAG value + if [[ "$REGRESSION_TEST_WORKFLOW_TAG" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then + echo "REGRESSION_TEST_WORKFLOW_TAG is a version tag, using tag link" + curl "https://raw.githubusercontent.com/NHSDigital/electronic-prescription-service-api-regression-tests/refs/tags/${REGRESSION_TEST_WORKFLOW_TAG}/scripts/run_regression_tests.py" -o run_regression_tests.py + else + echo "REGRESSION_TEST_WORKFLOW_TAG doesn't look like a version tag, using branch link" + curl "https://raw.githubusercontent.com/NHSDigital/electronic-prescription-service-api-regression-tests/refs/heads/${REGRESSION_TEST_REPO_TAG}/scripts/run_regression_tests.py" -o run_regression_tests.py + fi + + if [[ ! -f run_regression_tests.py ]]; then + echo "Error: run_regression_tests.py not found" >&2 + exit 1 + fi + + poetry install + echo Running regression tests in the "$TARGET_ENVIRONMENT" environment + poetry run python -u run_regression_tests.py \ + --env="$TARGET_ENVIRONMENT" \ + --pr_label="$VERSION_NUMBER" \ + --token=${{ steps.generate-token.outputs.token }} \ + --is_called_from_github=true \ + --product="PFP-PROXYGEN" \ + --regression_test_repo_tag "${REGRESSION_TEST_REPO_TAG}" \ + --regression_test_workflow_tag "${REGRESSION_TEST_WORKFLOW_TAG}" + fi diff --git a/.github/workflows/sam_release_code.yml b/.github/workflows/sam_release_code.yml index 27d1be29a..f2261f05e 100644 --- a/.github/workflows/sam_release_code.yml +++ b/.github/workflows/sam_release_code.yml @@ -80,7 +80,7 @@ on: type: string DEPLOY_APIGEE: type: boolean - default: false + default: true MTLS_KEY: type: string required: true