capella-collab-manager
capella-collab-manager copied to clipboard
Improve pytest execution time
We reinitialize the database for each pytest individually. This takes a lot of time and slows down the tests.
One idea could be to not drop all tables, but instead just delete all rows. To identify slow code, we can also use cProfile or https://github.com/pyutils/line_profiler.
One solution we should consider is not to use Postgres database but sqlite. However, at the moment we have the problem that sqlite currently lacks JSONB
as a type, which we need. The good thing is that work is currently underway to add JSONB
to sqlite (see here), but it will be some time before this is actually released and also supported by sqlalchemy.
One solution we should consider is not to use Postgres database but sqlite. However, at the moment we have the problem that sqlite currently lacks
JSONB
as a type, which we need. The good thing is that work is currently underway to addJSONB
to sqlite (see here), but it will be some time before this is actually released and also supported by sqlalchemy.
We can also use the JSON type for testing, the interface should be the same. However, there is some dialect specific code which we would need to generalize.