From 201bc19575614907fcb0af11ae341e22f8a33100 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Thu, 7 Sep 2023 13:14:03 +0200 Subject: [PATCH] cwl conformance tests: use id field, not label --- scripts/cwl_conformance_to_test_cases.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/cwl_conformance_to_test_cases.py b/scripts/cwl_conformance_to_test_cases.py index ad63d88fbd4c..1a440c00ab52 100644 --- a/scripts/cwl_conformance_to_test_cases.py +++ b/scripts/cwl_conformance_to_test_cases.py @@ -23,7 +23,7 @@ class TestCwlConformance(BaseCwlWorkflowsApiTestCase): TEST_TEMPLATE = string.Template( ''' -${marks} def test_conformance_${version_simple}_${label}(self): +${marks} def test_conformance_${version_simple}_${id_}(self): """${doc} Generated from:: @@ -314,9 +314,9 @@ def main(): del test_with_doc["doc"] cwl_test_def = yaml.dump(test_with_doc, default_flow_style=False) cwl_test_def = "\n".join(f" {line}" for line in cwl_test_def.splitlines()) - label = conformance_test.get("label", str(i)) + id_ = conformance_test.get("id", str(i)) tags = conformance_test.get("tags", []) - is_red = label in red_tests_list + is_red = id_ in red_tests_list marks = " @pytest.mark.cwl_conformance\n" marks += f" @pytest.mark.cwl_conformance_{version_simple}\n" @@ -329,7 +329,7 @@ def main(): if not {"command_line_tool", "expression_tool", "workflow"}.intersection(tags): print( - f"PROBLEM - test [{label}] tagged with neither command_line_tool, expression_tool, nor workflow", + f"PROBLEM - test [{id_}] tagged with neither command_line_tool, expression_tool, nor workflow", file=sys.stderr, ) @@ -338,17 +338,17 @@ def main(): "version": version, "doc": conformance_test["doc"], "cwl_test_def": cwl_test_def, - "label": label.replace("-", "_"), + "id_": id_.replace("-", "_"), "marks": marks, } test_body = TEST_TEMPLATE.safe_substitute(template_kwargs) tests += test_body - if label in all_tests_found: - print(f"PROBLEM - Duplicate label found [{label}]", file=sys.stderr) - all_tests_found.add(label) + if id_ in all_tests_found: + print(f"PROBLEM - Duplicate id found [{id_}]", file=sys.stderr) + all_tests_found.add(id_) if is_red: - red_tests_found.add(label) + red_tests_found.add(id_) test_file_contents = TEST_FILE_TEMPLATE.safe_substitute( {