Add comprehensive tests for image processing nodes and refactor node imports
- Introduced new test files for image layer, image plane, normal scale, object normal rotation, shadeless, and temporary attributes. - Implemented tests to validate the behavior of alpha curves, depth layers, and normal scales in various rendering engines. - Refactored import paths for node groups to align with the new directory structure. - Added checks for temporary attribute lifetimes and ensured proper cleanup without warnings. - Enhanced CLI commands to require the Blender group and validate the presence of generated node assets before packaging. - Updated packaging scripts to enforce the existence of necessary assets, preventing build failures.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import subprocess
|
||||
import tomllib
|
||||
|
||||
from tests.support.paths import PROJECT_ROOT
|
||||
@@ -43,14 +44,38 @@ def test_ai_and_model_groups_own_their_runtime_dependencies():
|
||||
|
||||
|
||||
def test_workflows_run_the_regular_blender_suite():
|
||||
command = "uv run --group blender pytest tests/anyimage tests/tools"
|
||||
build_command = "uv run --group blender node-group build --skip-tests"
|
||||
test_command = (
|
||||
"uv run --group blender pytest tests/anyimage tests/nodes tests/tools"
|
||||
)
|
||||
for name in ("test.yml", "release.yml"):
|
||||
workflow = (PROJECT_ROOT / ".github" / "workflows" / name).read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
assert command in workflow
|
||||
assert build_command in workflow
|
||||
assert test_command in workflow
|
||||
assert workflow.index(build_command) < workflow.index(test_command)
|
||||
assert "BLENDER_BIN" not in workflow
|
||||
assert "download" not in workflow.lower()
|
||||
|
||||
release = (PROJECT_ROOT / ".github" / "workflows" / "release.yml").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
assert "uv run pack" in release
|
||||
|
||||
|
||||
def test_generated_node_asset_is_ignored_and_untracked():
|
||||
asset = "src/anyimage/assets/O_AnyImage.blend"
|
||||
ignored = subprocess.run(
|
||||
["git", "check-ignore", "--quiet", asset],
|
||||
cwd=PROJECT_ROOT,
|
||||
check=False,
|
||||
)
|
||||
tracked = subprocess.run(
|
||||
["git", "ls-files", "--error-unmatch", asset],
|
||||
cwd=PROJECT_ROOT,
|
||||
check=False,
|
||||
capture_output=True,
|
||||
)
|
||||
assert ignored.returncode == 0
|
||||
assert tracked.returncode != 0
|
||||
|
||||
Reference in New Issue
Block a user