test: migrate app apis controller tests to testcontainers#34291
Merged
asukaminato0721 merged 1 commit intolanggenius:mainfrom Mar 30, 2026
Merged
Conversation
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-30 14:27:17.927766448 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-30 14:27:07.052742361 +0000
@@ -660,6 +660,8 @@
--> tests/integration_tests/workflow/nodes/test_tool.py:65:16
ERROR `dict[str, str | None]` is not assignable to attribute `env` with type `dict[str, str]` [bad-assignment]
--> tests/test_containers_integration_tests/conftest.py:207:39
+ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `page` [bad-argument-type]
+ --> tests/test_containers_integration_tests/controllers/console/app/test_app_apis.py:579:51
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/controllers/console/app/test_chat_conversation_status_count_api.py:33:48
ERROR Object of class `RequestError` has no attribute `response` [missing-attribute]
@@ -1768,8 +1770,6 @@
--> tests/unit_tests/controllers/console/app/test_annotation_security.py:242:78
ERROR Object of class `int` has no attribute `lower` [missing-attribute]
--> tests/unit_tests/controllers/console/app/test_annotation_security.py:262:35
-ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `page` [bad-argument-type]
- --> tests/unit_tests/controllers/console/app/test_app_apis.py:612:51
ERROR Object of class `ModuleType` has no attribute `console_ns` [missing-attribute]
--> tests/unit_tests/controllers/console/app/test_app_response_models.py:70:5
ERROR Object of class `ModuleType` has no attribute `api` [missing-attribute]
|
asukaminato0721
approved these changes
Mar 30, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate tests from
api/tests/unit_tests/controllers/console/app/test_app_apis.pyto testcontainers integration tests atapi/tests/test_containers_integration_tests/controllers/console/app/test_app_apis.py.Replaced
Flask(__name__)withflask_app_with_containersfixture across all test classes that use request context. All 30 tests migrated covering: completion endpoints (payload validation, success/error paths), app endpoints (icon type preservation, payload validation), ops trace endpoints (get/post/delete), site endpoints (update/token reset), workflow endpoints (payload, app log, draft variable, statistics, triggers), MCP server payloads, error handling, and payload integration tests. Service calls remain mocked as tests verify controller routing and response mapping logic.Part of #32454
Checklist
make lintandmake type-check(backend) andcd web && npx lint-staged(frontend) to appease the lint gods