Skip to content

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

Open
ravindra-RKB wants to merge 2 commits into
root-project:masterfrom
ravindra-RKB:feature-sqlite-tests
Open

ravindra-RKB wants to merge 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   3d 21h 23m 42s ⏱️
 3 899 tests  3 899 ✅ 0 💤 0 ❌
83 478 runs  83 478 ✅ 0 💤 0 ❌

Results for commit fc3389d.

♻️ This comment has been updated with latest results.

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

This branch has not been deployed

No deployments
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.

3 participants