Skip to content

[sql] Add unit tests for TSQLiteServer and SQLite interfaces - #23519

Merged
linev merged 2 commits into
root-project:masterfrom
ravindra-RKB:feature-sqlite-tests
Oct 29, 2026
Merged

linev merged 2 commits into
root-project:masterfrom
ravindra-RKB:feature-sqlite-tests

Conversation

@ravindra-RKB

Copy link
Copy Markdown
Contributor

This Pull request:

Changes or fixes:

This PR adds comprehensive unit testing to the sql/sqlite module, which was previously lacking test coverage. It implements a suite of gtest cases inside sql/sqlite/test/test_sqlite.cxx to test TSQLiteServer, TSQLiteResult, TSQLiteRow, and TSQLiteStatement.

The added tests include:

  • Establishing a database connection.
  • Creating tables and inserting data via Exec().
  • Querying and retrieving results through Query() and TSQLResult/TSQLRow.
  • Retrieving table metadata via GetTableInfo().
  • Preparing and iterating over parameterized statements via TSQLStatement.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

@dpiparo

dpiparo commented Sep 28, 2026

Copy link
Copy Markdown
Member

Hi, thanks for the proposal. Could you keep the test environment clean, for example by wrapping the creation of the db in a RAII object for example? This will not leave sqlite files around.
A question, too: did you have a moment to have a look to ROOT's contributing guide?

@ravindra-RKB

Copy link
Copy Markdown
Contributor Author

Hi @dpiparo, thanks for the feedback!

Yep, I had a look at the contributing guide and I'm fully aware of the rules. I take full responsibility for the code I'm submitting and I'll make sure it's up to the project's standards.

Good catch on the RAII part! I just pushed an update that wraps the database creation using ROOT::TestSupport::FileRaii, so the db files get cleaned up properly now. I also fixed a missing include that was tripping up the CI builds earlier.

Let me know if it looks good to you now or if I should change anything else!

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Test Results

    24 files      24 suites   4d 3h 28m 50s ⏱️
 3 901 tests  3 900 ✅ 0 💤 1 ❌
83 524 runs  83 523 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 67b1dfc.

♻️ This comment has been updated with latest results.

@linev linev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Now code looks ok.

Adds Google Test unit tests for the TSQLiteServer, TSQLiteResult, TSQLiteStatement, and TSQLiteRow classes to improve test coverage in the sql module.
@ravindra-RKB

Copy link
Copy Markdown
Contributor Author

Thanks @linev for the review and approval! Rebased onto latest master to re-run the CI checks.

@linev
linev merged commit b7a9392 into root-project:master Oct 29, 2026
34 of 36 checks passed
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