Skip to content

Commit 9b6f966

Browse files
committed
Enabling all tests
1 parent b4c3ac6 commit 9b6f966

File tree

4 files changed

+70
-21
lines changed

4 files changed

+70
-21
lines changed

unity-test/conftest.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,22 @@ def ogc_processes(ogc_processes_api_url):
127127
@pytest.fixture(scope="session")
128128
def cwl_dag_process(ogc_processes):
129129
"""
130-
Selects the CWL DAG from the list of available OGC processes
130+
Selects the CWL classic DAG from the list of available OGC processes
131131
"""
132132

133133
for p in ogc_processes:
134134
if p.id == "cwl_dag":
135135
return p
136136
return None
137+
138+
139+
@pytest.fixture(scope="session")
140+
def cwl_dag_modular_process(ogc_processes):
141+
"""
142+
Selects the CWL modular DAG from the list of available OGC processes
143+
"""
144+
145+
for p in ogc_processes:
146+
if p.id == "cwl_dag_modular":
147+
return p
148+
return None

unity-test/system/integration/features/cwl_workflows_with_airflow_api.feature

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ Feature: Execute CWL workflows using the Airflow API
1313

1414
Examples:
1515
| test_case | test_dag |
16-
| EMIT | cwl_dag |
1716
| EMIT | cwl_dag_modular |
17+
| EMIT | cwl_dag |
18+
| SBG_E2E_SCALE | cwl_dag |
19+
| SBG_PREPROCESS | cwl_dag |

unity-test/system/integration/features/cwl_workflows_with_ogc_api.feature

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ Feature: Execute CWL workflows using the OGC API
77

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

1414
Examples:
15-
| test_case |
16-
| SBG_PREPROCESS |
17-
| EMIT |
18-
| SBG_E2E_SCALE |
15+
| test_case | test_dag |
16+
| EMIT | cwl_dag |
17+
| SBG_E2E_SCALE | cwl_dag |
18+
| SBG_PREPROCESS | cwl_dag |
19+
| EMIT | cwl_dag_modular |

unity-test/system/integration/step_defs/test_cwl_workflows_with_ogc_api.py

+48-14
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# and it is invoked via the OGC API.
66
# The CWL task is executed via a KubernetesPodOperator on a worker node
77
# that is dynamically provisioned by Karpenter.
8+
import json
89
from pathlib import Path
910

1011
import backoff
@@ -18,8 +19,9 @@
1819
FEATURE_FILE: Path = FEATURES_DIR / "cwl_workflows_with_ogc_api.feature"
1920

2021
# DAG parameters are venue specific
21-
DAG_ID = "cwl_dag"
22-
DATA = {
22+
CWL_DAG_ID = "cwl_dag"
23+
CWL_DAG_MODULAR_ID = "cwl_dag_modular"
24+
CWL_DAG_DATA = {
2325
"EMIT": {
2426
"inputs": {
2527
"cwl_workflow": "http://awslbdockstorestack-lb-1429770210.us-west-2.elb.amazonaws.com:9998/api/ga4gh/trs/v2/tools/%23workflow%2Fdockstore.org%2FGodwinShen%2Femit-ghg/versions/9/plain-CWL/descriptor/workflow.cwl",
@@ -68,6 +70,27 @@
6870
},
6971
}
7072

73+
CWL_DAG_MODULAR_DATA = {
74+
"EMIT": {
75+
"inputs": {
76+
"cwl_workflow_stage_in": "https://raw.githubusercontent.com/unity-sds/unity-data-services/refs/heads/cwl-examples/cwl/stage-in-daac/stage-in.cwl",
77+
"stac_json": "https://raw.githubusercontent.com/unity-sds/unity-tutorial-application/refs/heads/main/test/stage_in/stage_in_results.json",
78+
"cwl_workflow_process": "https://raw.githubusercontent.com/mike-gangl/unity-OGC-example-application/refs/heads/main/process.cwl",
79+
"job_args_process": json.dumps({"example_argument_empty": ""}),
80+
"cwl_workflow_stage_out": "https://raw.githubusercontent.com/unity-sds/unity-data-services/refs/heads/cwl-examples/cwl/stage-out-stac-catalog/stage-out.cwl",
81+
"job_args_stage_out": {
82+
"dev": json.dumps(
83+
{"project": "unity", "venue": "dev", "staging_bucket": "unity-dev-unity-storage"}
84+
)
85+
},
86+
"request_storage": "10Gi",
87+
"request_instance_type": "t3.medium",
88+
"use_ecr": False,
89+
},
90+
"outputs": {"result": {"transmissionMode": "reference"}},
91+
},
92+
}
93+
7194

7295
@scenario(FEATURE_FILE, "Successful execution of a CWL workflow with the OGC API")
7396
def test_successful_execution_of_a_cwl_workflow_with_the_ogc_api():
@@ -79,24 +102,35 @@ def api_up_and_running(ogc_processes):
79102
assert ogc_processes is not None and len(ogc_processes) > 0
80103

81104

82-
@when(parsers.parse("I trigger an OGC job for the {test_case} OGC process"), target_fixture="job")
83-
def trigger_process(cwl_dag_process, venue, test_case):
105+
@when(parsers.parse("I trigger a {test_case} OGC job for the {test_dag} OGC process"), target_fixture="job")
106+
def trigger_process(cwl_dag_process, cwl_dag_modular_process, venue, test_case, test_dag):
84107

85-
print(cwl_dag_process)
86-
assert cwl_dag_process is not None
108+
# check that this test_case and test_dag are enabled for the specified venue
109+
ogc_process = None
110+
payload = None
111+
try:
87112

88-
# check that this test_case is enabled for the specified venue
89-
if venue in DATA[test_case]["inputs"]["cwl_args"]:
90-
payload = DATA[test_case]
91-
# choose the "cwl_args" specific to the current venue
92-
payload["inputs"]["cwl_args"] = payload["inputs"]["cwl_args"][venue]
113+
if test_dag == CWL_DAG_ID:
114+
ogc_process = cwl_dag_process
115+
payload = CWL_DAG_DATA[test_case]
116+
payload["inputs"]["cwl_args"] = payload["inputs"]["cwl_args"][venue]
117+
elif test_dag == CWL_DAG_MODULAR_ID:
118+
ogc_process = cwl_dag_modular_process
119+
payload = CWL_DAG_MODULAR_DATA[test_case]
120+
payload["inputs"]["job_args_stage_out"] = payload["inputs"]["job_args_stage_out"][venue]
121+
122+
print(ogc_process)
123+
assert ogc_process is not None
93124
print(payload)
94-
job = cwl_dag_process.execute(payload)
125+
assert payload is not None
126+
127+
# submit job
128+
job = ogc_process.execute(payload)
95129
assert job is not None
96130
return job
97131

98-
else:
99-
print(f"Test case: {test_case} is NOT enabled for venue: {venue}, skipping")
132+
except KeyError:
133+
print(f"Test case: {test_case} and Test DAG: {test_dag} are NOT enabled for venue: {venue}")
100134
return None
101135

102136

0 commit comments

Comments
 (0)