How to load fixtures for a test suite using Test :: DBIx :: Class?

I have a bunch of tests for my DBIx :: Class , and I'm using Test :: DBIx :: Class . This is great as it gives me useful test functions and loads. It also has the Test :: mysqld property, so I can dynamically create a test instance of mysqld, deploy the schema, load instruments and test. But if I have a bunch of test scripts, it seems silly to start the server, deploy and load devices at the beginning of each script when creating an instance through the constructor.

What is the best way to create a test database and populate it for the duration of my tests?

+4
source share
2 answers

At work, one of the first tests that we run loads all the devices needed for the rest of the tests. This is a way to manage this, but your later comment also sounds reasonable.

+1
source

I had additional thoughts about this and came to the conclusion that I should separate my devices and load only those that are used in this test script. It makes sense, so test scripts can be run independently or using show-shuffle without bloating!

0
source

Source: https://habr.com/ru/post/1335909/


All Articles