| 1 | #!/bin/bash -xeu |
| 2 | # |
| 3 | # SPDX-FileCopyrightText: 2023 Philippe Proulx <pproulx@efficios.com> |
| 4 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 5 | |
| 6 | SRCDIR="src/normand" |
| 7 | VENV="$WORKSPACE/.pyenv/" |
| 8 | |
| 9 | # Delete previously built virtual environment just in case |
| 10 | if [[ -d "$VENV" ]]; then |
| 11 | rm -rf "$VENV" |
| 12 | fi |
| 13 | |
| 14 | # Create virtual environment and enter it |
| 15 | virtualenv -p python3 "$VENV" |
| 16 | set +u |
| 17 | # shellcheck disable=SC1090,SC1091 |
| 18 | . "$VENV/bin/activate" |
| 19 | set -u |
| 20 | |
| 21 | # Install Poetry and pytest |
| 22 | pip install poetry pytest |
| 23 | |
| 24 | # Install the cloned version of Normand. |
| 25 | # |
| 26 | # Poetry doesn't create another virtual environment because it reuses |
| 27 | # the current one. |
| 28 | cd "$SRCDIR" |
| 29 | poetry install |
| 30 | |
| 31 | # Test |
| 32 | pytest -v |
| 33 | |
| 34 | # EOF |