Skip to content

test: improve coverage for core logic#46

Merged
jy-tan merged 9 commits intomainfrom
improve-test-coverage
Jan 18, 2026
Merged

test: improve coverage for core logic#46
jy-tan merged 9 commits intomainfrom
improve-test-coverage

Conversation

@jy-tan
Copy link
Contributor

@jy-tan jy-tan commented Jan 18, 2026

Summary

Adds comprehensive unit test coverage for all critical SDK core modules (excluding instrumentations) and integrates Coveralls for automated coverage reporting on CI.

Changes

  • Add 9 new unit test files covering previously untested SDK core modules:
    • test_sampling.py - sampling rate logic and validation
    • test_otel_converter.py - OpenTelemetry span to CleanSpanData conversion
    • test_trace_blocking_manager.py - trace blocking for oversized/errored traces
    • test_mode_utils.py - RECORD/REPLAY mode utilities
    • test_span_utils.py - centralized span management utilities
    • test_td_span_processor.py - custom OTel span processor
    • test_span_exporter.py - span export adapter management
    • test_drift_sdk.py - main TuskDrift singleton class
    • test_communicator.py - protobuf CLI communication layer
  • Update CI workflow to run tests with coverage and upload to Coveralls
  • Add pytest-cov to dev dependencies
  • Add coverage file to .gitignore
  • Document coverage command in CONTRIBUTING.md

Copy link

@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 14 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".github/workflows/ci.yml">

<violation number="1" location=".github/workflows/ci.yml:81">
P2: Coveralls uploads run for each matrix job without parallel build configuration, so Coveralls will treat each upload as a separate build and coverage can be incomplete or overwritten. Configure `parallel: true` + `flag-name` on the matrix step and add a `parallel-finished` job to close/aggregate the build.</violation>
</file>

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


- name: Upload coverage to Coveralls
# if: matrix.python-version == '3.9' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: coverallsapp/github-action@v2
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 18, 2026

Choose a reason for hiding this comment

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

P2: Coveralls uploads run for each matrix job without parallel build configuration, so Coveralls will treat each upload as a separate build and coverage can be incomplete or overwritten. Configure parallel: true + flag-name on the matrix step and add a parallel-finished job to close/aggregate the build.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yml, line 81:

<comment>Coveralls uploads run for each matrix job without parallel build configuration, so Coveralls will treat each upload as a separate build and coverage can be incomplete or overwritten. Configure `parallel: true` + `flag-name` on the matrix step and add a `parallel-finished` job to close/aggregate the build.</comment>

<file context>
@@ -73,8 +73,12 @@ jobs:
+
+      - name: Upload coverage to Coveralls
+        # if: matrix.python-version == '3.9' && github.event_name == 'push' && github.ref == 'refs/heads/main'
+        uses: coverallsapp/github-action@v2
 
   build:
</file context>
Fix with Cubic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no longer valid

@jy-tan jy-tan merged commit 16232cc into main Jan 18, 2026
6 checks passed
@jy-tan jy-tan deleted the improve-test-coverage branch January 18, 2026 03:13
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.

2 participants