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

fix: change deps installation method in unit tests #258

Merged
merged 4 commits into from
Apr 17, 2024
Merged
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
16 changes: 8 additions & 8 deletions .github/workflows/reusable-build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -458,20 +458,20 @@ jobs:
pip install poetry==1.5.1 poetry-plugin-export==1.4.0
poetry lock --check
poetry export --without-hashes -o package/lib/requirements.txt
poetry export --without-hashes --dev -o requirements_dev.txt
poetry export --without-hashes --with dev -o requirements_dev.txt
fi
if [ ! -f requirements_dev.txt ]; then echo no requirements;exit 0 ;fi
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com
pip install -r requirements_dev.txt
poetry install --with dev
- name: Create directories
run: |
mkdir -p /opt/splunk/var/log/splunk
chmod -R 777 /opt/splunk/var/log/splunk
- name: Copy pytest ini
run: cp tests/unit/pytest-ci.ini pytest.ini
- name: Run Pytest with coverage
run: pytest --cov=./ --cov-report=xml --junitxml=test-results/junit.xml tests/unit
run: poetry run pytest --cov=./ --cov-report=xml --junitxml=test-results/junit.xml tests/unit
- uses: actions/upload-artifact@v3
if: success() || failure()
with:
Expand Down Expand Up @@ -509,20 +509,20 @@ jobs:
pip install poetry==1.5.1 poetry-plugin-export==1.4.0
poetry lock --check
poetry export --without-hashes -o package/lib/requirements.txt
poetry export --without-hashes --dev -o requirements_dev.txt
poetry export --without-hashes --with dev -o requirements_dev.txt
fi
if [ ! -f requirements_dev.txt ]; then echo no requirements;exit 0 ;fi
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com
pip install -r requirements_dev.txt
poetry install --with dev
- name: Create directories
run: |
mkdir -p /opt/splunk/var/log/splunk
chmod -R 777 /opt/splunk/var/log/splunk
- name: Copy pytest ini
run: cp tests/unit/pytest-ci.ini pytest.ini
- name: Run Pytest with coverage
run: pytest --cov=./ --cov-report=xml --junitxml=test-results/junit.xml tests/unit
run: poetry run pytest --cov=./ --cov-report=xml --junitxml=test-results/junit.xml tests/unit
- uses: actions/upload-artifact@v3
if: success() || failure()
with:
Expand Down Expand Up @@ -573,7 +573,7 @@ jobs:
echo "No prod dependencies were found"
rm requirements.txt
fi
poetry export --without-hashes --dev -o requirements_dev.txt
poetry export --without-hashes --with dev -o requirements_dev.txt
cat requirements_dev.txt
fi
- name: Get pip cache dir
Expand Down Expand Up @@ -745,7 +745,7 @@ jobs:
echo "No prod dependencies were found"
rm requirements.txt
fi
poetry export --without-hashes --dev -o requirements_dev.txt
poetry export --without-hashes --with dev -o requirements_dev.txt
cat requirements_dev.txt
fi
- id: pip-cache
Expand Down
Loading