@@ -4121,9 +4121,53 @@ def item_json(path):
4121
4121
" https://openeo.test/openeo/jobs/j-2402094545c945c09e1307503aa58a3a/results?partial=true: finished"
4122
4122
in caplog .messages )
4123
4123
4124
- def test_load_stac_from_unsigned_partial_job_results (self ):
4124
+ @gps_config_overrides (job_dependencies_poll_interval_seconds = 0 )
4125
+ def test_load_stac_from_unsigned_partial_job_results_basic (self , api110 , batch_job_output_root , zk_job_registry ,
4126
+ backend_implementation , caplog ):
4125
4127
"""load_stac from partial job results Collection (unsigned case)"""
4126
- raise NotImplementedError ("TODO" )
4128
+
4129
+ caplog .set_level ("DEBUG" )
4130
+
4131
+ # get results from own batch job rather than crawl signed STAC URLs
4132
+ _setup_existing_job (
4133
+ job_id = "j-2405078f40904a0b85cf8dc5dd55b07e" ,
4134
+ api = api110 ,
4135
+ batch_job_output_root = batch_job_output_root ,
4136
+ zk_job_registry = zk_job_registry
4137
+ )
4138
+
4139
+ process_graph = {
4140
+ "loadstac1" : {
4141
+ "process_id" : "load_stac" ,
4142
+ "arguments" : {
4143
+ "url" : "https://openeo.test/openeo/jobs/j-2405078f40904a0b85cf8dc5dd55b07e/results?partial=true"
4144
+ }
4145
+ },
4146
+ "saveresult1" : {
4147
+ "process_id" : "save_result" ,
4148
+ "arguments" : {"data" : {"from_node" : "loadstac1" }, "format" : "GTiff" },
4149
+ "result" : True
4150
+ },
4151
+ }
4152
+
4153
+ from openeogeotrellis .load_stac import extract_own_job_info
4154
+
4155
+ finished_job_info = extract_own_job_info (
4156
+ "https://openeo.test/openeo/jobs/j-2405078f40904a0b85cf8dc5dd55b07e/results?partial=true" ,
4157
+ TEST_USER ,
4158
+ backend_implementation .batch_jobs
4159
+ )
4160
+
4161
+ ongoing_job_info = finished_job_info ._replace (status = 'queued' )
4162
+
4163
+ with mock .patch ("openeogeotrellis.load_stac.extract_own_job_info" ,
4164
+ side_effect = [ongoing_job_info , finished_job_info ]):
4165
+ api110 .result (process_graph ).assert_status_code (200 )
4166
+
4167
+ assert ("OpenEO batch job results status of own job j-2405078f40904a0b85cf8dc5dd55b07e: running"
4168
+ in caplog .messages )
4169
+ assert ("OpenEO batch job results status of own job j-2405078f40904a0b85cf8dc5dd55b07e: finished"
4170
+ in caplog .messages )
4127
4171
4128
4172
4129
4173
class TestEtlApiReporting :
0 commit comments