Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: enforce use of our own virtualenv #1486

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/Taskfile_shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ vars:
HOSTNAME:
sh: echo ${HOSTNAME:-${HOST:-$(hostname)}}
PYTHON3:
sh: echo $VIRTUAL_ENV/bin/python3
sh: echo {{.VIRTUAL_ENV}}/bin/python3
tasks:
setup:
desc: Install dependencies
Expand Down
23 changes: 12 additions & 11 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ includes:
internal: true

output: prefixed # do not use "group" due to impact on CI
env: &env
env:
# keep in mind that these do *not* override shell vars: https://github.com/go-task/task/issues/1733
FORCE_COLOR: "true"
PRE_COMMIT_COLOR: always
# basically the same thing from .envrc file:
VIRTUAL_ENV:
sh: echo "${HOME}/.local/share/virtualenvs/vsa"
vars:
HOSTNAME:
sh: echo ${HOSTNAME:-${HOST:-$(hostname)}}
VIRTUAL_ENV:
sh: echo "${HOME}/.local/share/virtualenvs/vsa"
XVFB:
# prefix to add to allow execution of test in headless machines (CI)
sh: bash -c 'if [[ "$OSTYPE" == "linux-gnu"* ]] && command -v xvfb-run >/dev/null; then echo "$(command -v xvfb-run) --auto-servernum -e out/log/xvfb.log"; fi'
Expand Down Expand Up @@ -95,8 +96,8 @@ tasks:
- task: shared:install
# check deps
- yarn dlx depcheck
- $VIRTUAL_ENV/bin/python3 ./tools/precheck.py
- $VIRTUAL_ENV/bin/python3 -m pre_commit autoupdate
- "{{.VIRTUAL_ENV}}/bin/python3 ./tools/precheck.py"
- "{{.VIRTUAL_ENV}}/bin/python3 -m pre_commit autoupdate"
interactive: true
docs:
dir: "{{ .TASKFILE_DIR }}"
Expand All @@ -114,8 +115,8 @@ tasks:
cmds:
- task: install
- packages/ansible-language-server/tools/can-release.sh
- $VIRTUAL_ENV/bin/python3 ./tools/precheck.py
- $VIRTUAL_ENV/bin/python3 -m pre_commit run -a
- "{{.VIRTUAL_ENV}}/bin/python3 ./tools/precheck.py"
- "{{.VIRTUAL_ENV}}/bin/python3 -m pre_commit run -a"
- tools/dirty.sh
silent: true
sources:
Expand Down Expand Up @@ -149,16 +150,16 @@ tasks:
aliases: [e2e]
cmds:
- task: package
- $VIRTUAL_ENV/bin/python3 --version
- '{{.XVFB}} bash -c ''source "${VIRTUAL_ENV}/bin/activate" && yarn run _coverage-all'''
- "{{.VIRTUAL_ENV}}/bin/python3 --version"
- '{{.XVFB}} bash -c ''source "{{.VIRTUAL_ENV}}/bin/activate" && yarn run _coverage-all'''
interactive: true
test-ui:
desc: Run UI tests {{.XVFB}}
aliases: [ui]
cmds:
- yarn webpack-dev
- $VIRTUAL_ENV/bin/python3 --version
- ' {{.XVFB}} bash -c ''source "${VIRTUAL_ENV}/bin/activate" && yarn _coverage-ui-with-mock-lightspeed-server'''
- "{{.VIRTUAL_ENV}}/bin/python3 --version"
- ' {{.XVFB}} bash -c ''source "{{.VIRTUAL_ENV}}/bin/activate" && yarn _coverage-ui-with-mock-lightspeed-server'''
interactive: true
test-unit:
desc: Run unit tests with coverage report
Expand Down
Loading