test: migrate workflow service tests to testcontainers#34206
Merged
asukaminato0721 merged 1 commit intolanggenius:mainfrom Mar 29, 2026
Merged
Conversation
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-27 16:34:21.426381154 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-27 16:34:10.176372380 +0000
@@ -1303,11 +1303,11 @@
ERROR Argument `Literal['succeeded']` is not assignable to parameter `value` with type `SQLCoreOperations[WorkflowNodeExecutionStatus] | WorkflowNodeExecutionStatus` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_workflow_service.py:173:33
ERROR Argument `Literal['invalid_mode']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_workflow_service.py:1174:20
+ --> tests/test_containers_integration_tests/services/test_workflow_service.py:1292:20
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[StatementError]]) [no-matching-overload]
- --> tests/test_containers_integration_tests/services/test_workflow_service.py:1179:27
+ --> tests/test_containers_integration_tests/services/test_workflow_service.py:1297:27
ERROR Argument `dict[str, Any]` is not assignable to parameter `metadata` with type `Mapping[WorkflowNodeExecutionMetadataKey, Any]` in function `graphon.node_events.base.NodeRunResult.__init__` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_workflow_service.py:1523:26
+ --> tests/test_containers_integration_tests/services/test_workflow_service.py:1641:26
ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_workspace_service.py:51:20
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
@@ -7449,14 +7449,6 @@
--> tests/unit_tests/services/workflow/test_workflow_restore.py:62:18
ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.workflow_restore.apply_published_workflow_snapshot_to_draft` [bad-argument-type]
--> tests/unit_tests/services/workflow/test_workflow_restore.py:70:17
-ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.workflow_service.WorkflowService.submit_human_input_form_preview` [bad-argument-type]
- --> tests/unit_tests/services/workflow/test_workflow_service.py:235:23
-ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.workflow_service.WorkflowService.submit_human_input_form_preview` [bad-argument-type]
- --> tests/unit_tests/services/workflow/test_workflow_service.py:236:21
-ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.workflow_service.WorkflowService.submit_human_input_form_preview` [bad-argument-type]
- --> tests/unit_tests/services/workflow/test_workflow_service.py:291:27
-ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.workflow_service.WorkflowService.submit_human_input_form_preview` [bad-argument-type]
- --> tests/unit_tests/services/workflow/test_workflow_service.py:292:25
ERROR Object of class `FunctionType` has no attribute `reset_mock` [missing-attribute]
--> tests/unit_tests/tasks/test_dataset_indexing_task.py:62:5
ERROR Object of class `FunctionType` has no attribute `reset_mock` [missing-attribute]
|
Contributor
|
resolve conflict |
6a40241 to
9fe3391
Compare
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-03-27 23:56:25.323481136 +0000
+++ /tmp/pyrefly_pr.txt 2026-03-27 23:56:14.893394088 +0000
@@ -1301,11 +1301,11 @@
ERROR Argument `Literal['succeeded']` is not assignable to parameter `value` with type `SQLCoreOperations[WorkflowNodeExecutionStatus] | WorkflowNodeExecutionStatus` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_workflow_service.py:173:33
ERROR Argument `Literal['invalid_mode']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_workflow_service.py:1174:20
+ --> tests/test_containers_integration_tests/services/test_workflow_service.py:1292:20
ERROR No matching overload found for function `_pytest.raises.raises` called with arguments: (tuple[type[ValueError], type[StatementError]]) [no-matching-overload]
- --> tests/test_containers_integration_tests/services/test_workflow_service.py:1179:27
+ --> tests/test_containers_integration_tests/services/test_workflow_service.py:1297:27
ERROR Argument `dict[str, Any]` is not assignable to parameter `metadata` with type `Mapping[WorkflowNodeExecutionMetadataKey, Any]` in function `graphon.node_events.base.NodeRunResult.__init__` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_workflow_service.py:1523:26
+ --> tests/test_containers_integration_tests/services/test_workflow_service.py:1641:26
ERROR Argument `Literal['active']` is not assignable to parameter `status` with type `AccountStatus | SQLCoreOperations[AccountStatus]` in function `models.account.Account.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/services/test_workspace_service.py:51:20
ERROR Argument `Literal['normal']` is not assignable to parameter `status` with type `SQLCoreOperations[TenantStatus] | TenantStatus` in function `models.account.Tenant.__init__` [bad-argument-type]
@@ -7093,14 +7093,6 @@
--> tests/unit_tests/services/workflow/test_workflow_restore.py:62:18
ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.workflow_restore.apply_published_workflow_snapshot_to_draft` [bad-argument-type]
--> tests/unit_tests/services/workflow/test_workflow_restore.py:70:17
-ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.workflow_service.WorkflowService.submit_human_input_form_preview` [bad-argument-type]
- --> tests/unit_tests/services/workflow/test_workflow_service.py:235:23
-ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.workflow_service.WorkflowService.submit_human_input_form_preview` [bad-argument-type]
- --> tests/unit_tests/services/workflow/test_workflow_service.py:236:21
-ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `services.workflow_service.WorkflowService.submit_human_input_form_preview` [bad-argument-type]
- --> tests/unit_tests/services/workflow/test_workflow_service.py:291:27
-ERROR Argument `SimpleNamespace` is not assignable to parameter `account` with type `Account` in function `services.workflow_service.WorkflowService.submit_human_input_form_preview` [bad-argument-type]
- --> tests/unit_tests/services/workflow/test_workflow_service.py:292:25
ERROR Object of class `FunctionType` has no attribute `reset_mock` [missing-attribute]
--> tests/unit_tests/tasks/test_dataset_indexing_task.py:62:5
ERROR Object of class `FunctionType` has no attribute `reset_mock` [missing-attribute]
|
asukaminato0721
approved these changes
Mar 29, 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 SQL-related tests from
api/tests/unit_tests/services/workflow/test_workflow_service.pyto testcontainers integration tests atapi/tests/test_containers_integration_tests/services/test_workflow_service.py.Added 4 missing
get_all_published_workflowtests (no_workflow_id, basic, combined_filters, empty_result) using real database queries. Removed the unit test file — the TC file already covered pagination, user_filter, and named_only_filter. The remaining 5 unit tests (submit_human_input_form_preview and run_draft_workflow_node) were pure orchestration tests with fully mocked DB/Session/internals and did not exercise any SQL paths.Part of #32454
Checklist
make lintandmake type-check(backend) andcd web && npx lint-staged(frontend) to appease the lint gods