Skip to content

Commit 00771c7

Browse files
committed
[wip] add test markers for various OAP parts affecting /jobs endpoints + prepare tests to validate (relates to opengeospatial/ogcapi-processes#437, relates to #734, relates to #716)
1 parent f29c010 commit 00771c7

File tree

5 files changed

+109
-10
lines changed

5 files changed

+109
-10
lines changed

setup.cfg

+5
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ markers =
6060
slow: mark test to be slow
6161
remote: mark test with remote Weaver instance requirement
6262
vault: mark test with Vault file feature validation
63+
html: mark test as related to HTML rendering
64+
oap_part1: mark test as 'OGC API - Processes - Part 1: Core' functionalities
65+
oap_part2: mark test as 'OGC API - Processes - Part 2: Deploy, Replace, Undeploy (DRU)' functionalities
66+
oap_part3: mark test as 'OGC API - Processes - Part 3: Workflows and Chaining' functionalities
67+
oap_part4: mark test as 'OGC API - Processes - Part 4: Job Management' functionalities
6368
filterwarnings =
6469
ignore:No file specified for WPS-1 providers registration:RuntimeWarning
6570
ignore:.*configuration setting.*weaver\.cwl_processes_dir.*:RuntimeWarning

tests/functional/test_wps_package.py

+40
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,7 @@ def fix_result_multipart_indent(results):
35983598
res_dedent = res_dedent.rstrip("\n ") # last line often indented less because of closing multiline string
35993599
return res_dedent
36003600

3601+
@pytest.mark.oap_part1
36013602
def test_execute_single_output_prefer_header_return_representation_literal(self):
36023603
proc = "EchoResultsTester"
36033604
p_id = self.fully_qualified_test_process_name(proc)
@@ -3644,6 +3645,7 @@ def test_execute_single_output_prefer_header_return_representation_literal(self)
36443645
},
36453646
}
36463647

3648+
@pytest.mark.oap_part1
36473649
def test_execute_single_output_prefer_header_return_representation_complex(self):
36483650
proc = "EchoResultsTester"
36493651
p_id = self.fully_qualified_test_process_name(proc)
@@ -3693,6 +3695,7 @@ def test_execute_single_output_prefer_header_return_representation_complex(self)
36933695
},
36943696
}
36953697

3698+
@pytest.mark.oap_part1
36963699
def test_execute_single_output_prefer_header_return_minimal_literal_accept_default(self):
36973700
"""
36983701
For single requested output, without ``Accept`` content negotiation, its default format is returned directly.
@@ -3746,6 +3749,7 @@ def test_execute_single_output_prefer_header_return_minimal_literal_accept_defau
37463749
},
37473750
}
37483751

3752+
@pytest.mark.oap_part1
37493753
def test_execute_single_output_prefer_header_return_minimal_literal_accept_json(self):
37503754
"""
37513755
For single requested output, with ``Accept`` :term:`JSON` content negotiation, document response is returned.
@@ -3801,6 +3805,7 @@ def test_execute_single_output_prefer_header_return_minimal_literal_accept_json(
38013805
},
38023806
}
38033807

3808+
@pytest.mark.oap_part1
38043809
def test_execute_single_output_prefer_header_return_minimal_complex_accept_default(self):
38053810
"""
38063811
For single requested output, without ``Accept`` content negotiation, its default format is returned by link.
@@ -3880,6 +3885,7 @@ def test_execute_single_output_prefer_header_return_minimal_complex_accept_defau
38803885
},
38813886
}
38823887

3888+
@pytest.mark.oap_part1
38833889
def test_execute_single_output_prefer_header_return_minimal_complex_accept_json(self):
38843890
"""
38853891
For single requested output, with ``Accept`` :term:`JSON` content negotiation, document response is returned.
@@ -3955,6 +3961,7 @@ def test_execute_single_output_prefer_header_return_minimal_complex_accept_json(
39553961
},
39563962
}
39573963

3964+
@pytest.mark.oap_part1
39583965
def test_execute_single_output_response_raw_value_literal(self):
39593966
proc = "EchoResultsTester"
39603967
p_id = self.fully_qualified_test_process_name(proc)
@@ -3999,6 +4006,7 @@ def test_execute_single_output_response_raw_value_literal(self):
39994006
},
40004007
}
40014008

4009+
@pytest.mark.oap_part1
40024010
def test_execute_single_output_response_raw_value_complex(self):
40034011
"""
40044012
Since value transmission is requested for a single output, its :term:`JSON` contents are returned directly.
@@ -4054,6 +4062,7 @@ def test_execute_single_output_response_raw_value_complex(self):
40544062
},
40554063
}
40564064

4065+
@pytest.mark.oap_part1
40574066
def test_execute_single_output_response_raw_reference_literal(self):
40584067
proc = "EchoResultsTester"
40594068
p_id = self.fully_qualified_test_process_name(proc)
@@ -4113,6 +4122,7 @@ def test_execute_single_output_response_raw_reference_literal(self):
41134122
},
41144123
}
41154124

4125+
@pytest.mark.oap_part1
41164126
def test_execute_single_output_response_raw_reference_complex(self):
41174127
proc = "EchoResultsTester"
41184128
p_id = self.fully_qualified_test_process_name(proc)
@@ -4172,6 +4182,7 @@ def test_execute_single_output_response_raw_reference_complex(self):
41724182
},
41734183
}
41744184

4185+
@pytest.mark.oap_part1
41754186
def test_execute_single_output_multipart_accept_data(self):
41764187
"""
41774188
Validate that requesting multipart for a single output is permitted.
@@ -4250,6 +4261,7 @@ def test_execute_single_output_multipart_accept_data(self):
42504261
},
42514262
}
42524263

4264+
@pytest.mark.oap_part1
42534265
def test_execute_single_output_multipart_accept_link(self):
42544266
"""
42554267
Validate that requesting multipart for a single output is permitted.
@@ -4326,6 +4338,7 @@ def test_execute_single_output_multipart_accept_link(self):
43264338
}
43274339

43284340
# FIXME: implement (https://github.com/crim-ca/weaver/pull/548)
4341+
@pytest.mark.oap_part1
43294342
@pytest.mark.xfail(reason="not implemented")
43304343
def test_execute_single_output_multipart_accept_alt_format(self):
43314344
"""
@@ -4408,6 +4421,7 @@ def test_execute_single_output_multipart_accept_alt_format(self):
44084421
assert result_json.text == "{\"data\":\"test\"}"
44094422

44104423
# FIXME: implement (https://github.com/crim-ca/weaver/pull/548)
4424+
@pytest.mark.oap_part1
44114425
@pytest.mark.xfail(reason="not implemented")
44124426
def test_execute_single_output_response_document_alt_format_yaml(self):
44134427
proc = "EchoResultsTester"
@@ -4484,6 +4498,7 @@ def test_execute_single_output_response_document_alt_format_yaml(self):
44844498
assert result_json.content_type == ContentType.APP_JSON
44854499
assert result_json.text == "{\"data\":\"test\"}"
44864500

4501+
@pytest.mark.oap_part1
44874502
def test_execute_single_output_response_document_alt_format_json_raw_literal(self):
44884503
proc = "EchoResultsTester"
44894504
p_id = self.fully_qualified_test_process_name(proc)
@@ -4555,6 +4570,7 @@ def test_execute_single_output_response_document_alt_format_json_raw_literal(sel
45554570
# assert result_json.content_type == ContentType.APP_JSON
45564571
# assert result_json.json == {"data": "test"}
45574572

4573+
@pytest.mark.oap_part1
45584574
def test_execute_single_output_response_document_default_format_json_special(self):
45594575
"""
45604576
Validate that a :term:`JSON` output is directly embedded in a ``document`` response also using :term:`JSON`.
@@ -4631,6 +4647,7 @@ def test_execute_single_output_response_document_default_format_json_special(sel
46314647
},
46324648
}
46334649

4650+
@pytest.mark.oap_part1
46344651
@parameterized.expand([
46354652
ContentType.MULTIPART_ANY,
46364653
ContentType.MULTIPART_MIXED,
@@ -4724,6 +4741,7 @@ def test_execute_multi_output_multipart_accept(self, multipart_header):
47244741
},
47254742
}
47264743

4744+
@pytest.mark.oap_part1
47274745
def test_execute_multi_output_multipart_accept_async_not_acceptable(self):
47284746
"""
47294747
When executing the process asynchronously, ``Accept`` with multipart (strictly) is not acceptable.
@@ -4766,6 +4784,7 @@ def test_execute_multi_output_multipart_accept_async_not_acceptable(self):
47664784
"in": "headers",
47674785
}
47684786

4787+
@pytest.mark.oap_part1
47694788
def test_execute_multi_output_multipart_accept_async_alt_acceptable(self):
47704789
"""
47714790
When executing the process asynchronously, ``Accept`` with multipart and an alternative is acceptable.
@@ -4806,6 +4825,7 @@ def test_execute_multi_output_multipart_accept_async_alt_acceptable(self):
48064825
assert "Preference-Applied" in resp.headers
48074826
assert resp.headers["Preference-Applied"] == prefer_header.replace(",", ";")
48084827

4828+
@pytest.mark.oap_part1
48094829
def test_execute_multi_output_prefer_header_return_representation(self):
48104830
proc = "EchoResultsTester"
48114831
p_id = self.fully_qualified_test_process_name(proc)
@@ -4881,6 +4901,7 @@ def test_execute_multi_output_prefer_header_return_representation(self):
48814901
},
48824902
}
48834903

4904+
@pytest.mark.oap_part1
48844905
def test_execute_multi_output_response_raw_value(self):
48854906
proc = "EchoResultsTester"
48864907
p_id = self.fully_qualified_test_process_name(proc)
@@ -4954,6 +4975,7 @@ def test_execute_multi_output_response_raw_value(self):
49544975
},
49554976
}
49564977

4978+
@pytest.mark.oap_part1
49574979
def test_execute_multi_output_response_raw_reference_default_links(self):
49584980
"""
49594981
All outputs resolved as reference (explicitly or inferred) with raw representation should be all Link headers.
@@ -5028,6 +5050,7 @@ def test_execute_multi_output_response_raw_reference_default_links(self):
50285050
},
50295051
}
50305052

5053+
@pytest.mark.oap_part1
50315054
def test_execute_multi_output_response_raw_reference_accept_multipart(self):
50325055
"""
50335056
Requesting ``multipart`` explicitly should return it instead of default ``Link`` headers response.
@@ -5115,6 +5138,7 @@ def test_execute_multi_output_response_raw_reference_accept_multipart(self):
51155138
},
51165139
}
51175140

5141+
@pytest.mark.oap_part1
51185142
def test_execute_multi_output_response_raw_mixed(self):
51195143
proc = "EchoResultsTester"
51205144
p_id = self.fully_qualified_test_process_name(proc)
@@ -5200,6 +5224,7 @@ def test_execute_multi_output_response_raw_mixed(self):
52005224
},
52015225
}
52025226

5227+
@pytest.mark.oap_part1
52035228
def test_execute_multi_output_prefer_header_return_minimal_defaults(self):
52045229
"""
52055230
Test ``Prefer: return=minimal`` with default ``transmissionMode`` resolutions for literal/complex outputs.
@@ -5264,6 +5289,7 @@ def test_execute_multi_output_prefer_header_return_minimal_defaults(self):
52645289
},
52655290
}
52665291

5292+
@pytest.mark.oap_part1
52675293
def test_execute_multi_output_prefer_header_return_minimal_override_transmission(self):
52685294
"""
52695295
Test ``Prefer: return=minimal`` with ``transmissionMode`` overrides.
@@ -5344,6 +5370,7 @@ def test_execute_multi_output_prefer_header_return_minimal_override_transmission
53445370
},
53455371
}
53465372

5373+
@pytest.mark.oap_part1
53475374
def test_execute_multi_output_response_document_defaults(self):
53485375
"""
53495376
Test ``response: document`` with default ``transmissionMode`` resolutions for literal/complex outputs.
@@ -5408,6 +5435,7 @@ def test_execute_multi_output_response_document_defaults(self):
54085435
},
54095436
}
54105437

5438+
@pytest.mark.oap_part1
54115439
def test_execute_multi_output_response_document_mixed(self):
54125440
"""
54135441
Test ``response: document`` with ``transmissionMode`` specified to force convertion of literal/complex outputs.
@@ -5485,6 +5513,18 @@ def test_execute_multi_output_response_document_mixed(self):
54855513
},
54865514
}
54875515

5516+
@pytest.mark.oap_part4
5517+
def test_execute_jobs_sync(self):
5518+
raise NotImplementedError # FIMXE: POST /jobs with 'Prefer: wait=X' and return results directly
5519+
5520+
@pytest.mark.oap_part4
5521+
def test_execute_jobs_async(self):
5522+
raise NotImplementedError # FIMXE: POST /jobs with 'Prefer: respond-asny' and GET /jobs/{jobId}/results
5523+
5524+
@pytest.mark.oap_part4
5525+
def test_execute_jobs_create_trigger(self):
5526+
raise NotImplementedError # FIMXE: POST /jobs with 'status:create' and POST /jobs/{jobId}/results to trigger
5527+
54885528

54895529
@pytest.mark.functional
54905530
class WpsPackageAppWithS3BucketTest(WpsConfigBase, ResourcesUtil):

0 commit comments

Comments
 (0)