Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
ci: skip Python checks on frontend-only PRs
Josh Corbett5ddd6744d222
diff --git a/.github/workflows/openapi-checks.yml b/.github/workflows/openapi-checks.ymlindex 3160d5a3de..aff3c8ff53 100644--- a/.github/workflows/openapi-checks.yml+++ b/.github/workflows/openapi-checks.yml@@ -69,7 +69,11 @@ jobs:files_yaml: |src:- 'pyproject.toml'+ - '.github/workflows/openapi-checks.yml'+ - 'scripts/generate_openapi_schema.py'- 'invokeai/**'+ # The schema is generated from Python and compared against legacy web's artifacts.+ - '!invokeai/frontend/webv2/**'- name: setup uvif: ${{ steps.changed-files.outputs.src_any_changed == 'true' || inputs.always_run == true }}diff --git a/.github/workflows/python-checks.yml b/.github/workflows/python-checks.ymlindex 091de818ed..914861c67a 100644--- a/.github/workflows/python-checks.yml+++ b/.github/workflows/python-checks.yml@@ -55,10 +55,11 @@ jobs:with:files_yaml: |python:+ # ruff config and the classifier check both read pyproject.toml.- 'pyproject.toml'- - 'invokeai/**'- - '!invokeai/frontend/web/**'- - 'tests/**'+ - '.github/workflows/python-checks.yml'+ # ruff lints every tracked .py file from the repository root, wherever it lives.+ - '**/*.py'- name: setup uvif: ${{ steps.changed-files.outputs.python_any_changed == 'true' || inputs.always_run == true }}diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.ymlindex 30dcf56b81..a7dd9128b2 100644--- a/.github/workflows/python-tests.yml+++ b/.github/workflows/python-tests.yml@@ -90,6 +90,18 @@ jobs:- '.github/workflows/python-tests.yml'- 'invokeai/**'- '!invokeai/frontend/web/**'+ - '!invokeai/frontend/webv2/**'+ # Re-includes must follow the exclusions above.+ # test_imports.py walks every package, including the frontend ones.+ - 'invokeai/frontend/web/**/*.py'+ - 'invokeai/frontend/webv2/**/*.py'+ # Non-Python files that tests read.+ # test_workflow_graph_builder.py validates these fixtures against the backend.+ - 'invokeai/frontend/webv2/src/features/workflow/core/fixtures/**'+ # test_config_generation_devices.py checks these against the config field description.+ - 'invokeai/frontend/web/public/locales/en.json'+ - 'docs/src/generated/settings.json'+ - 'docs/src/content/docs/configuration/invokeai-yaml.mdx'- 'tests/**'# tests/ covers a few of these (e.g. test_check_pins.py, test_docs_json_export.py)- 'scripts/**'diff --git a/.github/workflows/typegen-checks.yml b/.github/workflows/typegen-checks.ymlindex 7bea61680a..ea5a456990 100644--- a/.github/workflows/typegen-checks.yml+++ b/.github/workflows/typegen-checks.yml@@ -69,7 +69,11 @@ jobs:files_yaml: |src:- 'pyproject.toml'+ - '.github/workflows/typegen-checks.yml'+ - 'scripts/generate_openapi_schema.py'- 'invokeai/**'+ # The schema is generated from Python and compared against legacy web's artifacts.+ - '!invokeai/frontend/webv2/**'- name: setup uvif: ${{ steps.changed-files.outputs.src_any_changed == 'true' || inputs.always_run == true }}diff --git a/tests/AGENTS.md b/tests/AGENTS.mdindex 2abd5c279c..760c3f8029 100644--- a/tests/AGENTS.md+++ b/tests/AGENTS.md@@ -1,6 +1,6 @@# Python tests-- Read guidance for the production code under test. Follow existing suite placement (`tests/app/`, `tests/backend/`, or the owning root suite) and reuse appropriate fixtures from `conftest.py` and `fixtures/`.+- Read guidance for the production code under test. Follow existing suite placement (`tests/app/`, `tests/backend/`, or the owning root suite) and reuse appropriate fixtures from `conftest.py` and `fixtures/`. A test that reads a file outside `tests/`, `scripts/`, or the Python package tree (for example `docs/` or `invokeai/frontend/web*`) must add that path to the change filter in `.github/workflows/python-tests.yml`, or CI skips pytest when only that file changes.- Protect observable behavior at the interface that owns it. A test should fail for a plausible regression, use independently derived expectations, and survive implementation refactors that preserve the contract.- Avoid trivial type/constant/re-export tests, snapshots of incidental structure, duplicate coverage, implementation-shaped mock choreography, and benchmarks without a meaningful question. Remove obsolete tests.- Reproduce bugs with a focused failing case when feasible. Add edge/failure cases where they protect real behavior, not every imaginable branch. Use names describing outcomes.diff --git a/tests/app/services/test_workflow_graph_builder.py b/tests/app/services/test_workflow_graph_builder.pyindex 956e8957d7..42b52517b7 100644--- a/tests/app/services/test_workflow_graph_builder.py+++ b/tests/app/services/test_workflow_graph_builder.py@@ -119,8 +119,13 @@ FOR_LOOP_FIXTURE_DIR = (/ "fixtures")+FOR_LOOP_FIXTURES = sorted(FOR_LOOP_FIXTURE_DIR.glob("for-loop-*.json"))+# CI's python-tests change filter re-includes this directory by path; a silent empty glob would+# hide both a moved fixture directory and the resulting stale filter.+assert FOR_LOOP_FIXTURES, f"no for-loop fixtures found in {FOR_LOOP_FIXTURE_DIR}"[email protected]("fixture_path", sorted(FOR_LOOP_FIXTURE_DIR.glob("for-loop-*.json")))+[email protected]("fixture_path", FOR_LOOP_FIXTURES)def test_for_loop_fixtures_have_matching_backend_validation(fixture_path: Path):fixture = json.loads(fixture_path.read_text())graph = build_graph_from_workflow(fixture)