test: migrate app service tests to testcontainers#34025
Merged
asukaminato0721 merged 5 commits intolanggenius:mainfrom Mar 25, 2026
Merged
Conversation
Contributor
|
fix conflicts |
e3ca5d3 to
297d6c2
Compare
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-24 14:11:20.616061900 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-24 14:11:10.318027340 +0000
@@ -1144,6 +1144,20 @@
--> tests/test_containers_integration_tests/services/test_app_service.py:1236:68
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> tests/test_containers_integration_tests/services/test_app_service.py:1244:68
+ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1280:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1294:41
+ERROR Object of class `TestAppService` has no attribute `_create_test_app_and_account` [missing-attribute]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1303:27
+ERROR Object of class `TestAppService` has no attribute `_create_test_app_and_account` [missing-attribute]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1317:27
+ERROR Could not find name `AppService` [unknown-name]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1320:23
+ERROR Object of class `TestAppService` has no attribute `_create_test_app_and_account` [missing-attribute]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1356:27
+ERROR Could not find name `AppService` [unknown-name]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1359:23
ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_conversation_service.py:43:18
ERROR Object of class `NoneType` has no attribute `quota_used` [missing-attribute]
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-24 15:12:00.563491186 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-24 15:11:49.186578305 +0000
@@ -1014,6 +1014,16 @@
--> tests/test_containers_integration_tests/services/test_app_service.py:1236:68
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> tests/test_containers_integration_tests/services/test_app_service.py:1244:68
+ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1280:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1294:41
+ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1311:61
+ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1329:13
+ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1373:13
ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_conversation_service.py:43:18
ERROR Object of class `NoneType` has no attribute `quota_used` [missing-attribute]
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-24 15:27:56.748514645 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-24 15:27:44.995508780 +0000
@@ -1014,6 +1014,10 @@
--> tests/test_containers_integration_tests/services/test_app_service.py:1236:68
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> tests/test_containers_integration_tests/services/test_app_service.py:1244:68
+ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1280:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1294:41
ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_conversation_service.py:43:18
ERROR Object of class `NoneType` has no attribute `quota_used` [missing-attribute]
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-24 15:40:06.424336785 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-24 15:39:55.864402595 +0000
@@ -1014,6 +1014,10 @@
--> tests/test_containers_integration_tests/services/test_app_service.py:1236:68
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> tests/test_containers_integration_tests/services/test_app_service.py:1244:68
+ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1280:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1294:41
ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_conversation_service.py:43:18
ERROR Object of class `NoneType` has no attribute `quota_used` [missing-attribute]
|
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-24 15:48:31.042832607 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-24 15:48:20.125878509 +0000
@@ -1014,6 +1014,10 @@
--> tests/test_containers_integration_tests/services/test_app_service.py:1236:68
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> tests/test_containers_integration_tests/services/test_app_service.py:1244:68
+ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1280:41
+ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.app_service.AppService.get_app_meta` [bad-argument-type]
+ --> tests/test_containers_integration_tests/services/test_app_service.py:1294:41
ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_conversation_service.py:43:18
ERROR Object of class `NoneType` has no attribute `quota_used` [missing-attribute]
|
asukaminato0721
approved these changes
Mar 25, 2026
CodingOnStar
pushed a commit
that referenced
this pull request
Mar 25, 2026
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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.
Important
Fixes #<issue number>.Summary
Migrate remaining mock-based app service tests from
api/tests/unit_tests/services/test_app_service.py(609 lines, 19 tests) intothe existing testcontainers integration test at
api/tests/test_containers_integration_tests/services/test_app_service.py(1144 lines, 19 tests).
The existing testcontainers file covered app CRUD, pagination, update operations,
deletion, app meta, and code lookups. This PR adds 5 new integration tests for
error paths: code/ID lookup not-found errors, empty metadata when workflow/config
missing, and None return for empty tag filter. Then removes the fully superseded
609-line mock-based file.
Part of #32454
Screenshots
Checklist
make lintandmake type-check(backend) andcd web && npx lint-staged(frontend) to appease the lint gods