You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current setup for the unit tests uses the same engine with the same URL for connecting to the database that gets deployed when executing the Argilla server locally. This is not ideal, because if you have played with the server, added datasets, annotated, etc, and then run the unit tests, the database will get erased losing all the work done manually.
Apart from that, the current pytest fixture to yield the DB session is removing all the rows from the tables after the test gets executed instead of rolling back.
I would like a different database to be used to run the unit tests and to roll back the transactions instead of removing all the rows after the test gets executed.
The text was updated successfully, but these errors were encountered:
gabrielmbmb
added
area: api
Indicates that an issue or pull request is related to the Fast API server or REST endpoints
and removed
area: api
Indicates that an issue or pull request is related to the Fast API server or REST endpoints
labels
May 26, 2023
# Description
I've updated the unit test setup to use a different database than the
one used by the local deployment of the Argilla server. In addition,
I've updated the pytest fixtures that provided a connection to the DB,
and now before executing every test a new transaction is created that
gets rollbacked when the execution of the test has finished, leaving no
traces in the DB.
Also, I've aligned the SQLAlchemy models metadata with the metadata in
the current alembic migrations scripts.
Closes#2987
**Type of change**
- [x] New feature (non-breaking change which adds functionality)
- [x] Refactor (change restructuring the codebase without changing
functionality)
- [x] Improvement (change adding some improvement to an existing
functionality)
**How Has This Been Tested**
All the unit tests are passing using this new DB for the tests.
**Checklist**
- [x] I have merged the original branch into my forked branch
- [ ] I added relevant documentation
- [x] follows the style guidelines of this project
- [x] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)
The current setup for the unit tests uses the same engine with the same URL for connecting to the database that gets deployed when executing the Argilla server locally. This is not ideal, because if you have played with the server, added datasets, annotated, etc, and then run the unit tests, the database will get erased losing all the work done manually.
Apart from that, the current pytest fixture to yield the DB session is removing all the rows from the tables after the test gets executed instead of rolling back.
I would like a different database to be used to run the unit tests and to roll back the transactions instead of removing all the rows after the test gets executed.
The text was updated successfully, but these errors were encountered: