From 4a26df1512ab540230b8222be733fd280868011e Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 11:47:59 +0100 Subject: [PATCH 01/10] add github actions test --- .github/workflows/pr.yaml | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..9d87c0e --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,66 @@ +name: Test Pull Request + +on: [pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8'] + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Cache .cache/pip + uses: actions/cache@v3 + id: cache-pip + with: + path: ~/.cache/pip + key: pip_cache_py_${{ matrix.python-version }} + - name: Install package + run: pip install -r requirements.txt black==23.3 flake8==6.0 + - name: Flake8 + run: flake8 --ignore=C901,W503 + - name: Black + uses: psf/black@23.3.0 + + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8'] + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Cache .cache/pip + uses: actions/cache@v3 + id: cache-pip + with: + path: ~/.cache/pip + key: pip_cache_py_${{ matrix.python-version }} + - name: install package + run: python -m pip install . + - name: install packages for testing + run: pip install nose xmldiff + + - name: Run smoke test on example + run: | + python examples/example.py > tmp.xml + xmldiff --check tmp.xml examples/tool.xml + python examples/example_macros.py > tmp.xml + xmldiff --check tmp.xml examples/example_macros.xml + + - name: diff_pydocstyle_report + run: make diff_pydocstyle_report + - name: Test + run: make test + - name: Planemo lint tools + run: planemo l tests/test-data/ + # planemo test content of tests/test-data (this is OK, because the previous + # tests ensure equality of the xmls that are generated and those in the package) + - name: planemo test tools + run: export PATH=$(pwd)/tests/test-data:$PATH && planemo t tests/test-data/ \ No newline at end of file From 4a27897ef94ffc93504c77ee19bde390a3496ef7 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:21:11 +0100 Subject: [PATCH 02/10] force installation of requirements.txt for lint and remove copy paste remnants --- .github/workflows/pr.yaml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 9d87c0e..05e3344 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -20,7 +20,9 @@ jobs: path: ~/.cache/pip key: pip_cache_py_${{ matrix.python-version }} - name: Install package - run: pip install -r requirements.txt black==23.3 flake8==6.0 + run: | + touch requirements.txt + pip install -r requirements.txt black==23.3 flake8==6.0 - name: Flake8 run: flake8 --ignore=C901,W503 - name: Black @@ -42,18 +44,6 @@ jobs: with: path: ~/.cache/pip key: pip_cache_py_${{ matrix.python-version }} - - name: install package - run: python -m pip install . - - name: install packages for testing - run: pip install nose xmldiff - - - name: Run smoke test on example - run: | - python examples/example.py > tmp.xml - xmldiff --check tmp.xml examples/tool.xml - python examples/example_macros.py > tmp.xml - xmldiff --check tmp.xml examples/example_macros.xml - - name: diff_pydocstyle_report run: make diff_pydocstyle_report - name: Test From 5fc2afa103b6c0fa59c231323eb1f8b918a730ad Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:31:54 +0100 Subject: [PATCH 03/10] skip flake E501 and add requirements --- .github/workflows/pr.yaml | 6 +++++- requirements-dev.txt | 2 ++ requirements.txt | 0 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 requirements-dev.txt create mode 100644 requirements.txt diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 05e3344..5de4f49 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -24,7 +24,7 @@ jobs: touch requirements.txt pip install -r requirements.txt black==23.3 flake8==6.0 - name: Flake8 - run: flake8 --ignore=C901,W503 + run: flake8 --ignore=C901,W503,E501 - name: Black uses: psf/black@23.3.0 @@ -44,6 +44,10 @@ jobs: with: path: ~/.cache/pip key: pip_cache_py_${{ matrix.python-version }} + - name: setup + run: | + pip install -r requirements.txt . + pip install -r requirements-dev.txt - name: diff_pydocstyle_report run: make diff_pydocstyle_report - name: Test diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..67d3b05 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +diff_cover +pydocstyle \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 From 412de93f56804922e5b2fb0219e7a5f396314651 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:34:00 +0100 Subject: [PATCH 04/10] also run on push --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 5de4f49..0a04da9 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,6 +1,6 @@ name: Test Pull Request -on: [pull_request] +on: [pull_request, push] jobs: lint: From 55bcd75754b4422aa4dc4568852382808a28e9ef Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:37:22 +0100 Subject: [PATCH 05/10] disable black, fill requirements.txt --- .github/workflows/pr.yaml | 5 +++-- requirements-dev.txt | 1 + requirements.txt | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 0a04da9..2e3b9fc 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -25,8 +25,9 @@ jobs: pip install -r requirements.txt black==23.3 flake8==6.0 - name: Flake8 run: flake8 --ignore=C901,W503,E501 - - name: Black - uses: psf/black@23.3.0 + # at the moment I would prefer not to enable this + # - name: Black + # uses: psf/black@23.3.0 test: runs-on: ubuntu-latest diff --git a/requirements-dev.txt b/requirements-dev.txt index 67d3b05..c8bbc23 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,3 @@ diff_cover +planemo pydocstyle \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e69de29..9efeead 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1,3 @@ +git+https://github.com/WorkflowConversion/CTDopts +lxml +ruamel.yaml \ No newline at end of file From f578653df8b045a3a999ccb21f15620dc5a46fb9 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:39:28 +0100 Subject: [PATCH 06/10] temp disable diff_pydocstyle_report --- .github/workflows/pr.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 2e3b9fc..ee0130b 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -49,8 +49,9 @@ jobs: run: | pip install -r requirements.txt . pip install -r requirements-dev.txt - - name: diff_pydocstyle_report - run: make diff_pydocstyle_report + #TODO reenable: works only on branch? + # - name: diff_pydocstyle_report + # run: make diff_pydocstyle_report - name: Test run: make test - name: Planemo lint tools From ed78e484bd92514814ffd1d2f60572736944e2a7 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 29 Oct 2023 12:45:37 +0100 Subject: [PATCH 07/10] galaxy: do not set name and argument --- ctdconverter/galaxy/converter.py | 16 +++- tests/test-data/bool.xml | 20 ++-- tests/test-data/float.xml | 32 +++---- tests/test-data/ifile.xml | 96 +++++++++---------- tests/test-data/integer.xml | 32 +++---- tests/test-data/label-help.xml | 16 ++-- tests/test-data/ofile-corresponding-input.xml | 6 +- tests/test-data/ofile-mult-typeparam.xml | 4 +- tests/test-data/ofile-mult.xml | 4 +- tests/test-data/ofile-typeparam.xml | 22 ++--- tests/test-data/repeat_test.xml | 80 ++++++++-------- tests/test-data/select_test.xml | 64 ++++++------- tests/test-data/string.xml | 16 ++-- 13 files changed, 210 insertions(+), 198 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index d074400..42fcbea 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -1160,8 +1160,11 @@ def create_param_attribute_list(param_node, param, model, supported_file_formats # parameters need to be treated in cheetah. variable names are currently fixed back # to dashes in fill_ctd.py. currently there seems to be only a single tool # requiring this https://github.com/OpenMS/OpenMS/pull/4529 - param_node.attrib["name"] = get_galaxy_parameter_name(param) - param_node.attrib["argument"] = "-%s" % utils.extract_param_name(param) + argument = "-%s" % utils.extract_param_name(param) + name = get_galaxy_parameter_name(param) + if argument.lstrip("-").replace("-", "_") != name: + param_node.attrib["name"] = get_galaxy_parameter_name(param) + param_node.attrib["argument"] = argument param_type = TYPE_TO_GALAXY_TYPE[param.type] if param_type is None: raise ModelError("Unrecognized parameter type %(type)s for parameter %(name)s" @@ -1673,6 +1676,15 @@ def create_tests(parent, inputs=None, outputs=None, test_macros_prefix=None, nam test_node = add_child_node(tests_node, "test") strip_elements(inputs, "validator", "sanitizer") for node in inputs.iter(): + # params do not have a name if redundant with argument + # -> readd and restore attrib order + if node.tag == "param" and not node.attrib.get("name") and node.attrib.get("argument"): + attrib = copy.deepcopy(node.attrib) + node.attrib["name"] = node.attrib["argument"].lstrip("-").replace("-", "_") + for a in attrib: + del node.attrib[a] + node.attrib[a] = attrib[a] + if node.tag == "expand" and node.attrib["macro"] == ADVANCED_OPTIONS_NAME + "macro": node.tag = "conditional" node.attrib["name"] = ADVANCED_OPTIONS_NAME + "cond" diff --git a/tests/test-data/bool.xml b/tests/test-data/bool.xml index 89f1ed0..ea96da1 100644 --- a/tests/test-data/bool.xml +++ b/tests/test-data/bool.xml @@ -32,12 +32,12 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - - - - - + + + + + +
@@ -49,10 +49,10 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- - - - + + + + diff --git a/tests/test-data/float.xml b/tests/test-data/float.xml index abfa3a2..da0975d 100644 --- a/tests/test-data/float.xml +++ b/tests/test-data/float.xml @@ -32,14 +32,14 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - - - - - - - + + + + + + + +
@@ -59,14 +59,14 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- - - - - - - - + + + + + + + + diff --git a/tests/test-data/ifile.xml b/tests/test-data/ifile.xml index ec93a19..5f091a1 100644 --- a/tests/test-data/ifile.xml +++ b/tests/test-data/ifile.xml @@ -756,30 +756,30 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub( - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +
@@ -831,30 +831,30 @@ ${' '.join(["'test_section.sect_list_mandatory_multformat/%s/%s.%s'"%(i, re.sub(
- - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/test-data/integer.xml b/tests/test-data/integer.xml index 655678b..45e6aa4 100644 --- a/tests/test-data/integer.xml +++ b/tests/test-data/integer.xml @@ -32,14 +32,14 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - - - - - - - + + + + + + + +
@@ -59,14 +59,14 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- - - - - - - - + + + + + + + + diff --git a/tests/test-data/label-help.xml b/tests/test-data/label-help.xml index dae6c60..3eb8e4b 100644 --- a/tests/test-data/label-help.xml +++ b/tests/test-data/label-help.xml @@ -32,28 +32,28 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + - + - + - + diff --git a/tests/test-data/ofile-corresponding-input.xml b/tests/test-data/ofile-corresponding-input.xml index bb213ef..885012a 100644 --- a/tests/test-data/ofile-corresponding-input.xml +++ b/tests/test-data/ofile-corresponding-input.xml @@ -214,9 +214,9 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - - - + + + diff --git a/tests/test-data/ofile-mult-typeparam.xml b/tests/test-data/ofile-mult-typeparam.xml index 8f03392..a1c365e 100644 --- a/tests/test-data/ofile-mult-typeparam.xml +++ b/tests/test-data/ofile-mult-typeparam.xml @@ -51,12 +51,12 @@ ${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s. - + - +
diff --git a/tests/test-data/ofile-mult.xml b/tests/test-data/ofile-mult.xml index ae4ae58..c8732ae 100644 --- a/tests/test-data/ofile-mult.xml +++ b/tests/test-data/ofile-mult.xml @@ -60,8 +60,8 @@ ${' '.join(["&& mv -n 'mandatory_mandatoryinput/%(bn)s/%(id)s.%(gext)s' 'mandato - - + + diff --git a/tests/test-data/ofile-typeparam.xml b/tests/test-data/ofile-typeparam.xml index 51f9ae5..cd96e83 100644 --- a/tests/test-data/ofile-typeparam.xml +++ b/tests/test-data/ofile-typeparam.xml @@ -170,33 +170,33 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - - - + + +
@@ -251,25 +251,25 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + diff --git a/tests/test-data/repeat_test.xml b/tests/test-data/repeat_test.xml index 4970fe5..ae9ac37 100644 --- a/tests/test-data/repeat_test.xml +++ b/tests/test-data/repeat_test.xml @@ -32,89 +32,89 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -299,89 +299,89 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/tests/test-data/select_test.xml b/tests/test-data/select_test.xml index 02429e2..c1fe4ee 100644 --- a/tests/test-data/select_test.xml +++ b/tests/test-data/select_test.xml @@ -32,35 +32,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -68,7 +68,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -76,7 +76,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -84,7 +84,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -92,35 +92,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -128,7 +128,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -136,7 +136,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -144,7 +144,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -395,35 +395,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -431,7 +431,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -439,7 +439,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -447,7 +447,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -455,35 +455,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -491,7 +491,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -499,7 +499,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -507,7 +507,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + diff --git a/tests/test-data/string.xml b/tests/test-data/string.xml index eb1d183..25b2883 100644 --- a/tests/test-data/string.xml +++ b/tests/test-data/string.xml @@ -32,16 +32,16 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - +
@@ -71,16 +71,16 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + From 8079e391d30a7f3efc55c692096b5eb6ca223117 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Sun, 16 May 2021 12:16:58 +0200 Subject: [PATCH 08/10] galaxy: fix selects https://github.com/galaxyproject/galaxy/issues/11797 --- ctdconverter/galaxy/converter.py | 28 ++++--- tests/test-data/ofile-mult-typeparam.xml | 4 +- tests/test-data/ofile-typeparam.xml | 32 ++++---- tests/test-data/select_test.xml | 96 ++++++++++++------------ 4 files changed, 83 insertions(+), 77 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 42fcbea..055be42 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -1165,22 +1165,18 @@ def create_param_attribute_list(param_node, param, model, supported_file_formats if argument.lstrip("-").replace("-", "_") != name: param_node.attrib["name"] = get_galaxy_parameter_name(param) param_node.attrib["argument"] = argument + param_type = TYPE_TO_GALAXY_TYPE[param.type] if param_type is None: raise ModelError("Unrecognized parameter type %(type)s for parameter %(name)s" % {"type": param.type, "name": param.name}) + # ITEMLIST is rendered as text field (even if its integers or floats), an - # exception is files which are treated a bit below + # exception is files which are treated just below if param.is_list: param_type = "text" - if is_selection_parameter(param): param_type = "select" - if len(param.restrictions.choices) < 5: - param_node.attrib["display"] = "checkboxes" - if param.is_list: - param_node.attrib["multiple"] = "true" - if is_boolean_parameter(param): param_type = "boolean" @@ -1207,10 +1203,20 @@ def create_param_attribute_list(param_node, param, model, supported_file_formats # (in Galaxy the default would be prefilled in the form and at least # one option needs to be selected). if not (param.default is None or type(param.default) is _Null) and param_node.attrib["type"] in ["integer", "float", "text", "boolean", "select"]: - logger.error("%s %s %s %s %s" % (param.name, param.default is None, type(param.default) is _Null, param_type, param.type)) - param_node.attrib["optional"] = "false" + # logger.error("%s %s %s %s %s" % (param.name, param.default is None, type(param.default) is _Null, param_type, param.type)) + optional = False else: - param_node.attrib["optional"] = str(not param.required).lower() + optional = not param.required + param_node.attrib["optional"] = str(optional).lower() + + if is_selection_parameter(param): + if param.is_list: + param_node.attrib["multiple"] = "true" + if len(param.restrictions.choices) < 5: + if param.is_list and optional: + param_node.attrib["display"] = "checkboxes" + elif not param.is_list and not optional: + param_node.attrib["display"] = "radio" # check for parameters with restricted values (which will correspond to a "select" in galaxy) if param.restrictions is not None or param_type == "boolean": @@ -1485,7 +1491,7 @@ def create_boolean_parameter(param_node, param): def all_outputs(model, parameter_hardcoder): """ - return lists of reqired and optional output parameters + return lists of required and optional output parameters """ out = [] optout = [] diff --git a/tests/test-data/ofile-mult-typeparam.xml b/tests/test-data/ofile-mult-typeparam.xml index a1c365e..fcdbb68 100644 --- a/tests/test-data/ofile-mult-typeparam.xml +++ b/tests/test-data/ofile-mult-typeparam.xml @@ -51,14 +51,14 @@ ${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s. - +
- + diff --git a/tests/test-data/ofile-typeparam.xml b/tests/test-data/ofile-typeparam.xml index cd96e83..f419598 100644 --- a/tests/test-data/ofile-typeparam.xml +++ b/tests/test-data/ofile-typeparam.xml @@ -170,25 +170,25 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + @@ -198,49 +198,49 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + - + - + - + - + @@ -251,25 +251,25 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + diff --git a/tests/test-data/select_test.xml b/tests/test-data/select_test.xml index c1fe4ee..6f6baa7 100644 --- a/tests/test-data/select_test.xml +++ b/tests/test-data/select_test.xml @@ -32,28 +32,28 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + @@ -92,35 +92,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -128,7 +128,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -136,7 +136,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -144,7 +144,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -153,28 +153,28 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + @@ -213,35 +213,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -249,7 +249,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -257,7 +257,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -265,7 +265,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -273,28 +273,28 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + @@ -333,35 +333,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -369,7 +369,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -377,7 +377,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -385,7 +385,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -395,28 +395,28 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard
- + - + - + - + @@ -455,35 +455,35 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + - + - + - + - + @@ -491,7 +491,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -499,7 +499,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + @@ -507,7 +507,7 @@ python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hard - + From acdaa0122e42790dbe2dc29cd2aaf0db4876484f Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 30 Oct 2023 12:14:34 +0100 Subject: [PATCH 09/10] galaxy: add a mock count attribute to test/ouput_collection elements count is now required for planemo lint to pass --- ctdconverter/galaxy/converter.py | 3 ++- tests/test-data/ofile-mult-typeparam.xml | 4 ++-- tests/test-data/ofile-mult.xml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ctdconverter/galaxy/converter.py b/ctdconverter/galaxy/converter.py index 055be42..e30023f 100755 --- a/ctdconverter/galaxy/converter.py +++ b/ctdconverter/galaxy/converter.py @@ -1760,9 +1760,10 @@ def create_tests(parent, inputs=None, outputs=None, test_macros_prefix=None, nam node.attrib["value"] = "outfile.txt" if node.tag == "collection": node.tag = "output_collection" + node.attrib["count"] = "0" # add a mock count element if node.attrib.get("name", None) == "stdout": node.attrib["lines_diff"] = "2" - for a in set(node.attrib) - {"name", "value", "ftype", "lines_diff"}: + for a in set(node.attrib) - {"name", "value", "ftype", "lines_diff", "count"}: del node.attrib[a] strip_elements(outputs, "delete_node", "discover_datasets", "filter", "change_format") diff --git a/tests/test-data/ofile-mult-typeparam.xml b/tests/test-data/ofile-mult-typeparam.xml index fcdbb68..e44b0f2 100644 --- a/tests/test-data/ofile-mult-typeparam.xml +++ b/tests/test-data/ofile-mult-typeparam.xml @@ -93,8 +93,8 @@ ${' '.join(["&& mv -n 'test_section_sect_mandatory_mandatoryinput/%(bn)s/%(id)s. - - + + - + Date: Mon, 30 Oct 2023 14:11:21 +0100 Subject: [PATCH 10/10] itry to run only on pull_request --- .github/workflows/pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index ee0130b..ac32e90 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,6 +1,6 @@ name: Test Pull Request -on: [pull_request, push] +on: [pull_request] jobs: lint: