Skip to content

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Jul 16, 2025

Summary

Adds a test-only CentralBlob decoder utility and comprehensive unit tests for the OTLP encoder to validate encoding correctness.

While the actual correctness of encoding is validated using the validation with the binary data blob encoded using C++ encoder in mod.rs, this extends the functionality further to test the values for individual OTLP log fields, attribute types, trace context, schema generation, batching behavior, and end-to-end encoding/decoding workflows.

Changes

  • New: central_blob_decoder.rs - Test-only utility for decoding CentralBlob payloads
  • Enhanced: otlp_encoder.rs - Added 7 basic tests covering encoder functionality.

New unit tests:

  • test_schema_caching_behavior - Validates schema reuse and cache efficiency
  • test_event_name_and_batching - Tests event grouping and empty name handling
  • test_comprehensive_field_encoding - Verifies all field types are properly encoded
  • test_field_ordering_consistency - Ensures field order doesn't affect schema ID
  • test_multiple_schemas_per_batch - Tests multiple schemas in single batch
  • test_minimal_vs_maximal_logs - Covers edge cases for minimal/maximal logs
  • test_timestamp_and_id_encoding - Validates timestamp and ID hex encoding

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@lalitb lalitb requested a review from a team as a code owner July 16, 2025 06:46
Copy link

codecov bot commented Jul 16, 2025

Codecov Report

Attention: Patch coverage is 92.42054% with 31 lines in your changes missing coverage. Please review.

Project coverage is 49.7%. Comparing base (492701b) to head (a552ffc).

Files with missing lines Patch % Lines
...eneva-uploader/src/payload_encoder/otlp_encoder.rs 91.7% 21 Missing ⚠️
...loader/src/payload_encoder/central_blob_decoder.rs 93.5% 10 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #374     +/-   ##
=======================================
+ Coverage   48.4%   49.7%   +1.3%     
=======================================
  Files         69      70      +1     
  Lines       9456    9722    +266     
=======================================
+ Hits        4581    4841    +260     
- Misses      4875    4881      +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants