Skip to content

Commit 4be3816

Browse files
chore: separate venv for unit tests
1 parent cbef6d1 commit 4be3816

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/reusable-build-test-release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,15 +489,17 @@ jobs:
489489
if [ ! -f dev_deps/requirements_dev.txt ]; then echo no dev_deps/requirements;exit 0 ;fi
490490
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
491491
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com
492-
pip install -r dev_deps/requirements_dev.txt
492+
python${{ env.PYTHON_VERSION }} -m venv .dev_venv
493+
echo "Found requirements_dev.txt. Installing dev dependencies in an isolated environment"
494+
./.dev_venv/bin/python -m pip install -r dev_deps/requirements_dev.txt
493495
- name: Create directories
494496
run: |
495497
mkdir -p /opt/splunk/var/log/splunk
496498
chmod -R 777 /opt/splunk/var/log/splunk
497499
- name: Copy pytest ini
498500
run: cp tests/unit/pytest-ci.ini pytest.ini
499501
- name: Run Pytest with coverage
500-
run: pytest --cov=./ --cov-report=xml --junitxml=test-results/junit.xml tests/unit
502+
run: ./.dev_venv/bin/python -m pytest --cov=./ --cov-report=xml --junitxml=test-results/junit.xml tests/unit
501503
- name: Job summary
502504
continue-on-error: true
503505
run: |

0 commit comments

Comments
 (0)