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

[sql-8]: run itests against all DB types #955

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ellemouton
Copy link
Member

Depends on #954

This completes the final step of the accounts section in phase 1 of #917

Here we run our CI itests against all DB types. As of this PR, that means that the accounts store is spun up with different DB backends for the various iterations.

(more detailed description to follow)

@ellemouton ellemouton self-assigned this Jan 23, 2025
@ellemouton ellemouton added database Postgres and sql related issues no-changelog This PR is does not require a release notes entry tests sql-ize labels Jan 23, 2025
@ellemouton ellemouton force-pushed the sql8Accounts8 branch 3 times, most recently from 051da0d to 9e1bae0 Compare January 24, 2025 10:26
In this commit, we add the SQLStore type which implements the
accounts.Store interface. To demonstrate that it works as expected, we
also plug this implementation into all the account unit tests to show
that they pass against the sqlite and postgres backends.

One can use `make unit pkg=accounts tags=test_db_postgres` or
`make unit pkg=accounts tags=test_db_sqlite` to test locally.

Note that 2 small timestamp related changes are made to the unit tests.
This is to compensate for timestamp precision in postgres.
In this commit, we introduce a DevConfig struct which is embedded in the
main lit Config struct. It is defined in two separate files that are
made mutually exclusive using the `dev` build tag. The idea of this
struct is that it allows us to expose additional config options to LiT
if we build in a development environment such as our itests. In other
words, we will be able to start developing features and testing them
before making them available to users via the production build.

As of this commit, both implementations of the struct are the same.
In this commit, we expand the dev build's DevConfig options struct with
Postgres and SQL backend options that can be used to initialise the
account store.
Add the ability to specify the db backend to run use for accounts when
running itests.

With this commit, you can run something like: `make itest
dbbackend=sqlite`.
In this commit, we ensure that our CI runs our itests against all
available DB backends. Currently, this will only affect the accounts
store.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database Postgres and sql related issues no-changelog This PR is does not require a release notes entry sql-ize tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant