Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Add unit test to cover basic SQLite functionalities. #380

Merged
merged 14 commits into from
May 13, 2024

Conversation

LinZhihao-723
Copy link
Member

@LinZhihao-723 LinZhihao-723 commented May 2, 2024

References

Description

Before this PR, we don't have unit test coverage for SQLite Database functionalities. This PR implements a simple SQLite DB unit test, which includes the following testing flow:

  1. The test case will create a new database with a fixed testing table schema.
  2. Insert data rows into the database.
  3. Persist the database to the disk.
  4. Open the created database and create indices.
  5. Iterate data rows from the database with a certain ordering (with select statement).
  6. Ensure the read results are the same as the input data in step 2, with the expected ordering.
    Notice that this PR only provides a skeleton for SQLite functionality testing. It doesn't cover all the SQLite db usage we have in the current clp implementation. We will add more tests later when we push new SQLite abstracted features, such as SQLitePreparedSelectStatement.

Validation performed

  1. Passed clang-tidy linting check.
  2. Ensure unit tests are passed locally in Linux.
  3. GH Workflow passed.

components/core/tests/test-SQLiteDB.cpp Outdated Show resolved Hide resolved
components/core/src/clp/SQLiteDB.hpp Outdated Show resolved Hide resolved
components/core/tests/test-SQLiteDB.cpp Outdated Show resolved Hide resolved
components/core/tests/test-SQLiteDB.cpp Outdated Show resolved Hide resolved
components/core/tests/test-SQLiteDB.cpp Outdated Show resolved Hide resolved
components/core/tests/test-SQLiteDB.cpp Outdated Show resolved Hide resolved
components/core/tests/test-SQLiteDB.cpp Outdated Show resolved Hide resolved
components/core/tests/test-SQLiteDB.cpp Outdated Show resolved Hide resolved
components/core/tests/test-SQLiteDB.cpp Outdated Show resolved Hide resolved
components/core/tests/test-SQLiteDB.cpp Show resolved Hide resolved
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

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

How about:

core: Add unit test to cover basic SQLite functionalities. (#380 )

@LinZhihao-723 LinZhihao-723 changed the title core: Add unit test to cover basic SQLite Database functionalities. core: Add unit test to cover basic SQLite functionalities. May 13, 2024
@LinZhihao-723
Copy link
Member Author

How about:

core: Add unit test to cover basic SQLite functionalities. (#380 )

lgtm

@LinZhihao-723 LinZhihao-723 merged commit 0611040 into y-scope:main May 13, 2024
11 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.

2 participants