From be1e21bffcd63aa2ef709acc80ef5230ff89d571 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Tue, 10 Nov 2020 13:19:18 +0000 Subject: [PATCH 1/3] Migrate API tests to GitHub workflow --- .github/workflows/api.yaml | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/api.yaml diff --git a/.github/workflows/api.yaml b/.github/workflows/api.yaml new file mode 100644 index 00000000000..32da03aa47a --- /dev/null +++ b/.github/workflows/api.yaml @@ -0,0 +1,40 @@ +name: API tests +on: [push, pull_request] +env: + GALAXY_TEST_DBURI: 'postgres://postgres:postgres@localhost:5432/galaxy?client_encoding=utf8' +jobs: + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.7'] + services: + postgres: + image: postgres:11 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + ports: + - 5432:5432 + steps: + - uses: actions/checkout@v2 + with: + path: 'galaxy root' + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Cache pip dir + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('galaxy root/requirements.txt') }} + - name: Run tests + run: ./run_tests.sh --skip_flakey_fails -api + working-directory: 'galaxy root' + - uses: actions/upload-artifact@v2 + if: failure() + with: + name: API test results + path: 'galaxy root/run_api_tests.html' From 1e9f83b53ea8599b4414ce4dd7a63bc505603506 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Tue, 10 Nov 2020 15:33:35 +0000 Subject: [PATCH 2/3] Add missing single-quotes in tools Cheetah --- .../functional/tools/for_workflows/mapper.xml | 6 +-- .../tools/for_workflows/mapper2.xml | 44 +++++++++---------- .../functional/tools/for_workflows/pileup.xml | 8 ++-- tools/filters/catWrapper.xml | 22 +++++----- 4 files changed, 39 insertions(+), 41 deletions(-) diff --git a/test/functional/tools/for_workflows/mapper.xml b/test/functional/tools/for_workflows/mapper.xml index 505e517c7db..3a6f325d475 100644 --- a/test/functional/tools/for_workflows/mapper.xml +++ b/test/functional/tools/for_workflows/mapper.xml @@ -1,7 +1,7 @@ - - cp $__tool_directory__/1.bam $out_file1 - + diff --git a/test/functional/tools/for_workflows/mapper2.xml b/test/functional/tools/for_workflows/mapper2.xml index d3fb3b9d9a5..a800ef86616 100644 --- a/test/functional/tools/for_workflows/mapper2.xml +++ b/test/functional/tools/for_workflows/mapper2.xml @@ -1,29 +1,29 @@ - - cp $__tool_directory__/1.bam $out_file1 - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/test/functional/tools/for_workflows/pileup.xml b/test/functional/tools/for_workflows/pileup.xml index df6c6af4149..aa17f109f03 100644 --- a/test/functional/tools/for_workflows/pileup.xml +++ b/test/functional/tools/for_workflows/pileup.xml @@ -1,9 +1,9 @@ - - printf "Summary" > $out_file1 - + '$out_file1' + ]]> - + diff --git a/tools/filters/catWrapper.xml b/tools/filters/catWrapper.xml index 33e67e1e5a4..d4865d3c5b9 100644 --- a/tools/filters/catWrapper.xml +++ b/tools/filters/catWrapper.xml @@ -1,13 +1,13 @@ tail-to-head - - catWrapper.py - $out_file1 - $input1 - #for $q in $queries - ${q.input2} - #end for - + @@ -33,8 +33,7 @@ --> - - + + ]]> From efa9e0fdd1d11d58f4a504a3e8242cc59f3f1416 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Tue, 10 Nov 2020 17:17:15 +0000 Subject: [PATCH 3/3] Fix command line for tools using `interpreter` when galaxy root contains spaces --- lib/galaxy/tools/evaluation.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/tools/evaluation.py b/lib/galaxy/tools/evaluation.py index b47b4039d46..45f21a22b6b 100644 --- a/lib/galaxy/tools/evaluation.py +++ b/lib/galaxy/tools/evaluation.py @@ -1,6 +1,7 @@ import json import logging import os +import shlex import tempfile @@ -494,11 +495,12 @@ class ToolEvaluator: raise if interpreter: # TODO: path munging for cluster/dataset server relocatability - executable = command_line.split()[0] + command_line_tokens = shlex.split(command_line) + executable = command_line_tokens[0] tool_dir = os.path.abspath(self.tool.tool_dir) abs_executable = os.path.join(tool_dir, executable) - command_line = command_line.replace(executable, abs_executable, 1) - command_line = interpreter + " " + command_line + command_line_tokens[0:1] = [interpreter, abs_executable] + command_line = ' '.join(map(shlex.quote, command_line_tokens)) self.command_line = command_line def __build_config_files(self):