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: Fix pre release tests #1219

Merged
merged 12 commits into from
Oct 22, 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
43 changes: 32 additions & 11 deletions .github/workflows/test_prereleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: pre-test-${{ github.ref }}
cancel-in-progress: true

jobs:
download_data:
name: Download test data
Expand Down Expand Up @@ -74,12 +78,26 @@ jobs:
pip install --upgrade pip
pip install setuptools tox tox-gh-actions>=2.12.0

- name: Test with tox base
# run tests using pip install --pre
uses: aganders3/headless-gui@v2
timeout-minutes: 60
with:
run: python -m tox run -v -- -v package/tests/test_PartSegImage package/tests/test_PartSegCore
env:
PLATFORM: ${{ matrix.platform }}
PYVISTA_OFF_SCREEN: True # required for opengl on windows
NAPARI: latest
BACKEND: PyQt6
PIP_CONSTRAINT: requirements/pre_test_problematic_version.txt
PIP_PRE: 1

- name: Test with tox linux
# run tests using pip install --pre
uses: aganders3/headless-gui@v2
timeout-minutes: 60
with:
run: python -m tox run -v -- -v
run: python -m tox run -v -- -v package/tests/test_PartSeg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Incomplete Test Coverage: 'package/tests/' not included in tox commands.

The current tox commands do not include the package/tests/ directory, which may result in missing tests located directly under it.

  • Action Required: Update the tox commands to include package/tests/ to ensure all tests are executed.
🔗 Analysis chain

LGTM! Verify complete test coverage across both tox steps.

The modification to run tests only for package/tests/test_PartSeg in this step is good, as it complements the new "Test with tox base" step.

To ensure we haven't inadvertently missed any tests, please run the following script to verify complete test coverage:

Compare the output to ensure all necessary test directories are included in the tox commands.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all test directories are covered by the tox commands

# Test: Check if all test directories are included in either tox command
echo "Test directories in tox commands:"
grep -E "python -m tox run.*package/tests" .github/workflows/test_prereleases.yml

echo -e "\nAll test directories in the project:"
fd -t d "test" package

Length of output: 554

env:
PLATFORM: ${{ matrix.platform }}
PYVISTA_OFF_SCREEN: True # required for opengl on windows
Expand Down Expand Up @@ -108,26 +126,29 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python 3.12
name: Install Python
with:
python-version: 3.12
python-version: 3.x
- uses: tlambert03/setup-qt-libs@v1
- name: Install dependencies
- name: Install uv
run: pip install uv
- name: Compile PyInstaller requirements
run: |
pip install --upgrade pip
pip install pip-tools
- name: Compile and install PyInstaller requirements
uv pip compile --prerelease allow --python-version 3.12 --upgrade -o requirements.txt pyproject.toml requirements/pre_test_problematic_version.txt --extra pyinstaller
- name: Install dependencies
run: |
pip-compile --upgrade -o requirements.txt pyproject.toml requirements/pre_test_problematic_version.txt --extra pyinstaller --pre
pip-sync
pip install .
uv venv --python 3.12
uv pip install -r requirements.txt
uv pip install .
- name: upload requirements
uses: actions/upload-artifact@v4
with:
name: requirements
path: requirements.txt
- name: Run PyInstaller
run: python build_utils/create_and_pack_executable.py
run: |
source .venv/bin/activate
python build_utils/create_and_pack_executable.py
- name: Upload bundle
uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions requirements/pre_test_problematic_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
mpmath!=1.4.0a0
ipykernel!=7.0.0a0