Skip to content

Add more Cassandra batch testing#19038

Open
trask wants to merge 5 commits into
open-telemetry:mainfrom
trask:cassandra-batch-current-behavior-tests
Open

Add more Cassandra batch testing#19038
trask wants to merge 5 commits into
open-telemetry:mainfrom
trask:cassandra-batch-current-behavior-tests

Conversation

@trask

@trask trask commented Jun 18, 2026

Copy link
Copy Markdown
Member

Add current-behavior batch coverage for Cassandra 3.x javaagent instrumentation and the shared Cassandra 4.x tests before the core DB batch semantic changes land (open-telemetry/semantic-conventions#3811). The tests pin empty batch fallback behavior, single-statement batch handling, stable-semconv multi-statement batch names and summaries with db.operation.batch.size, and old-semconv generic multi-query behavior.

@trask trask force-pushed the cassandra-batch-current-behavior-tests branch 5 times, most recently from 5f1fc9e to 826add8 Compare June 18, 2026 23:47
@trask trask force-pushed the cassandra-batch-current-behavior-tests branch from 826add8 to 79153fd Compare June 19, 2026 16:11
@trask trask requested a review from Copilot June 19, 2026 17:07
@trask trask changed the title Add Cassandra current-behavior batch tests [Tests only] Add Cassandra batch tests Jun 19, 2026
@trask trask changed the title [Tests only] Add Cassandra batch tests [Tests only] Add more Cassandra batch testing Jun 19, 2026

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.

Pull request overview

This PR consolidates and expands the Cassandra batch-statement test coverage ahead of upcoming core DB batch semantic-convention changes. It replaces the two separate batch tests (batchStatementWithSameQuery and batchStatementWithDifferentQueries) with a single parameterized batchStatement test driven by a BatchScenario builder, and adds two new scenarios (empty batch and single-statement batch) to pin current behavior. The change is applied symmetrically to the Cassandra 3.x javaagent test and the shared Cassandra 4.x AbstractCassandraTest (used by the 4.0/4.4 modules).

Changes:

  • Parameterized the batch test with four scenarios: empty, single, twoSameOperation, twoDifferentOperations, each pinning span name, statement, batch size, query summary, and operation/table for both stable and old semconv.
  • Introduced a BatchScenario + Builder test helper to express each scenario declaratively (with a Function<Session, BatchStatement> to construct the batch).
  • Moved statement preparation into each scenario's batch builder (safe, since prepare() is not traced by the Cassandra instrumentation).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
instrumentation/cassandra/cassandra-3.0/javaagent/src/test/java/.../v3_0/CassandraClientTest.java Replaces two batch tests with a parameterized batchStatement test plus BatchScenario helper covering empty/single/multi cases.
instrumentation/cassandra/cassandra-common-4.0/testing/src/main/java/.../v4_0/AbstractCassandraTest.java Same parameterized batch refactor for the shared 4.x test base, adding empty/single scenarios and DB_OPERATION/DB_CASSANDRA_TABLE assertions.

trask and others added 2 commits June 19, 2026 10:14
Co-authored-by: Copilot Autofix powered by AI <175728472+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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Co-authored-by: Copilot Autofix powered by AI <175728472+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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@trask trask marked this pull request as ready for review June 19, 2026 18:32
@trask trask requested a review from a team as a code owner June 19, 2026 18:32
@trask trask changed the title [Tests only] Add more Cassandra batch testing Add more Cassandra batch testing Jun 19, 2026
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