-
Notifications
You must be signed in to change notification settings - Fork 21
test: Increase total test coverage and reduce E2E tests #783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
3302fdb to
2b54d26
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #783 +/- ##
==========================================
- Coverage 81.86% 72.57% -9.29%
==========================================
Files 46 46
Lines 2696 2695 -1
==========================================
- Hits 2207 1956 -251
- Misses 489 739 +250
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
989dd15 to
0f1ff9a
Compare
Move 24 e2e tests that only exercise storage APIs or SDK logic to integration tests (real API, no Actor deployment). Delete 4 e2e tests already covered by existing unit/integration tests. Add 47 new unit tests covering ChargingManager, SmartApifyStorageClient, AliasResolver, ApifyEventManager, Configuration, crypto utilities, and Pydantic models. E2E: 65 -> 37 (-43%), Integration: 40 -> 102, Unit: 127 -> 295 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… utilities Add 43 new unit tests targeting uncovered branches and code paths: - 14 tests for _actor.py (webhooks, timeouts, push_data, event listeners, abort, remaining_time) - 16 tests for storage clients (API client creation validation, KVS operations, dataset operations) - 5 tests for _utils.py (IPython detection, enum extraction) - 3 tests for _crypto.py (invalid key types, non-dict input) - 3 tests for _proxy_configuration.py (unparseable URL, min_length, apify domain warning) - 2 tests for log.py (DEBUG/INFO level configuration) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These tests (max_crawl_depth, max_requests_per_crawl, max_request_retries) only exercise Crawlee functionality and don't test any Apify SDK integration. Crawlee is responsible for testing its own features. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix copy-paste bug in request queue tests (was testing KVS instead of RQ), replace fragile index-based log assertions with content-based filtering, strengthen weak delegation tests to verify arguments, and improve test isolation with monkeypatch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The original strict assertions (exact count, initialization log messages, index-based ordering) are valid and more thorough. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…g test - Parametrize copy-pasted webhook, timedelta timeout, and invalid timeout tests for start/call/call_task into 3 tests with 3 variants each - Remove duplicate test_actor_handles_migrating_event_correctly from test_actor_lifecycle.py (already covered in test_apify_event_manager.py) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
58222aa to
6048ac8
Compare
Pijukatel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sme small test related comments
|
@janbuchar, @Mantisus - not necessary requesting a review, up to you guys, mostly just to keep you informed about the SDK test suite improvements. |
- Parametrize tests with multiple assertions into single-assert-per-case - Remove redundant service_locator._configuration = None (handled by autouse fixture) - Inject mocked API clients to avoid accessing private _api_client attribute - Move drop() calls into finally blocks for cleanup on test failure - Always include is_running_in_ipython flag in get_system_info (True/False) - Remove duplicate assert in test_create_same_hmac - Remove unnecessary type: ignore comment Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
ApifyEventManager,Configuration, crypto utilities, and more.test_actor_handles_migrating_event_correctlyfromtest_actor_lifecycle.py- same behavior is already tested intest_apify_event_manager.py::test_migrating_event_triggers_persist_state.Issue
Test count changes
Test plan