test(integrations): Add unit tests for Integrations API client - #2821
Draft
vikramlc-cognite wants to merge 1 commit into
Draft
test(integrations): Add unit tests for Integrations API client#2821vikramlc-cognite wants to merge 1 commit into
vikramlc-cognite wants to merge 1 commit into
Conversation
This was referenced Sep 7, 2026
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds comprehensive unit tests for the integrations API, covering actions, configuration, errors, integrations, and tasks. It also updates the API client tests to register the new integration endpoints as retryable or non-retryable. I have no feedback to provide as there are no review comments.
vikramlc-cognite
marked this pull request as draft
September 7, 2026 12:20
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## integrations-part2.1-core-api-impl #2821 +/- ##
=====================================================================
Coverage ? 93.24%
=====================================================================
Files ? 538
Lines ? 54509
Branches ? 0
=====================================================================
Hits ? 50826
Misses ? 3683
Partials ? 0
🚀 New features to boost your workflow:
|
Unit tests (mocked HTTP) for IntegrationsAPI's CRUD methods and the Tasks, Errors, Config, and Actions sub-APIs added in the previous PR, plus retry-idempotency coverage in test_api_client.py. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
vikramlc-cognite
force-pushed
the
integrations-part2.2-core-api-tests
branch
from
September 7, 2026 12:50
c3eecdf to
eb9d750
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.
Summary
Adds unit tests (mocked HTTP) for IntegrationsAPI's CRUD methods and the Tasks, Errors, Config, and Actions sub-APIs implemented in #2820, plus retry-idempotency coverage in test_api_client.py.
Type of change
What changed
tests/tests_unit/test_api/test_integrations/test_integrations.py— list/create/retrieve/update/delete, including thecdf-versionbeta header assertion.test_actions.py,test_config.py,test_errors.py,test_tasks.py— one file per sub-API, covering request shape (method/URL/body) and response parsing, plus the validation-error paths (list_historyrequiringexternal_idwhentask_nameis given;syncrequiringinclude_errorsorinclude_task_updates;errors.listrequiringexternal_idwhentaskis given).test_api_client.py— addedTestRetryableEndpointscases forintegrations,integrations/config,integrations/actions*.Why it changed
httpx_mock+get_url()/jsgz_load()pattern used by the existingsimulatorstest suite.What to focus on during review
cognite_client.integrations.*/async_client.integrations.*(never by instantiating the sub-API classes directly), matching how every other API module in this SDK is tested.ValueErroron missingexternal_id/include_errors/include_task_updatescombinations) are the only behavior-defining tests here — everything else is round-trip request/response verification.Test evidence
pytest tests/tests_unit/ -q→ 6,669 passed, 8 failed (pre-existing, unrelated: missinggeopandas/sympyin the local dev environment, same failures present onmaster), 6 skippedintegrations-part2-core-apibranch byte-for-byte (git diffagainst it is empty)ruff check/ruff format --check→ cleanRisks and unknowns
Rollout and rollback
Checklist