Commit ec8ea6ed authored by ∞'s avatar 💻

Use sh.yml to encapsulate test orchestration

parent c0382215
Pipeline #3707 passed with stages
in 45 seconds
......@@ -7,8 +7,7 @@ qa:
stage: test
- pip install -e .[test]
- py.test --cov . -v
- ./sh.yml test
stage: deploy
#!/usr/bin/env shyml
name: env
hook: before
help: Global environment variables and fs perms setup
DJANGO_SETTINGS_MODULE: crudlfap_example.settings
script: |
test -n "${CI_COMMIT_SHA-}" || CI_COMMIT_SHA=$(git rev-parse --short HEAD)
export img=yourlabs/crudlfap:$CI_COMMIT_SHA
test -z "${USER-}" || sudo chown -R ${USER}. .
name: install
help: |
Setup and activate a venv for a python executable
If venv=none, it will not do any venv.
If venv=user, it will use pip install --user.
script: |
if [ "${venv-}" = "user" ]; then
pip_install="pip install --user"
elif [ "${venv-}" != "none" ]; then
export python="${python-python3}"
export path="${path-.venv.$python}"
test -d $path || virtualenv --python=$python $path
set +eux; echo activating $path; source $path/bin/activate; set -eux
${pip_install-pip install} -Ue .[test]
name: test
help: Run test in a python3 venv by default.
requires: [install]
script: py.test -vv --cov cli2 --strict -r fEsxXw ${@-cli2}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment