-
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial run of a py.test collector for the existing klippy
.test
fo…
…rmat, rework CI to do more validation (#503) * Replace scripts/test_klippy.py with py.test * Revise tests Gcode unknown commands and command errors are now test exceptions `ASSERT TEST="{printer.whatever} is False"` in tests allows template evaluated runtime assertions fix a couple broken tests that did not error because of the above * Use tool.uv.dev-dependencies * Rework PR CI builds If there are changes that may affect the firmware, rebuild the docker image (Pull the existing image first to re-use the layer cache) Klippy changes, test across all supported python versions * Revisions to github actions - Build and push the docker image on pushes to main - Ensure scripts/*requirements*.txt are up to date - Separate python versions into individual steps for better clarity * Update klippy-requirements and requirements_dev --------- Co-authored-by: Rogerio Goncalves <[email protected]>
- Loading branch information
Showing
20 changed files
with
661 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
ci_build/ | ||
ci_cache/ | ||
|
||
.venv/ | ||
dict/ | ||
scripts/Dockerfile* | ||
out/ | ||
.pytest_cache/ | ||
.ruff_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
# This file was autogenerated by uv via the following command: | ||
# uv export -o scripts/requirements_dev.txt --only-dev --no-hashes | ||
# uv export --frozen -o scripts/requirements_dev.txt --only-dev --no-hashes | ||
cfgv==3.4.0 | ||
colorama==0.4.6 ; sys_platform == 'win32' | ||
distlib==0.3.9 | ||
filelock==3.16.1 | ||
identify==2.6.5 | ||
exceptiongroup==1.2.2 ; python_full_version < '3.11' | ||
execnet==2.1.1 | ||
filelock==3.17.0 | ||
identify==2.6.6 | ||
iniconfig==2.0.0 | ||
nodeenv==1.9.1 | ||
packaging==24.2 | ||
platformdirs==4.3.6 | ||
pre-commit==4.0.1 | ||
pluggy==1.5.0 | ||
pre-commit==4.1.0 | ||
pytest==8.3.4 | ||
pytest-xdist==3.6.1 | ||
pyyaml==6.0.2 | ||
ruff==0.8.4 | ||
virtualenv==20.28.1 | ||
ruff==0.9.3 | ||
tomli==2.2.1 ; python_full_version < '3.11' | ||
virtualenv==20.29.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from __future__ import annotations | ||
|
||
import klippy.chelper | ||
import pathlib | ||
import os | ||
|
||
# Ensure chelper is built | ||
klippy.chelper.get_ffi() | ||
|
||
|
||
ROOT = pathlib.Path(__file__).parent.parent | ||
KLIPPY_PLUGINS = ROOT / "klippy" / "plugins" | ||
TESTING_PLUGIN = ROOT / "test" / "klippy_testing_plugin.py" | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--dictdir", | ||
action="store", | ||
default=os.environ.get("DICTDIR", "dict"), | ||
help="Klipper build dictionary path", | ||
) | ||
|
||
|
||
def pytest_sessionstart(session): | ||
link_path = KLIPPY_PLUGINS / "testing.py" | ||
if link_path.exists(): | ||
return | ||
|
||
os.symlink(TESTING_PLUGIN, link_path) | ||
|
||
@session.config.add_cleanup | ||
def clean_symlink(): | ||
os.unlink(link_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,8 +40,6 @@ ACCEPT | |
ACCEPT | ||
ACCEPT | ||
|
||
ACCEPT | ||
ACCEPT | ||
ACCEPT | ||
|
||
# Start helper script and run with two readjusts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.