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' 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): 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 @@ --> - - + + ]]>