Skip to content

test: increase test coverage - #533

Open
arjun-rajappa wants to merge 4 commits into
masterfrom
increase-test-coverage
Open

arjun-rajappa wants to merge 4 commits into
masterfrom
increase-test-coverage

Conversation

@arjun-rajappa

Copy link
Copy Markdown
Contributor

No description provided.

@arjun-rajappa
arjun-rajappa force-pushed the increase-test-coverage branch 2 times, most recently from fe8d686 to 19c412b Compare September 29, 2026 05:29
@arjun-rajappa
arjun-rajappa marked this pull request as ready for review September 30, 2026 14:27
@arjun-rajappa arjun-rajappa self-assigned this Sep 30, 2026
@arjun-rajappa
arjun-rajappa marked this pull request as draft September 30, 2026 14:29
@arjun-rajappa
arjun-rajappa marked this pull request as ready for review October 7, 2026 05:35
@arjun-rajappa
arjun-rajappa requested a review from a team October 13, 2026 09:24

@CagriYonca CagriYonca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A few refactoring issues, using a single client for each DB test in the setup function and a potential false-positive issue. If the advice is right, could you apply it to all potential parts of the PR?

Comment thread test/instrumentation/aws_test.rb Outdated
Comment thread test/instrumentation/aws_test.rb Outdated
Comment thread test/instrumentation/aws_test.rb Outdated
Comment thread test/instrumentation/aws_test.rb Outdated
Comment thread test/instrumentation/aws_test.rb Outdated
Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
Refactor negative-assertion tests to use inline block predicates
(spans.any? / spans.find) instead of find_first_span_by_name.
Also fixes mongo mock expectations, corrects rack W3C tracestate
IDs to valid hex, and updates the expected no-in= context shape.

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
Create a single client in setup and reuse it across tests in aws_test
and mongo_test. Replace silent 'return unless' / 'next unless' / 'if span'
guards with refute_nil assertions in the aws, dalli, mongo and net_http
tests so they can no longer pass without a span being generated.

Fix the two tests this exposed: finish the span and enable
allow_exit_as_root in the mongo filter_statement test, and open a real
plain-HTTP connection in the net_http https URL test so the
instrumentation is not bypassed by WebMock.

Signed-off-by: Arjun Rajappa <arjun.rajappa@ibm.com>
@arjun-rajappa
arjun-rajappa force-pushed the increase-test-coverage branch from 074b639 to 5b221d8 Compare October 21, 2026 11:53
@sonarqubecloud

Copy link
Copy Markdown

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