Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
venue specific job values in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhunter-jpl committed Oct 2, 2023
1 parent 07fee54 commit f51f947
Show file tree
Hide file tree
Showing 8 changed files with 259 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"mode": "async",
"response": "document",
"inputs": [
{
"id": "input_ephatt_collection_id",
"data": "urn:nasa:unity:uds_local_test:DEV1:L0_SNPP_EphAtt___1"
},
{
"id": "input_science_collection_id",
"data": "urn:nasa:unity:uds_local_test:DEV1:L0_SNPP_ATMS_SCIENCE___1"
},
{
"id": "output_collection_id",
"data": "urn:nasa:unity:uds_local_test:DEV1:SNDR_SNPP_ATMS_L1A_OUTPUT___1"
},
{
"id": "static_dir",
"data": {
"class": "Directory",
"path": "/tmp/SOUNDER_SIPS/STATIC_DATA"
}
},
{
"id": "start_datetime",
"data": "2016-01-14T08:00:00Z"
},
{
"id": "stop_datetime",
"data": "2016-01-14T11:59:59Z"
}
],
"outputs": [
{
"id": "output",
"transmissionMode": "reference"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"mode": "async",
"response": "document",
"inputs": [
{
"id": "input_ephatt_collection_id",
"data": "L0_SNPP_EphAtt___1"
},
{
"id": "input_science_collection_id",
"data": "L0_SNPP_ATMS_SCIENCE___1"
},
{
"id": "output_collection_id",
"data": "SNDR_SNPP_ATMS_L1A_OUTPUT___1"
},
{
"id": "static_dir",
"data": {
"class": "Directory",
"path": "/tmp/SOUNDER_SIPS/STATIC_DATA"
}
},
{
"id": "start_datetime",
"data": "2016-01-14T08:00:00Z"
},
{
"id": "stop_datetime",
"data": "2016-01-14T11:59:59Z"
}
],
"outputs": [
{
"id": "output",
"transmissionMode": "reference"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"mode": "async",
"response": "document",
"inputs": [
{
"id": "input_collection_id",
"data": "urn:nasa:unity:uds_local_test:DEV1:SNDR_SNPP_ATMS_L1A___1"
},
{
"id": "start_datetime",
"data": "2016-01-14T08:00:00Z"
},
{
"id": "stop_datetime",
"data": "2016-01-14T11:59:59Z"
},
{
"id": "output_collection_id",
"data": "urn:nasa:unity:uds_local_test:DEV1:SNDR_SNPP_ATMS_L1B_OUTPUT___1"
}
],
"outputs": [
{
"id": "output",
"transmissionMode": "reference"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"mode": "async",
"response": "document",
"inputs": [
{
"id": "input_collection_id",
"data": "SNDR_SNPP_ATMS_L1A___1"
},
{
"id": "start_datetime",
"data": "2016-01-14T08:00:00Z"
},
{
"id": "stop_datetime",
"data": "2016-01-14T11:59:59Z"
},
{
"id": "output_collection_id",
"data": "SNDR_SNPP_ATMS_L1B_OUTPUT___1"
}
],
"outputs": [
{
"id": "output",
"transmissionMode": "reference"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"mode": "async",
"response": "document",
"inputs": [
{
"id": "input_processing_labels",
"data": ["label1", "label2"]
},
{
"id": "input_cmr_collection_name",
"data": "C2011289787-GES_DISC"
},
{
"id": "input_cmr_search_start_time",
"data": "2016-08-22T00:10:00Z"
},
{
"id": "input_cmr_search_stop_time",
"data": "2016-08-22T00:11:00Z"
},
{
"id": "input_cmr_edl_user",
"data": "cmr_user"
},
{
"id": "input_cmr_edl_pass",
"data": "cmr_pass"
},
{
"id": "output_collection_id",
"data": "CHIRP_OUTPUT_COLLECTION"
},
{
"id": "output_data_bucket",
"data": "s3://unity-data-bucket"
},
{
"id": "input_daac_collection_shortname",
"data": "CHIRP_L1B"
},
{
"id": "input_daac_collection_sns",
"data": "arn:://SNS-arn"
}
],
"outputs": [
{
"id": "output",
"transmissionMode": "reference"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"mode": "async",
"response": "document",
"inputs": [
{
"id": "input_processing_labels",
"data": ["label1", "label2"]
},
{
"id": "input_cmr_collection_name",
"data": "C2011289787-GES_DISC"
},
{
"id": "input_cmr_search_start_time",
"data": "2016-08-22T00:10:00Z"
},
{
"id": "input_cmr_search_stop_time",
"data": "2016-08-22T00:11:00Z"
},
{
"id": "input_cmr_edl_user",
"data": "cmr_user"
},
{
"id": "input_cmr_edl_pass",
"data": "cmr_pass"
},
{
"id": "output_collection_id",
"data": "CHIRP_OUTPUT_COLLECTION"
},
{
"id": "output_data_bucket",
"data": "s3://unity-data-bucket"
},
{
"id": "input_daac_collection_shortname",
"data": "CHIRP_L1B"
},
{
"id": "input_daac_collection_sns",
"data": "arn:://SNS-arn"
}
],
"outputs": [
{
"id": "output",
"transmissionMode": "reference"
}
]
}
16 changes: 14 additions & 2 deletions unity-test/step_defs/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ def pytest_addoption(parser):
help="The Sounder SIPS processes to test (L1A, L1B, chirp)",
required=True,
)
parser.addoption(
"--environment",
type=str,
action="store",
help="Environment to run test against. (dev, test)",
default=None
)

@pytest.fixture(scope="module", autouse=True)
def process_service_endpoint(request):
Expand All @@ -50,6 +57,10 @@ def sps_api_service_endpoint(request):
def jobs_database_endpoint(request):
return request.config.getoption("--jobs-database-endpoint")

@pytest.fixture()
def environment(request):
return request.config.getoption("--environment")

@pytest.fixture()
def jobs_database_client(jobs_database_endpoint):
return Elasticsearch(jobs_database_endpoint)
Expand All @@ -60,7 +71,7 @@ def projects():
return data

@pytest.fixture
def job_request_body(project_process_dict):
def job_reques(project_process_dict):
return reader.request_body(
project_process_dict["project_name"],
project_process_dict["process_name"],
Expand Down Expand Up @@ -218,11 +229,12 @@ def created_response(response):
"a WPS-T request is made to execute the process",
target_fixture="response",
)
def request_job_execution(process_service_endpoint, project_process_dict):
def request_job_execution(process_service_endpoint, project_process_dict, environment):
request_body = reader.request_body(
project_process_dict["project_name"],
project_process_dict["process_name"],
reader.execution_post_request_body,
environment=environment
)
job_execution_response = _request_job_execution(
process_service_endpoint, project_process_dict["process_name"], request_body
Expand Down
11 changes: 7 additions & 4 deletions unity-test/step_defs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ def __init__(self):
self.execution_post_request_body = "execution_post_request_body.json"
self.start_prewarm_post_request_body = "start_prewarm_post_request_body.json"

def request_body(self, project_name, process_name, request_body_filename):
data_file_path = self.data_dir.joinpath(
project_name, process_name, request_body_filename
)
def request_body(self, project_name, process_name, request_body_filename, environment=None):
if environment:
data_file_path = [project_name, process_name, environment, request_body_filename]
else:
data_file_path = [project_name, process_name, request_body_filename]

data_file_path = self.data_dir.joinpath(*data_file_path)

if not data_file_path.exists():
raise ValueError(f"Data file not found: {data_file_path}")
Expand Down

0 comments on commit f51f947

Please sign in to comment.