-
Notifications
You must be signed in to change notification settings - Fork 3k
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 tests on windows #2803
Fix tests on windows #2803
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,16 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
include: | ||
- {name: Windows, python: '3.12', os: windows-latest, tox: fail_fast_test_main} | ||
# - {name: Mac, python: '3.12', os: macos-latest, tox: fail_fast_test_main} | ||
- { name: "ruff", python: "3.11", os: ubuntu-latest, tox: "ruff" } | ||
- { name: "mypy", python: "3.10", os: ubuntu-latest, tox: "mypy" } | ||
- {name: Windows, python: '3.12', os: windows-latest, tox: fail_fast_test_main, skip_pre_build: "true" } | ||
# - {name: Mac, python: '3.12', os: macos-latest, tox: fail_fast_test_main, skip_pre_build: "false" } | ||
- { name: "ruff", python: "3.11", os: ubuntu-latest, tox: "ruff", skip_pre_build: "false" } | ||
- { name: "mypy", python: "3.10", os: ubuntu-latest, tox: "mypy", skip_pre_build: "false" } | ||
# run some integration tests and abort immediately if they fail, for faster feedback | ||
- { name: "Linux", python: "3.12", os: ubuntu-latest, tox: fail_fast_test_main } | ||
- { name: "3.12", python: "3.12", os: ubuntu-latest, tox: py312 } | ||
- { name: "3.11", python: "3.11", os: ubuntu-latest, tox: py311 } | ||
- { name: "3.10", python: "3.10", os: ubuntu-latest, tox: py310 } | ||
- { name: "3.9", python: "3.9", os: ubuntu-latest, tox: py39 } | ||
- { name: "Linux", python: "3.12", os: ubuntu-latest, tox: fail_fast_test_main, skip_pre_build: "false" } | ||
- { name: "3.12", python: "3.12", os: ubuntu-latest, tox: py312, skip_pre_build: "false" } | ||
- { name: "3.11", python: "3.11", os: ubuntu-latest, tox: py311, skip_pre_build: "false" } | ||
- { name: "3.10", python: "3.10", os: ubuntu-latest, tox: py310, skip_pre_build: "false" } | ||
- { name: "3.9", python: "3.9", os: ubuntu-latest, tox: py39, skip_pre_build: "false" } | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -46,7 +46,7 @@ jobs: | |
- name: Install poetry plugin | ||
run: python -m poetry self add "poetry-dynamic-versioning[plugin]" | ||
# Install test dependencies (tox) to the root (non-package install) | ||
- name: Install dependencies | ||
- name: Install test dependencies | ||
run: | | ||
python -m poetry install --no-root --only test | ||
- name: set full Python version in PY env var | ||
|
@@ -60,11 +60,23 @@ jobs: | |
- name: Install Yarn | ||
run: npm install -g yarn | ||
# Build and install the package if it's Windows, to service shell-based tests | ||
- if: ${{ matrix.os }} == "windows-latest" | ||
- name: Install binary on Windows | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
env: | ||
SKIP_PRE_BUILD: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this is no longer needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're still doing a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I thought SKIP_PRE_BUILD was already set here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps |
||
# Make `locust` available on the Windows shell by installing it with `pip` | ||
# before running tests which invoke it in the `cmd` prompt | ||
run: | | ||
python -m poetry build | ||
pip install --find-links=dist locust | ||
- run: python -m poetry run tox -e ${{ matrix.tox }} | ||
python -m poetry self add "poetry-plugin-export" | ||
python -m poetry export --without-hashes --format=requirements.txt > requirements.txt | ||
pip install -r requirements.txt | ||
pip install poetry-core>=1.0.0 | ||
pip install locust --find-links=dist | ||
- name: Run tox tests | ||
env: | ||
SKIP_PRE_BUILD: ${{ matrix.skip_pre_build }} | ||
andrewbaldwin44 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: python -m poetry run tox -e ${{ matrix.tox }} | ||
|
||
lint_typecheck_test_webui: | ||
runs-on: ubuntu-latest | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mquinnfd I think we could skip the pre build for the "fail fast" test on Ubuntu as well right? Maybe to keep things consistent with the windows test and it would probably run faster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So...
Sort of!?
I found that building the front end (or not) actually does affect the fail-fast tests, I could probably find an example from earlier - some things give a totally different response code though (
200
vs500
) so my current understanding is that the UI build is actually not optional for those tests currently 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see and then I guess we just skip those tests if we're running on Windows