Skip to content

Commit

Permalink
Merge pull request #323 from unity-sds/302-add_test_for_cwl_modular_dag
Browse files Browse the repository at this point in the history
Add tests for CWL modular DAG
  • Loading branch information
LucaCinquini authored Feb 20, 2025
2 parents a1ee141 + ecd5202 commit 7b365c4
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 169 deletions.
138 changes: 69 additions & 69 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,72 +92,72 @@ jobs:
exit 1
fi
Test-Venue-Airflow-API:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup-action
continue-on-error: false

- name: MCP Venue Test - Integration tests with Airflow API
id: mcp_venue_test_integration_tests_with_airflow_api
continue-on-error: true
env:
AIRFLOW_WEBSERVER_PASSWORD: ${{ secrets.MCP_VENUE_TEST_AIRFLOW_WEBSERVER_PASSWORD }}
UNITY_USER: ${{ secrets.UNITY_USER }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
run: |
pytest -vv -s --gherkin-terminal-reporter \
unity-test/system/integration/step_defs/test_cwl_workflows_with_airflow_api.py \
--venue="test" \
--airflow-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_AIRFLOW_ENDPOINT || vars.MCP_VENUE_TEST_AIRFLOW_ENDPOINT }} \
--ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT || vars.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT }}
- name: Check Tests Results
if: always()
run: |
tests_status=${{ steps.mcp_venue_test_integration_tests_with_airflow_api.outcome }}
echo "Tests Status: $tests_status"
if [ "$tests_status" != "success" ]; then
echo "Integration Tests with Airflow API on MCP Venue Test failed."
exit 1
fi
Test-Venue-OGC-API:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup-action
continue-on-error: false

- name: MCP Venue Test - Integration tests with OGC API
id: mcp_venue_test_integration_tests_with_ogc_api
continue-on-error: true
env:
AIRFLOW_WEBSERVER_PASSWORD: ${{ secrets.MCP_VENUE_TEST_AIRFLOW_WEBSERVER_PASSWORD }}
UNITY_USER: ${{ secrets.UNITY_USER }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
run: |
pytest -vv -s --gherkin-terminal-reporter \
unity-test/system/integration/step_defs/test_cwl_workflows_with_ogc_api.py \
--venue="test" \
--airflow-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_AIRFLOW_ENDPOINT || vars.MCP_VENUE_TEST_AIRFLOW_ENDPOINT }} \
--ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT || vars.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT }}
- name: Check Tests Results
if: always()
run: |
tests_status=${{ steps.mcp_venue_test_integration_tests_with_ogc_api.outcome }}
echo "Tests Status: $tests_status"
if [ "$tests_status" != "success" ]; then
echo "Integration Tests with OGC API on MCP Venue Test failed."
exit 1
fi
# Test-Venue-Airflow-API:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Setup
# uses: ./.github/actions/setup-action
# continue-on-error: false
#
# - name: MCP Venue Test - Integration tests with Airflow API
# id: mcp_venue_test_integration_tests_with_airflow_api
# continue-on-error: true
# env:
# AIRFLOW_WEBSERVER_PASSWORD: ${{ secrets.MCP_VENUE_TEST_AIRFLOW_WEBSERVER_PASSWORD }}
# UNITY_USER: ${{ secrets.UNITY_USER }}
# UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
# run: |
# pytest -vv -s --gherkin-terminal-reporter \
# unity-test/system/integration/step_defs/test_cwl_workflows_with_airflow_api.py \
# --venue="test" \
# --airflow-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_AIRFLOW_ENDPOINT || vars.MCP_VENUE_TEST_AIRFLOW_ENDPOINT }} \
# --ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT || vars.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT }}

# - name: Check Tests Results
# if: always()
# run: |
# tests_status=${{ steps.mcp_venue_test_integration_tests_with_airflow_api.outcome }}
# echo "Tests Status: $tests_status"
# if [ "$tests_status" != "success" ]; then
# echo "Integration Tests with Airflow API on MCP Venue Test failed."
# exit 1
# fi
#
# Test-Venue-OGC-API:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Setup
# uses: ./.github/actions/setup-action
# continue-on-error: false
#
# - name: MCP Venue Test - Integration tests with OGC API
# id: mcp_venue_test_integration_tests_with_ogc_api
# continue-on-error: true
# env:
# AIRFLOW_WEBSERVER_PASSWORD: ${{ secrets.MCP_VENUE_TEST_AIRFLOW_WEBSERVER_PASSWORD }}
# UNITY_USER: ${{ secrets.UNITY_USER }}
# UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
# run: |
# pytest -vv -s --gherkin-terminal-reporter \
# unity-test/system/integration/step_defs/test_cwl_workflows_with_ogc_api.py \
# --venue="test" \
# --airflow-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_AIRFLOW_ENDPOINT || vars.MCP_VENUE_TEST_AIRFLOW_ENDPOINT }} \
# --ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT || vars.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT }}
#
# - name: Check Tests Results
# if: always()
# run: |
# tests_status=${{ steps.mcp_venue_test_integration_tests_with_ogc_api.outcome }}
# echo "Tests Status: $tests_status"
# if [ "$tests_status" != "success" ]; then
# echo "Integration Tests with OGC API on MCP Venue Test failed."
# exit 1
# fi
48 changes: 36 additions & 12 deletions .github/workflows/smoke_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ on:
MCP_VENUE_SBG_DEV_OGC_PROCESSES_ENDPOINT:
description: "Base URL for the OGC Processes API endpoint in MCP Venue SBG Dev (i.e. http://abc.def.ghi:port-number)"
type: string
MCP_VENUE_EMIT_INT_AIRFLOW_ENDPOINT:
description: "Base URL for the Airflow endpoint in MCP Venue EMIT InT (i.e. http://abc.def.ghi:port-number)"
type: string
MCP_VENUE_EMIT_INT_OGC_PROCESSES_ENDPOINT:
description: "Base URL for the OGC Processes API endpoint in MCP Venue EMIT InT (i.e. http://abc.def.ghi:port-number)"
type: string

jobs:
smoke-tests:
Expand Down Expand Up @@ -58,16 +64,16 @@ jobs:
--airflow-endpoint=${{ github.event.inputs.MCP_VENUE_DEV_AIRFLOW_ENDPOINT || vars.MCP_VENUE_DEV_AIRFLOW_ENDPOINT }} \
--ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_DEV_OGC_PROCESSES_ENDPOINT || vars.MCP_VENUE_DEV_OGC_PROCESSES_ENDPOINT }}
- name: MCP Venue Test - Smoke tests
id: mcp_venue_test_smoke_tests
env:
AIRFLOW_WEBSERVER_PASSWORD: ${{ secrets.MCP_VENUE_TEST_AIRFLOW_WEBSERVER_PASSWORD }}
continue-on-error: true
run: |
pytest -vv --gherkin-terminal-reporter \
unity-test/system/smoke \
--airflow-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_AIRFLOW_ENDPOINT || vars.MCP_VENUE_TEST_AIRFLOW_ENDPOINT }} \
--ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT || vars.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT }}
# - name: MCP Venue Test - Smoke tests
# id: mcp_venue_test_smoke_tests
# env:
# AIRFLOW_WEBSERVER_PASSWORD: ${{ secrets.MCP_VENUE_TEST_AIRFLOW_WEBSERVER_PASSWORD }}
# continue-on-error: true
# run: |
# pytest -vv --gherkin-terminal-reporter \
# unity-test/system/smoke \
# --airflow-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_AIRFLOW_ENDPOINT || vars.MCP_VENUE_TEST_AIRFLOW_ENDPOINT }} \
# --ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT || vars.MCP_VENUE_TEST_OGC_PROCESSES_ENDPOINT }}

