test: move webhook service coverage to unit tests - #38945
Open
asukaminato0721 wants to merge 9 commits into
Open
test: move webhook service coverage to unit tests#38945asukaminato0721 wants to merge 9 commits into
asukaminato0721 wants to merge 9 commits into
Conversation
Reclassify unit-level coverage from tests/test_containers_integration_tests/services/test_webhook_service.py into the unit test suite, or remove it when equivalent unit coverage already exists. Preserve real container-backed coverage and use SQLite sessions for database-dependent unit paths.
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-08-04 11:10:47.159159260 +0000
+++ /tmp/pyrefly_pr.txt 2026-08-04 11:10:33.658157230 +0000
@@ -1206,28 +1206,6 @@
--> tests/test_containers_integration_tests/services/test_webapp_auth_service.py:345: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]
--> tests/test_containers_integration_tests/services/test_webapp_auth_service.py:715:20
-ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_webhook_service.py:293:88
-ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_webhook_service.py:312:83
-ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_webhook_service.py:333:83
-ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_webhook_service.py:355:88
-ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_webhook_service.py:380:83
-ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_webhook_service.py:402:83
-ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_webhook_service.py:425:88
-ERROR Argument `dict[str, dict[Unknown, Unknown]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_webhook_service.py:483:79
-ERROR Argument `dict[str, dict[str, int | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_webhook_service.py:493:79
-ERROR Argument `dict[str, dict[str, int | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_webhook_service.py:503:79
-ERROR Argument `dict[str, dict[str, int | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_webhook_service.py:512:79
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/services/test_webhook_service_relationships.py:40:72
ERROR Class `WebhookServiceRelationshipFactory` has no class attribute `_read_cache` [missing-attribute]
@@ -6555,13 +6533,13 @@
ERROR Object of class `NoneType` has no attribute `assert_called_once_with` [missing-attribute]
--> tests/unit_tests/core/workflow/nodes/test_document_extractor_node.py:211:9
ERROR Object of class `FunctionType` has no attribute `return_value` [missing-attribute]
- --> tests/unit_tests/core/workflow/nodes/test_if_else.py:240:5
+ --> tests/unit_tests/core/workflow/nodes/test_if_else.py:247:5
ERROR Argument `dict[str, list[dict[str, Any]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
- --> tests/unit_tests/core/workflow/nodes/test_if_else.py:326:19
+ --> tests/unit_tests/core/workflow/nodes/test_if_else.py:333:19
ERROR Argument `dict[str, list[dict[str, list[str] | str]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
- --> tests/unit_tests/core/workflow/nodes/test_if_else.py:388:19
+ --> tests/unit_tests/core/workflow/nodes/test_if_else.py:398:19
ERROR Argument `dict[str, list[dict[str, list[dict[str, list[str] | str]] | str]] | str]` is not assignable to parameter `node_data` with type `IfElseNodeData | dict[str, object]` in function `_build_if_else_node` [bad-argument-type]
- --> tests/unit_tests/core/workflow/nodes/test_if_else.py:453:19
+ --> tests/unit_tests/core/workflow/nodes/test_if_else.py:466:19
ERROR `Literal['{invalid-json-schema']` is not assignable to attribute `json_schema` with type `dict[str, Any] | None` [bad-assignment]
--> tests/unit_tests/core/workflow/nodes/test_start_node_json_object.py:208:28
ERROR Object of class `ModuleType` has no attribute `TraceQueueManager` [missing-attribute]
@@ -8143,23 +8121,33 @@
ERROR Argument `list[File]` is not assignable to parameter `value` with type `list[object]` in function `services.variable_truncator.VariableTruncator._truncate_array` [bad-argument-type]
--> tests/unit_tests/services/test_variable_truncator.py:751:44
ERROR Argument `dict[str, dict[Unknown, Unknown]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:250:79
+ --> tests/unit_tests/services/test_webhook_service.py:310:79
ERROR Argument `dict[str, dict[str, int | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:260:79
+ --> tests/unit_tests/services/test_webhook_service.py:320:79
ERROR Argument `dict[str, dict[str, int | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:270:79
+ --> tests/unit_tests/services/test_webhook_service.py:330:79
ERROR Argument `dict[str, dict[str, int | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:279:79
+ --> tests/unit_tests/services/test_webhook_service.py:339:79
ERROR Argument `dict[str, dict[str, int | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:288:79
+ --> tests/unit_tests/services/test_webhook_service.py:348:79
ERROR Argument `dict[str, dict[str, int | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.generate_webhook_response` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:298:79
+ --> tests/unit_tests/services/test_webhook_service.py:358:79
ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:544:88
+ --> tests/unit_tests/services/test_webhook_service.py:604:88
ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:571:83
+ --> tests/unit_tests/services/test_webhook_service.py:631:83
ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
- --> tests/unit_tests/services/test_webhook_service.py:591:83
+ --> tests/unit_tests/services/test_webhook_service.py:651:83
+ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
+ --> tests/unit_tests/services/test_webhook_service.py:669:79
+ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
+ --> tests/unit_tests/services/test_webhook_service.py:688:84
+ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
+ --> tests/unit_tests/services/test_webhook_service.py:710:79
+ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
+ --> tests/unit_tests/services/test_webhook_service.py:729:79
+ERROR Argument `dict[str, dict[str, list[dict[str, bool | str]] | str]]` is not assignable to parameter `node_config` with type `NodeConfigDict` in function `services.trigger.webhook_service.WebhookService.extract_and_validate_webhook_data` [bad-argument-type]
+ --> tests/unit_tests/services/test_webhook_service.py:747:84
ERROR Argument `dict[str, str | dict[str, str]]` is not assignable to parameter `webhook_data` with type `RawWebhookDataDict` in function `services.trigger.webhook_service.WebhookService._validate_http_metadata` [bad-argument-type]
--> tests/unit_tests/services/test_webhook_service_additional.py:238:57
ERROR Argument `dict[str, dict[str, int] | dict[str, str]]` is not assignable to parameter `webhook_data` with type `RawWebhookDataDict` in function `services.trigger.webhook_service.WebhookService.build_workflow_inputs` [bad-argument-type]
|
Contributor
Pyrefly Type Coverage
|
asukaminato0721
marked this pull request as ready for review
July 14, 2026 09:34
Allow callers to provide an externally owned Session and pass a real SQLite Session in unit coverage.
5 tasks
asukaminato0721
enabled auto-merge
July 21, 2026 12:28
asukaminato0721
force-pushed
the
agent/migrate-webhook-service-unit
branch
from
July 22, 2026 09:03
12b73ec to
4562db4
Compare
41tair
requested changes
Jul 28, 2026
asukaminato0721
force-pushed
the
agent/migrate-webhook-service-unit
branch
from
July 28, 2026 14:56
d0a9059 to
f77169c
Compare
asukaminato0721
force-pushed
the
agent/migrate-webhook-service-unit
branch
from
August 4, 2026 11:09
f77169c to
9d193f8
Compare
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.
What changed
Moves unit-level coverage out of the Testcontainers integration suite. Database-dependent unit paths use real in-memory SQLite sessions, while genuine container-backed coverage remains in the integration suite.
Why
These cases mocked their service or session boundaries and therefore did not exercise container infrastructure. Keeping them in the unit suite makes their ownership and runtime requirements explicit.
Impact
Production behavior is unchanged. Test classification is more accurate and the integration suite avoids unit-only work.
Validation