Skip to content

test(otlp-common): expand test coverage for OTLP common exporter#2075

Open
arjun-rajappa wants to merge 4 commits into
open-telemetry:mainfrom
arjun-rajappa:add-test-to-otlp-common
Open

test(otlp-common): expand test coverage for OTLP common exporter#2075
arjun-rajappa wants to merge 4 commits into
open-telemetry:mainfrom
arjun-rajappa:add-test-to-otlp-common

Conversation

@arjun-rajappa

Copy link
Copy Markdown
Contributor

Closes #1667
Expands test coverage for the OTLP common exporter and adds span flags support per OTLP specification.

Changes
Added build_span_flags method to set remote parent context flags on spans and links
Comprehensive test coverage for all private methods (as_otlp_span, as_otlp_status_code, as_otlp_span_kind, as_otlp_key_value, as_otlp_any_value)
Integration tests for complex spans with multiple resources and scopes
Enhanced error handling tests for encoding issues
Testing
All tests pass. Coverage expanded from basic functionality to comprehensive edge cases.

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot

@kaylareopelle

Copy link
Copy Markdown
Contributor

Hi @arjun-rajappa, thanks for your patience with my review. Could you take a look at the failing tests?

@thompson-tomo

Copy link
Copy Markdown
Contributor

@kaylareopelle i have split out the new test cases to a seperate PR #2159 to enable this to be more focussed.

@arjun-rajappa it would be great if you could avoid mixing in format changes as it just ends up making it more time consuming to review.

@arjun-rajappa

Copy link
Copy Markdown
Contributor Author

Hi @arjun-rajappa, thanks for your patience with my review. Could you take a look at the failing tests?

I believe these failures are addressed already in #2074. As these are related to otlp-http. Once the other PR is merged in these should start passing.

@thompson-tomo

Copy link
Copy Markdown
Contributor

I don't think that is the case as our main is passing so a change here is resulting in the failure.

Note common is a dependency of http hence why it is possible a change to common could lead to failures in http.

@arjun-rajappa

Copy link
Copy Markdown
Contributor Author

These changes are closely related, as otlp-http relies on methods defined in otlp-common. As a result, changes to otlp-common can impact the tests in otlp-http. If needed, I can add the changes here or rebase this branch entirely on top of #2074.

@kaylareopelle

Copy link
Copy Markdown
Contributor

These changes are closely related, as otlp-http relies on methods defined in otlp-common. As a result, changes to otlp-common can impact the tests in otlp-http. If needed, I can add the changes here or rebase this branch entirely on top of #2074.

Any approach is fine here, as long as it's clear what was brought in and whether we need to adhere to a specific merge order. We can also wait to review this one until #2074 is merged too if that's easier.

@kaylareopelle

Copy link
Copy Markdown
Contributor

Hi @arjun-rajappa, could you merge main into your branch so that we can see the tests run with the changes from #2074?

@kaylareopelle

Copy link
Copy Markdown
Contributor

Hi @arjun-rajappa, it looks like there are some failures after merging main into this branch. The translates all the things tests are kind of tricky. Let me know if you want help fixing them.

Add SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK flag with sampled bit (1) to all span assertions in trace_exporter_test.rb to align test expectations with actual span flag behavior.

- Add flags field to 6 span test assertions
- Set flags to SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK | 1 (sampled)
- Ensures test expectations match the span flags set during export

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
@arjun-rajappa arjun-rajappa force-pushed the add-test-to-otlp-common branch from 04514cc to fb63205 Compare June 12, 2026 17:26
@arjun-rajappa

Copy link
Copy Markdown
Contributor Author

Hi @kaylareopelle ,
The previous failures have been fixed.

@thompson-tomo

Copy link
Copy Markdown
Contributor

There is discussion in #2159 about the test cases, with that pr being purely the new tests added here.

@arjun-rajappa based on feedback of the tests, it would make things easier if this pr focussed on just the new feature and the corresponding tests of that functionality with general tests added seperately

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.

Make otlp-http, otlp-grpc, and otlp-common gems production-ready

3 participants