- name: MCP Venue Ops - Smoke tests
id: mcp_venue_ops_smoke_tests
Expand All @@ -91,21 +97,36 @@ jobs:
--airflow-endpoint=${{ github.event.inputs.MCP_VENUE_SBG_DEV_AIRFLOW_ENDPOINT || vars.MCP_VENUE_SBG_DEV_AIRFLOW_ENDPOINT }} \
--ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_SBG_DEV_OGC_PROCESSES_ENDPOINT || vars.MCP_VENUE_SBG_DEV_OGC_PROCESSES_ENDPOINT }}
- name: MCP EMIT InT - Smoke tests
id: mcp_emit_int_smoke_tests
env:
AIRFLOW_WEBSERVER_PASSWORD: ${{ secrets.MCP_VENUE_EMIT_INT_AIRFLOW_WEBSERVER_PASSWORD }}
continue-on-error: true
run: |
pytest -vv --gherkin-terminal-reporter \
unity-test/system/smoke \
--airflow-endpoint=${{ github.event.inputs.MCP_VENUE_EMIT_INT_AIRFLOW_ENDPOINT || vars.MCP_VENUE_EMIT_INT_AIRFLOW_ENDPOINT }} \
--ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_EMIT_INT_OGC_PROCESSES_ENDPOINT || vars.MCP_VENUE_EMIT_INT_OGC_PROCESSES_ENDPOINT }}
# Final step to check outcomes and potentially fail the job
- name: Check Smoke Tests Results
if: always()
run: |
dev_status=${{ steps.mcp_venue_dev_smoke_tests.outcome }}
test_status=${{ steps.mcp_venue_test_smoke_tests.outcome }}
# test_status=${{ steps.mcp_venue_test_smoke_tests.outcome }}
sbg_dev_status=${{ steps.mcp_sbg_dev_smoke_tests.outcome }}
emit_int_status=${{ steps.mcp_emit_int_smoke_tests.outcome }}
ops_status=${{ steps.mcp_venue_ops_smoke_tests.outcome }}
echo "Dev Smoke Tests: $dev_status"
echo "Test Smoke Tests: $test_status"
echo "SBG Dev Smoke Tests: $sbg_dev_status"
echo "EMIT InT Smoke Tests: $emit_int_status"
echo "Ops Smoke Tests: $ops_status"
if [ "$dev_status" != "success" ] || [ "$test_status" != "success" ] \
# if [ "$dev_status" != "success" ] || [ "$test_status" != "success" ] \
if [ "$dev_status" != "success" ] \
|| [ "$sbg_dev_status" != "success" ] \
|| [ "$emit_int_status" != "success" ] \
|| [ "$ops_status" != "success" ]; then
echo "One or more smoke tests failed."
if [ "$dev_status" != "success" ]; then
Expand All @@ -117,6 +138,9 @@ jobs:
if [ "$sbg_dev_status" != "success" ]; then
echo "MCP Venue SBG Dev Smoke Tests failed."
fi
if [ "$emit_int_status" != "success" ]; then
echo "MCP Venue EMIT InT Tests failed."
fi
if [ "$ops_status" != "success" ]; then
echo "MCP Venue Ops Smoke Tests failed."
fi
Expand Down
14 changes: 13 additions & 1 deletion unity-test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,22 @@ def ogc_processes(ogc_processes_api_url):
@pytest.fixture(scope="session")
def cwl_dag_process(ogc_processes):
"""
Selects the CWL DAG from the list of available OGC processes
Selects the CWL classic DAG from the list of available OGC processes
"""

for p in ogc_processes:
if p.id == "cwl_dag":
return p
return None


@pytest.fixture(scope="session")
def cwl_dag_modular_process(ogc_processes):
"""
Selects the CWL modular DAG from the list of available OGC processes
"""

for p in ogc_processes:
if p.id == "cwl_dag_modular":
return p
return None
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ Feature: Execute CWL workflows using the Airflow API

Scenario Outline: Successful execution of a CWL workflow with the Airflow API
Given the Airflow API is up and running
When I trigger a dag run for the <test_case> workflow
When I trigger a dag run for the <test_case> workflow using the <test_dag> DAG
Then I receive a response with status code 200
And I see an eventual successful dag run

Examples:
| test_case |
| EMIT |
| SBG_E2E_SCALE |
| SBG_PREPROCESS |
| test_case | test_dag |
| EMIT | cwl_dag_modular |
| EMIT | cwl_dag |
| SBG_E2E_SCALE | cwl_dag |
| SBG_PREPROCESS | cwl_dag |
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ Feature: Execute CWL workflows using the OGC API

Scenario Outline: Successful execution of a CWL workflow with the OGC API
Given the OGC API is up and running
When I trigger an OGC job for the <test_case> OGC process
When I trigger a <test_case> OGC job for the <test_dag> OGC process
Then the job starts executing
And I see an eventual successful job

Examples:
| test_case |
| SBG_PREPROCESS |
| EMIT |
| SBG_E2E_SCALE |
| test_case | test_dag |
| EMIT | cwl_dag |
| SBG_E2E_SCALE | cwl_dag |
| SBG_PREPROCESS | cwl_dag |
| EMIT | cwl_dag_modular |
Loading

0 comments on commit 7b365c4

Please sign in to comment.