Skip to content

Add unit tests for 8 more JDBC query DAOs (inline SQL)#13809

Open
currenjin wants to merge 8 commits intoapache:masterfrom
currenjin:test/jdbc-inline-sql-dao-tests
Open

Add unit tests for 8 more JDBC query DAOs (inline SQL)#13809
currenjin wants to merge 8 commits intoapache:masterfrom
currenjin:test/jdbc-inline-sql-dao-tests

Conversation

@currenjin
Copy link
Copy Markdown
Contributor

@currenjin currenjin commented Apr 9, 2026

What's this PR about?

Adds unit tests for 8 JDBC query DAOs that use inline SQL or private `buildSQL` methods, requiring Mockito SQL capture.

With the previous rounds (#13800, #13802, #13808), DAO test coverage goes from 18/39 (46%) to 26/39 (67%).

Tests

DAO Approach Tests
JDBCMetricsQueryDAO protected `buildMetricsValueSql()` + Mockito capture select with aggregation op, TABLE_COLUMN + TIME_BUCKET range + limit
JDBCServiceLabelQueryDAO Mockito capture TABLE_COLUMN + SERVICE_ID filter, LABEL column in select
JDBCSpanAttachedEventQueryDAO Mockito capture ZK/SW methods: trace ID IN clause, order by start_time asc
JDBCProfileTaskLogQueryDAO protected `buildSQL()` TABLE_COLUMN + INDEX_NAME param, ORDER BY OPERATION_TIME DESC
JDBCPprofTaskLogQueryDAO Mockito capture TABLE_COLUMN + TASK_ID filter, ORDER BY OPERATION_TIME desc, blank taskId returns empty
JDBCContinuousProfilingPolicyDAO Mockito capture TABLE_COLUMN + SERVICE_ID IN clause, single vs multiple placeholders
JDBCAsyncProfilerTaskLogQueryDAO Mockito capture TABLE_COLUMN + TASK_ID filter, ORDER BY OPERATION_TIME desc
JDBCAsyncProfilerTaskQueryDAO Mockito capture conditional SERVICE_ID/LIMIT, ORDER BY CREATE_TIME DESC, getById with TASK_ID + LIMIT 1

@currenjin currenjin changed the title Add unit tests for JDBCMetricsQueryDAO, JDBCServiceLabelQueryDAO, and JDBCSpanAttachedEventQueryDAO Add unit tests for 6 more JDBC query DAOs (inline SQL) Apr 9, 2026
@wu-sheng wu-sheng added the test Test requirements about performance, feature or before release. label Apr 10, 2026
@wu-sheng wu-sheng added this to the 10.5.0 milestone Apr 10, 2026
@currenjin currenjin changed the title Add unit tests for 6 more JDBC query DAOs (inline SQL) Add unit tests for 8 more JDBC query DAOs (inline SQL) Apr 10, 2026
@wu-sheng
Copy link
Copy Markdown
Member

GenAI e2e seems to have some issues.

@wm-currenjin
Copy link
Copy Markdown

The OTLP Virtual GenAI and Zipkin Virtual GenAI failures are pre-existing on the master branch (run 24206557119) and are unrelated to this PR. This PR only adds unit tests in the JDBC storage plugin and does not touch any GenAI or OTLP code.

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

Labels

test Test requirements about performance, feature or before release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants