Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions .github/workflows/deploy-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,22 @@ on:
required: false
default: false
type: boolean
run_e2e_tests:
description: 'Run End-to-End Tests'
required: false
default: true
type: boolean

cleanup_resources:
description: 'Cleanup Deployed Resources'
required: false
default: false
type: boolean

run_e2e_tests:
description: 'Run End-to-End Tests'
required: false
default: 'GoldenPath-Testing'
type: choice
options:
- 'GoldenPath-Testing'
- 'Smoke-Testing'
- 'None'

AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
description: 'Log Analytics Workspace ID (Optional)'
Expand Down Expand Up @@ -78,7 +84,7 @@ env:
WAF_ENABLED: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.waf_enabled || false) || false }}
EXP: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.EXP || false) || false }}
CLEANUP_RESOURCES: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.cleanup_resources || true) || true }}
RUN_E2E_TESTS: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.run_e2e_tests || true) || true }}
RUN_E2E_TESTS: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.run_e2e_tests || 'GoldenPath-Testing') || 'GoldenPath-Testing' }}
BUILD_DOCKER_IMAGE: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build_docker_image || false) || false }}

jobs:
Expand Down Expand Up @@ -418,8 +424,8 @@ jobs:
elif [[ "$BRANCH_NAME" == "dependabotchanges" ]]; then
BASE_TAG="dependabotchanges"
else
IMAGE_TAG="pullrequest-ignore"
echo "Using default for branch '$BRANCH_NAME' - image tag: pullrequest-ignore"
IMAGE_TAG="latest"
echo "Using default for branch '$BRANCH_NAME' - image tag: latest"
fi

echo "Using existing Docker image tag: $IMAGE_TAG"
Expand Down Expand Up @@ -564,7 +570,7 @@ jobs:


# Export variables only after successful deploy
export CONTAINER_API_APPURL=$(echo "$DEPLOY_OUTPUT" | jq -r '.CONTAINER_API_APP_FQDN // empty')
export CONTAINER_API_APPURL="https://$(echo "$DEPLOY_OUTPUT" | jq -r '.CONTAINER_API_APP_FQDN // empty')"
echo "CONTAINER_API_APPURL=$CONTAINER_API_APPURL" >> $GITHUB_ENV

export CONTAINER_API_APPNAME=$(echo "$DEPLOY_OUTPUT" | jq -r '.CONTAINER_API_APP_NAME // empty')
Expand Down Expand Up @@ -648,11 +654,12 @@ jobs:
fi

e2e-test:
if: always() && ((needs.deploy.result == 'success' && needs.deploy.outputs.CONTAINER_WEB_APPURL != '') || (github.event.inputs.existing_webapp_url != '' && github.event.inputs.existing_webapp_url != null)) && (github.event_name != 'workflow_dispatch' || github.event.inputs.run_e2e_tests == 'true' || github.event.inputs.run_e2e_tests == null)
if: always() && ((needs.deploy.result == 'success' && needs.deploy.outputs.CONTAINER_WEB_APPURL != '') || (github.event.inputs.existing_webapp_url != '' && github.event.inputs.existing_webapp_url != null)) && (github.event_name != 'workflow_dispatch' || (github.event.inputs.run_e2e_tests != 'none' && github.event.inputs.run_e2e_tests != '' && github.event.inputs.run_e2e_tests != null))
needs: [docker-build, deploy]
uses: ./.github/workflows/test-automation-v2.yml
with:
CP_WEB_URL: ${{ needs.deploy.outputs.CONTAINER_WEB_APPURL || github.event.inputs.existing_webapp_url }}
TEST_SUITE: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.run_e2e_tests || 'GoldenPath-Testing' }}
secrets: inherit

cleanup-deployment:
Expand Down
33 changes: 29 additions & 4 deletions .github/workflows/test-automation-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
required: true
type: string
description: "Web URL for Content Processing"
TEST_SUITE:
required: false
type: string
default: "GoldenPath-Testing"
description: "Test suite to run: 'Smoke-Testing', 'GoldenPath-Testing' "
secrets:
EMAILNOTIFICATION_LOGICAPP_URL_TA:
required: false
Expand All @@ -22,6 +27,7 @@ on:
env:
url: ${{ inputs.CP_WEB_URL }}
accelerator_name: "Content Processing"
test_suite: ${{ inputs.TEST_SUITE }}

jobs:
test:
Expand Down Expand Up @@ -58,6 +64,7 @@ jobs:
exit 1
fi
echo "Testing URL: ${{ env.url }}"
echo "Test Suite: ${{ env.test_suite }}"


- name: Wait for Application to be Ready
Expand Down Expand Up @@ -87,7 +94,11 @@ jobs:
- name: Run tests(1)
id: test1
run: |
xvfb-run pytest --headed --html=report/report.html --self-contained-html
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
xvfb-run pytest -m gp --headed --html=report/report.html --self-contained-html
else
xvfb-run pytest --headed --html=report/report.html --self-contained-html
fi
working-directory: tests/e2e-test
continue-on-error: true

Expand All @@ -100,7 +111,11 @@ jobs:
id: test2
if: ${{ steps.test1.outcome == 'failure' }}
run: |
xvfb-run pytest --headed --html=report/report.html --self-contained-html
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
xvfb-run pytest -m gp --headed --html=report/report.html --self-contained-html
else
xvfb-run pytest --headed --html=report/report.html --self-contained-html
fi
working-directory: tests/e2e-test
continue-on-error: true

Expand All @@ -113,7 +128,11 @@ jobs:
id: test3
if: ${{ steps.test2.outcome == 'failure' }}
run: |
xvfb-run pytest --headed --html=report/report.html --self-contained-html
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
xvfb-run pytest -m gp --headed --html=report/report.html --self-contained-html
else
xvfb-run pytest --headed --html=report/report.html --self-contained-html
fi
working-directory: tests/e2e-test

- name: Upload test report
Expand All @@ -127,7 +146,12 @@ jobs:
- name: Generate E2E Test Summary
if: always()
run: |
echo "## 🧪 E2E Test Job Summary" >> $GITHUB_STEP_SUMMARY
# Determine test suite type for title
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
echo "## 🧪 E2E Test Job Summary : Golden Path Testing" >> $GITHUB_STEP_SUMMARY
else
echo "## 🧪 E2E Test Job Summary : Smoke Testing" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
Expand All @@ -141,6 +165,7 @@ jobs:
fi

echo "| **Target URL** | [${{ env.url }}](${{ env.url }}) |" >> $GITHUB_STEP_SUMMARY
echo "| **Test Suite** | \`${{ env.test_suite }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| **Test Report** | [Download Artifact](${{ steps.upload_report.outputs.artifact-url }}) |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

Expand Down
2 changes: 2 additions & 0 deletions tests/e2e-test/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ log_file = logs/tests.log
log_file_level = INFO
addopts = -p no:warnings --tb=short

markers =
gp: Golden Path tests
2 changes: 1 addition & 1 deletion tests/e2e-test/tests/test_contentProcessing_gp_tc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

logger = logging.getLogger(__name__)


@pytest.mark.gp
def test_content_processing_golden_path(login_logout, request):
"""
Content Processing - Validate Golden path works as expected
Expand Down
Loading