Skip to content

Fixing OGC integration tests for Cognito #407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
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
146 changes: 73 additions & 73 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
id: mcp_venue_dev_integration_tests_with_airflow_api
continue-on-error: true
env:
UNITY_USERNAME: ${{ secrets.MCP_VENUE_DEV_UNITY_USERNAME }}
UNITY_USER: ${{ secrets.MCP_VENUE_DEV_UNITY_USERNAME }}
UNITY_PASSWORD: ${{ secrets.MCP_VENUE_DEV_UNITY_PASSWORD }}
UNITY_CLIENTID: ${{ secrets.MCP_VENUE_DEV_UNITY_CLIENTID }}
UNITY_CLIENT_ID: ${{ secrets.MCP_VENUE_DEV_UNITY_CLIENTID }}
run: |
pytest -vv -s --gherkin-terminal-reporter \
unity-test/system/integration/step_defs/test_cwl_workflows_with_airflow_api.py \
Expand All @@ -57,40 +57,40 @@ jobs:
exit 1
fi

# Dev-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 Dev - Integration tests with OGC API
# id: mcp_venue_dev_integration_tests_with_ogc_api
# continue-on-error: true
# env:
# UNITY_USERNAME: ${{ secrets.MCP_VENUE_DEV_UNITY_USERNAME }}
# UNITY_PASSWORD: ${{ secrets.MCP_VENUE_DEV_UNITY_PASSWORD }}
# UNITY_CLIENTID: ${{ secrets.MCP_VENUE_DEV_UNITY_CLIENTID }}
# run: |
# pytest -vv -s --gherkin-terminal-reporter \
# unity-test/system/integration/step_defs/test_cwl_workflows_with_ogc_api.py \
# --venue="dev" \
# --airflow-endpoint=${{ github.event.inputs.MCP_VENUE_DEV_AIRFLOW_API_ENDPOINT || vars.MCP_VENUE_DEV_AIRFLOW_API_ENDPOINT }} \
# --ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_DEV_OGC_PROCESSES_API_ENDPOINT || vars.MCP_VENUE_DEV_OGC_PROCESSES_API_ENDPOINT }}
#
# - name: Check Tests Results
# if: always()
# run: |
# tests_status=${{ steps.mcp_venue_dev_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 Dev failed."
# exit 1
# fi
Dev-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 Dev - Integration tests with OGC API
id: mcp_venue_dev_integration_tests_with_ogc_api
continue-on-error: true
env:
UNITY_USER: ${{ secrets.MCP_VENUE_DEV_UNITY_USERNAME }}
UNITY_PASSWORD: ${{ secrets.MCP_VENUE_DEV_UNITY_PASSWORD }}
UNITY_CLIENT_ID: ${{ secrets.MCP_VENUE_DEV_UNITY_CLIENTID }}
run: |
pytest -vv -s --gherkin-terminal-reporter \
unity-test/system/integration/step_defs/test_cwl_workflows_with_ogc_api.py \
--venue="dev" \
--airflow-endpoint=${{ github.event.inputs.MCP_VENUE_DEV_AIRFLOW_API_ENDPOINT || vars.MCP_VENUE_DEV_AIRFLOW_API_ENDPOINT }} \
--ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_DEV_OGC_PROCESSES_API_ENDPOINT || vars.MCP_VENUE_DEV_OGC_PROCESSES_API_ENDPOINT }}

- name: Check Tests Results
if: always()
run: |
tests_status=${{ steps.mcp_venue_dev_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 Dev failed."
exit 1
fi

Test-Venue-Airflow-API:
runs-on: ubuntu-latest
Expand All @@ -107,9 +107,9 @@ jobs:
id: mcp_venue_test_integration_tests_with_airflow_api
continue-on-error: true
env:
UNITY_USERNAME: ${{ secrets.MCP_VENUE_TEST_UNITY_USERNAME }}
UNITY_USER: ${{ secrets.MCP_VENUE_TEST_UNITY_USERNAME }}
UNITY_PASSWORD: ${{ secrets.MCP_VENUE_TEST_UNITY_PASSWORD }}
UNITY_CLIENTID: ${{ secrets.MCP_VENUE_TEST_UNITY_CLIENTID }}
UNITY_CLIENT_ID: ${{ secrets.MCP_VENUE_TEST_UNITY_CLIENTID }}
run: |
pytest -vv -s --gherkin-terminal-reporter \
unity-test/system/integration/step_defs/test_cwl_workflows_with_airflow_api.py \
Expand All @@ -126,38 +126,38 @@ jobs:
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:
# UNITY_USERNAME: ${{ secrets.MCP_VENUE_TEST_UNITY_USERNAME }}
# UNITY_PASSWORD: ${{ secrets.MCP_VENUE_TEST_UNITY_PASSWORD }}
# UNITY_CLIENTID: ${{ secrets.MCP_VENUE_TEST_UNITY_CLIENTID }}
# 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_API_ENDPOINT || vars.MCP_VENUE_TEST_AIRFLOW_API_ENDPOINT }} \
# --ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_OGC_PROCESSES_API_ENDPOINT || vars.MCP_VENUE_TEST_OGC_PROCESSES_API_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-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:
UNITY_USER: ${{ secrets.MCP_VENUE_TEST_UNITY_USERNAME }}
UNITY_PASSWORD: ${{ secrets.MCP_VENUE_TEST_UNITY_PASSWORD }}
UNITY_CLIENT_ID: ${{ secrets.MCP_VENUE_TEST_UNITY_CLIENTID }}
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_API_ENDPOINT || vars.MCP_VENUE_TEST_AIRFLOW_API_ENDPOINT }} \
--ogc-processes-endpoint=${{ github.event.inputs.MCP_VENUE_TEST_OGC_PROCESSES_API_ENDPOINT || vars.MCP_VENUE_TEST_OGC_PROCESSES_API_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
9 changes: 5 additions & 4 deletions unity-test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ def venue(request):

@pytest.fixture(scope="session")
def fetch_token():
username = os.getenv("UNITY_USERNAME")
username = os.getenv("UNITY_USER")
password = os.getenv("UNITY_PASSWORD")
client_id = os.getenv("UNITY_CLIENTID")
client_id = os.getenv("UNITY_CLIENT_ID")
region = "us-west-2"
url = f"https://cognito-idp.{region}.amazonaws.com"
payload = {
Expand Down Expand Up @@ -130,14 +130,15 @@ def eks_cluster_name(resource_name_template):


@pytest.fixture(scope="session")
def ogc_processes(ogc_processes_api_url):
def ogc_processes(ogc_processes_api_url, venue):
"""
Retrieves the OGC processes available from the given endpoint.
"""

# setup Unity venue
unity = Unity(UnityEnvironments.DEV)
unity.set_venue_id("")
unity.set_project("unity")
unity.set_venue(venue)
process_service = unity.client(UnityServices.PROCESS_SERVICE)

# retrieve all OGC processes
Expand Down