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

Merged
merged 19 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ca8d6ae
adjusting clientid variable to match sds client's original client_id
jpl-btlunsfo May 6, 2025
43ddd4e
missed that sds client also uses unity_user (not name)
jpl-btlunsfo May 6, 2025
fc957ab
changing config a little?
jpl-btlunsfo May 27, 2025
29a73ad
adjusting ogc_processes fixture to respect venue... hopefully
jpl-btlunsfo May 27, 2025
ba59cab
last change worked well, but the auth eventually timed-out polling fo…
jpl-btlunsfo Jun 1, 2025
d8a6c00
adjustmenta, as the SDS client *wrongfully* blanket supresses exceptions
jpl-btlunsfo Jun 3, 2025
d596bd8
trying another workaround because sds_client is bleh
jpl-btlunsfo Jun 3, 2025
e0bbb24
tyring something new; the hackiest we can get, just creating a whole …
jpl-btlunsfo Jun 9, 2025
31aadb8
dropping out hacky workaround, sessions should work as intended now
jpl-btlunsfo Jun 11, 2025
f79502a
Commenting out the dev tests
LucaCinquini Jun 12, 2025
aa96a97
Adding lookup for Unity Environment call
jpl-btlunsfo Jun 12, 2025
17db985
Merge branch '384-fix-integration-tests-cognito' into 384-fix-integra…
LucaCinquini Jun 15, 2025
f444823
Retrieving the ogc_processes before each test starts
LucaCinquini Jun 15, 2025
ca45f13
Back to session scope
LucaCinquini Jun 15, 2025
7a76be0
Runnig Airflow tests on Dev and Test venues
LucaCinquini Jun 16, 2025
78b3d9a
Back to Test venue
LucaCinquini Jun 16, 2025
18a04b4
Adding Airflow tests on Dev venue
LucaCinquini Jun 16, 2025
e9a92e0
Adding OGC tests on Dev venue
LucaCinquini Jun 16, 2025
5266e5d
Commenting out the SBG_ISOFIT cwl_dag_modular for Airflow and OGC APIs
LucaCinquini Jun 17, 2025
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
170 changes: 85 additions & 85 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,41 @@ jobs:
Dev-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 Dev - Integration tests with Airflow API
id: mcp_venue_dev_integration_tests_with_airflow_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_airflow_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_airflow_api.outcome }}
echo "Tests Status: $tests_status"
if [ "$tests_status" != "success" ]; then
echo "Integration Tests with Airflow API on MCP Venue Dev failed."
exit 1
fi

Test-Venue-Airflow-API:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -35,66 +70,66 @@ jobs:
uses: ./.github/actions/setup-action
continue-on-error: false

- name: MCP Venue Dev - Integration tests with Airflow API
id: mcp_venue_dev_integration_tests_with_airflow_api
- name: MCP Venue Test - Integration tests with Airflow API
id: mcp_venue_test_integration_tests_with_airflow_api
continue-on-error: true
env:
UNITY_USERNAME: ${{ secrets.MCP_VENUE_DEV_UNITY_USERNAME }}
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_airflow_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_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

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_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 \
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_airflow_api.outcome }}
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 Airflow API on MCP Venue Dev failed."
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_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

Test-Venue-Airflow-API:
Test-Venue-OGC-API:
runs-on: ubuntu-latest

steps:
Expand All @@ -105,61 +140,26 @@ jobs:
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
- 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_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 \
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_airflow_api.outcome }}
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 Airflow API on MCP Venue Test failed."
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_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
17 changes: 11 additions & 6 deletions unity-test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ def venue(request):

@pytest.fixture(scope="function")
def fetch_token():
print("Fetching a new 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 @@ -131,14 +130,20 @@ 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_envs = {
"dev": UnityEnvironments.DEV,
"test": UnityEnvironments.TEST,
"prod": UnityEnvironments.PROD,
}
unity = Unity(unity_envs[venue] if venue in unity_envs else "")
unity.set_project("unity")
unity.set_venue(venue)
process_service = unity.client(UnityServices.PROCESS_SERVICE)

# retrieve all OGC processes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Feature: Execute CWL workflows using the Airflow API
| SBG_PREPROCESS | cwl_dag |
| EMIT | cwl_dag_modular |
| SBG_PREPROCESS | cwl_dag_modular |
| SBG_ISOFIT | cwl_dag_modular |
# | SBG_ISOFIT | cwl_dag_modular |
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Feature: Execute CWL workflows using the OGC API
| SBG_PREPROCESS | cwl_dag |
| EMIT | cwl_dag_modular |
| SBG_PREPROCESS | cwl_dag_modular |
| SBG_ISOFIT | cwl_dag_modular |
# | SBG_ISOFIT | cwl_dag_modular |