Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MariaDB, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
Prior to this PR, our test-server part of the CI process ran the full test suite for packages/server in a single runner, with all of the databases we test against running at the same time. This necessitated us running on larger runners than the default due to the memory usage, and over time has grown to take over 15 minutes.
This PR splits test-server out into per-database shards. Each shard runs the specific database being tested against, and only runs tests that depend on that database. There's an extra shard for tests that do not require a database to be running.
This is all achieved through a new test function called datasourceDescribe. This is designed to act like a normal Jest describe, except you pass in the datasource types you want to test against and it manages the setup of the datasources for you. It also takes into account a DATASOURCE environment variable, which you can specify to limit the tests to just that datasource. This is how we limit CI to specific datasources.
I'm also making use of Jest filters to be able to split tests into ones that need a datasource (by looking for the string datasourceDescribe in each test file), and ones that don't.
Description
Prior to this PR, our
test-server
part of the CI process ran the full test suite forpackages/server
in a single runner, with all of the databases we test against running at the same time. This necessitated us running on larger runners than the default due to the memory usage, and over time has grown to take over 15 minutes.This PR splits
test-server
out into per-database shards. Each shard runs the specific database being tested against, and only runs tests that depend on that database. There's an extra shard for tests that do not require a database to be running.This is all achieved through a new test function called
datasourceDescribe
. This is designed to act like a normal Jestdescribe
, except you pass in the datasource types you want to test against and it manages the setup of the datasources for you. It also takes into account aDATASOURCE
environment variable, which you can specify to limit the tests to just that datasource. This is how we limit CI to specific datasources.I'm also making use of Jest filters to be able to split tests into ones that need a datasource (by looking for the string
datasourceDescribe
in each test file), and ones that don't.