Files
galaxy/.github/workflows/mulled.yaml
T
Nicola Soranzo 1d59dcb409 Fix the `singularity_container_test()` function
Fix ``test_singularity_container_test`` unit test, which failed with:

```
test/unit/tool_util/mulled/test_mulled_update_singularity_containers.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
lib/galaxy/tool_util/deps/mulled/mulled_update_singularity_containers.py:62: in singularity_container_test
    check_output(exec_command.extend(["bash", "-c", test_command]), stderr=subprocess.STDOUT)
/usr/lib/python3.8/subprocess.py:415: in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
/usr/lib/python3.8/subprocess.py:493: in run
    with Popen(*popenargs, **kwargs) as process:
/usr/lib/python3.8/subprocess.py:858: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,

>           args = list(args)
E           TypeError: 'NoneType' object is not iterable

/usr/lib/python3.8/subprocess.py:1569: TypeError
```

Broken in commit 1dc1e5f219 .

Also:
- Use `tmp_path` pytest fixture.
- Add type annotations.
- Code refactorings.
- Install singularity in the mulled GitHub workflow so that the 2 singularity
  unit tests are not skipped any more.
2023-05-23 12:17:23 +01:00

57 lines
1.7 KiB
YAML

name: Mulled Unit Tests
on:
push:
paths-ignore:
- 'client/**'
- 'doc/**'
- 'lib/galaxy_test/selenium/**'
pull_request:
paths-ignore:
- 'client/**'
- 'doc/**'
- 'lib/galaxy_test/selenium/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.7']
steps:
- uses: actions/checkout@v3
with:
path: 'galaxy root'
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Get full Python version
id: full-python-version
shell: bash
run: echo "version=$(python -c 'import sys; print("-".join(str(v) for v in sys.version_info))')" >> $GITHUB_OUTPUT
- name: Cache pip dir
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('galaxy root/requirements.txt') }}
- name: Cache tox env
uses: actions/cache@v3
with:
path: .tox
key: tox-cache-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-mulled
- name: Install Apptainer's singularity
uses: eWaterCycle/setup-apptainer@v2
- name: Install tox
run: pip install tox
- name: Run tests
run: tox -e mulled
working-directory: 'galaxy root'
- uses: actions/upload-artifact@v3
if: failure()
with:
name: Mulled unit test results (${{ matrix.python-version }})
path: 'galaxy root/run_unit_tests.html'