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

Change tests configuration to allow testing with new endpoints using database #2395

Merged

Conversation

jfcalvo
Copy link
Member

@jfcalvo jfcalvo commented Feb 22, 2023

In this PR we are making changes on how tests are configured to be used with the database:

  • Moved test seeds to a new test_seeds function at argilla.server.seeds package.
  • One the new test_seeds function we are defining a default "argilla" user. In the future test_seeds should only have proper seeds necessary for the application to work normally and users and other stuff should be added as test fixtures.
  • We didn't find a proper way to use transactions and rollback changes in every unit test and allow endpoints access the same data so we are truncating all the database tables after every unit test execution.
  • We added a test for one of the new workspaces endpoint that interact with the database so we can check that everything is working as expected.
  • Now our GitHub actions run (alembic) database migrations in the tests section.

@jfcalvo jfcalvo marked this pull request as ready for review February 23, 2023 10:56
Copy link
Member

@frascuchon frascuchon left a comment

Choose a reason for hiding this comment

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

💯

@frascuchon frascuchon merged commit 030b40d into feat/add-basic-database-support Feb 23, 2023
@frascuchon frascuchon deleted the add-tests-with-database-integration branch February 23, 2023 10:58
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