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

Add integration tests for backend #1532

Closed
seluianova opened this issue Jul 10, 2024 · 1 comment · Fixed by #1552
Closed

Add integration tests for backend #1532

seluianova opened this issue Jul 10, 2024 · 1 comment · Fixed by #1552
Assignees
Labels

Comments

@seluianova
Copy link
Contributor

seluianova commented Jul 10, 2024

Is your feature request related to a problem? Please describe.
I think it would be nice to have integration tests for backend.
Javalin allows to implement that:
https://javalin.io/tutorials/testing

The question is, what database we would like to use for integration tests?

Option-1:
Database from our local environment.
In this case, the tests will change the database state. Not sure if that's desirable.
If we use this option, we can either accept these implications or revert the changes after each test.
Another disadvantage would be - migrations, if the database version is larger than the application version, we will have to resolve this problem manually.

Option-2 (sounds the best to me):
Run a separate database container for tests.
This can be implemented using the Testcontainers framework: https://testcontainers.com
In this case we will have a clean database for every test run.
Which also means, we can easily apply migrations.

Option-3:
Mock Exposed framework.
But as far as I've tried, it doesn't seem like it can be easily mocked.

@seluianova seluianova self-assigned this Jul 10, 2024
@seluianova
Copy link
Contributor Author

We already have an issue for the database setup: #1318

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant