Skip to content

CoverBot: Added tests for instrumentation serialization and PostgreSQL utilities#88

Merged
jy-tan merged 5 commits intomainfrom
tusk-coverbot-Instrumentation-utils-2026-04-10-002658
Apr 10, 2026
Merged

CoverBot: Added tests for instrumentation serialization and PostgreSQL utilities#88
jy-tan merged 5 commits intomainfrom
tusk-coverbot-Instrumentation-utils-2026-04-10-002658

Conversation

@tusk-dev
Copy link
Copy Markdown
Contributor

@tusk-dev tusk-dev bot commented Apr 10, 2026

This PR contains 122 unit tests across 2 test files.

CoverBot config: Instrumentation utils
ℹ️ You're a few files away from solid coverage in this CoverBot. Consider adjusting the file patterns in the CoverBot config above.

File patterns: drift/instrumentation/utils/**

Why these files?

Both psycopg_utils.py and serialization.py sit at 0% coverage with no existing unit tests, yet handle non-trivial DB value serialization/deserialization logic for the PostgreSQL instrumentation path. These files show high recent churn: 3–4 commits each in the past 3 months with 2–3 bug-fix commits, indicating they're historically risky. The tight coupling between them enables round-trip testing of the subsystem. CoverBot's test suite targets the complex conditional branches and multiple public functions that feed into the core replay path.

Reviewers

Tagged @jy-tan — authored restore_row_integer_types in psycopg_utils.py. Tagged @sohankshirsagar — 3+ fix commits across both psycopg_utils.py and serialization.py in recent months.

Files tested

  • drift/instrumentation/utils/psycopg_utils.py
  • drift/instrumentation/utils/serialization.py

View test details on Tusk ↗

@tusk-dev tusk-dev bot requested review from jy-tan and sohankshirsagar April 10, 2026 00:34
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tests/unit/test_psycopg_utils.py">

<violation number="1" location="tests/unit/test_psycopg_utils.py:111">
P2: These range deserialization tests are environment-dependent and will fail when psycopg is installed.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

claude and others added 4 commits April 10, 2026 02:25
Patch HAS_PSYCOPG_RANGE to False for the fallback-path tests so they
pass regardless of whether psycopg is installed. Add companion tests
that exercise the psycopg-present path (skipped when psycopg is absent).

https://claude.ai/code/session_01C8uL7wPeJFV7EeLipxmPgV
- Updated import statements to use importlib for dynamic module loading.
- Enhanced type assertions in `restore_row_integer_types` and `restore_row_date_types` tests to ensure results are of expected types (list or dict).
- Adjusted handling of non-dict items in row descriptions for better type safety.
@jy-tan jy-tan merged commit 46a8936 into main Apr 10, 2026
7 checks passed
@jy-tan jy-tan deleted the tusk-coverbot-Instrumentation-utils-2026-04-10-002658 branch April 10, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants