bitemyapp / esqueleto

New home of Esqueleto, please file issues so we can get things caught up!
BSD 3-Clause "New" or "Revised" License
370 stars 107 forks source link

Refactor test suite #254

Open parsonsmatt opened 3 years ago

parsonsmatt commented 3 years ago

Currently Common.Test is a massive, 2500 line module that contains all the common tests.

It would be much nicer if it were split up into multiple modules that are scoped by feature.

parsonsmatt commented 3 years ago

One annoyance is that you need to build the Common.Test module three times, once per each test suite, since we use file sharing instead of a more modular system.

An internal library might be nice here, but IIRC that's not supported by stack, so it's a non-starter.

A nicer option is probably just to have a single test suite.

parsonsmatt commented 3 years ago

261 consolidates the test suite, resulting in significant speed improvements.

The Postgres tests are slow. We really need a way of sharing a database pool across tests, rather than creating a connection, running migrations, and wiping the database for every single test.

Ideally, seeding the database with test values could also be done. Would be nice to use before and after to ensure that things are setup as they need to be, too.