Skip to content

Decouple shared test expectations from AgentInstrumentationExtension - #20906

Merged
laurit merged 3 commits into
mainfrom
copilot/remove-agent-extension-checks
Oct 26, 2026
Merged

laurit merged 3 commits into
mainfrom
copilot/remove-agent-extension-checks

Conversation

Copilot AI commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Working towards #3484

Replace six concrete agent-extension checks in shared AWS SDK and JDBC tests with expectation hooks. This is standalone preparatory cleanup for separating testing infrastructure; no modules, dependencies, or production behavior change.

  • AWS SDK: Reuse existing hooks with explicit agent-fixture overrides, preserving instrumentation properties for agent/autoconfigure fixtures and builder-aligned test properties for library fixtures.
  • JDBC: Add a narrowly scoped hook for SQLite connection-initialization spans, enabled only by the agent fixture.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-10-26 19:45 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Co-authored-by: trask <218610+trask@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove concrete agent-extension type checks from tests Decouple shared test expectations from AgentInstrumentationExtension Oct 23, 2026
Copilot AI requested a review from trask October 23, 2026 17:07
@trask
trask requested a balanced review from Copilot October 23, 2026 17:09

Copilot AI 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.

🟢 Approval recommended

The test-only refactor preserves fixture-specific expectations and configuration sources, with no unresolved blocking issues.

No open issues 🎉

What changed in this PR

Decouples shared AWS SDK and JDBC test expectations from AgentInstrumentationExtension, preparing for testing-infrastructure separation without changing production behavior, modules, or dependencies.

Changes:

  • Replaces concrete extension checks with overridable expectation hooks.
  • Preserves AWS agent property-based expectations and library builder-aligned expectations.
  • Adds a SQLite connection-initialization span hook enabled only by the JDBC agent fixture.
File Description
instrumentation/​jdbc/​testing/​src/​main/​java/​io/​opentelemetry/​instrumentation/​jdbc/​testing/​AbstractJdbcInstrumentationTest.java Adds the SQLite initialization-span expectation hook.
instrumentation/​jdbc/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​jdbc/​test/​JdbcInstrumentationTest.java Enables SQLite initialization-span expectations.
instrumentation/​aws-sdk/​aws-sdk-2.2/​testing/​src/​main/​java/​io/​opentelemetry/​instrumentation/​awssdk/​v2_2/​AbstractAwsSdkTest.java Defaults attribute expectations to the library test property.
instrumentation/​aws-sdk/​aws-sdk-2.2/​testing/​src/​main/​java/​io/​opentelemetry/​instrumentation/​awssdk/​v2_2/​AbstractAws2SqsBaseTest.java Defaults receive-telemetry expectations to the library test property.
instrumentation/​aws-sdk/​aws-sdk-2.2/​testing/​src/​main/​java/​io/​opentelemetry/​instrumentation/​awssdk/​v2_2/​AbstractAws2ClientRecordHttpErrorTest.java Defaults HTTP-error expectations to the library test property.
instrumentation/​aws-sdk/​aws-sdk-2.2/​javaagent/​src/​testRdsData/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v2_2/​Aws2RdsDataTest.java Preserves agent experimental-attribute expectations.
instrumentation/​aws-sdk/​aws-sdk-2.2/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v2_2/​QueryProtocolModelTest.java Preserves agent experimental-attribute expectations.
instrumentation/​aws-sdk/​aws-sdk-2.2/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v2_2/​Aws2SqsTracingTest.java Preserves agent attribute and receive-telemetry expectations.
instrumentation/​aws-sdk/​aws-sdk-2.2/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v2_2/​Aws2SqsSuppressReceiveSpansTest.java Preserves agent attribute and receive-telemetry expectations.
instrumentation/​aws-sdk/​aws-sdk-2.2/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v2_2/​Aws2ClientTest.java Preserves agent experimental-attribute expectations.
instrumentation/​aws-sdk/​aws-sdk-2.2/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v2_2/​Aws2ClientRecordHttpErrorTest.java Preserves agent attribute and HTTP-error expectations.
instrumentation/​aws-sdk/​aws-sdk-1.11/​testing/​src/​main/​java/​io/​opentelemetry/​instrumentation/​awssdk/​v1_11/​AbstractSqsTracingTest.java Defaults receive-telemetry expectations to the library test property.
instrumentation/​aws-sdk/​aws-sdk-1.11/​testing/​src/​main/​java/​io/​opentelemetry/​instrumentation/​awssdk/​v1_11/​AbstractAwsSdkTest.java Defaults attribute expectations to the library test property.
instrumentation/​aws-sdk/​aws-sdk-1.11/​javaagent/​src/​testSqsNoReceiveTelemetry/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v1_11/​SqsSuppressReceiveSpansTest.java Preserves agent experimental-attribute expectations.
instrumentation/​aws-sdk/​aws-sdk-1.11/​javaagent/​src/​testSqs/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v1_11/​SqsTracingTest.java Preserves agent attribute and receive-telemetry expectations.
instrumentation/​aws-sdk/​aws-sdk-1.11/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v1_11/​StepFunctionsClientTest.java Preserves agent experimental-attribute expectations.
instrumentation/​aws-sdk/​aws-sdk-1.11/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v1_11/​SnsClientTest.java Preserves agent experimental-attribute expectations.
instrumentation/​aws-sdk/​aws-sdk-1.11/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v1_11/​S3ClientTest.java Preserves agent experimental-attribute expectations.
instrumentation/​aws-sdk/​aws-sdk-1.11/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v1_11/​RdsClientTest.java Preserves agent experimental-attribute expectations.
instrumentation/​aws-sdk/​aws-sdk-1.11/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v1_11/​LambdaClientTest.java Preserves agent experimental-attribute expectations.
instrumentation/​aws-sdk/​aws-sdk-1.11/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v1_11/​KinesisClientTest.java Preserves agent experimental-attribute expectations.
instrumentation/​aws-sdk/​aws-sdk-1.11/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v1_11/​Ec2ClientTest.java Preserves agent experimental-attribute expectations.
instrumentation/​aws-sdk/​aws-sdk-1.11/​javaagent/​src/​test/​java/​io/​opentelemetry/​javaagent/​instrumentation/​awssdk/​v1_11/​DynamoDbClientTest.java Preserves agent experimental-attribute expectations.

Review effort: Balanced

@trask
trask marked this pull request as ready for review October 23, 2026 17:15
@trask
trask requested a review from a team as a code owner October 23, 2026 17:15
Preserve the PR's fixture expectation hooks and the incoming ElasticMQ bound-port setup, removing both obsolete imports.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

🟢 Approval recommended

The test-only refactor preserves existing expectation sources through explicit fixture overrides, with no unresolved defects identified.

No open issues 🎉

Review effort: Balanced

@laurit
laurit merged commit 7c2da3f into main Oct 26, 2026
70 checks passed
@laurit
laurit deleted the copilot/remove-agent-extension-checks branch October 26, 2026 19:44
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.

4 participants