how do you set up database before test?

currently we have quite old project, in our test framework we are using dbUnit to set up data before tests. This thing is quite old and i'm thinking about purify it with fire. The only thing that stops me is i'm not sure what to use instead. Simply insert/merge data in before or may be there are some good tools/libs that can update database using data from xml/csv/…

Posted Jan 26, 2023, 10:44 PM UTC

69

I use plain old sql scripts. Nothing fancy.

7
LasagneEnthusiast•
1
AndroidNextdoor•

Seed your data in a docker container and tag your image. MySQL makes this extremely easy.

2
CloudTarek•

Before setting up a database for testing, it is important to ensure that the project goals and requirements are clearly defined. Once the scope of the project is established, the database should be designed to accommodate the necessary information. Attention should be paid to the data types, data relationships, and any performance requirements.

​

Once the database is designed, the necessary tables and fields should be created, and any constraints and indexes should be established. Finally, data should be imported if necessary and tested for accuracy. After all of these steps are completed, the database should be ready for testing.

1

ChatGPT is that you?

9
ocnarf•

Sometimes you wonder if machines will be able to pass the Turing test (https://en.wikipedia.org/wiki/Turing_test) about AI not because they can behave like human, but because humans behave like machines.

3

I use endpoints from specification or sql sripts. Somitimes jist adding rows in table manualy

1

I know that in another teams QAs have a fixtures for databases, it's really usefull. But it usually takes developers' time or you can try to write it by yourself

1

But sometimes endpoints isn't a good solution because you can get an inconsistent data

1