capella-collab-manager icon indicating copy to clipboard operation
capella-collab-manager copied to clipboard

Improve pytest execution time

Open MoritzWeber0 opened this issue 1 year ago • 2 comments

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.

MoritzWeber0 avatar Nov 08 '23 07:11 MoritzWeber0

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.

dominik003 avatar Jan 02 '24 13:01 dominik003

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.

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.

MoritzWeber0 avatar Feb 29 '24 09:02 MoritzWeber0