test: isolate webhook tests from live Plane API (fix CI) #27
Reference in New Issue
Block a user
Delete Branch "fix/isolate-webhook-tests-from-plane"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
3 tests in tests/test_webhooks.py were hitting live Plane API in CI (clean env, no .env → Connection refused). This PR adds missing @patch decorators to isolate them.
Changes (tests/test_webhooks.py only)
test_plane_webhook_creates_task: Added mocks for
src.plane_sync.fetch_issue_fields,src.plane_sync.fetch_issue_sequence_id,src.plane_sync.add_comment. Also corrected the trigger event fromwork_item.createdtoissue.updated+InProgressto match the current pipeline flow (work_item.created no longer starts the pipeline — Feature 1).test_gitea_push_with_adr_advances_stage: Added
@patch("src.webhooks.gitea.plane_notify_stage")to isolate the Plane stage notification call. Fixedmock_launcher.launch.assert_called_once()→mock_plane_notify.assert_called_once()(code now uses enqueue_job, not launcher.launch directly).test_gitea_ci_failure_on_development_notifies_qg_failure: Already PASSED without changes.
Verification
0d28a0835cto7bbab9c38b