Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split server tests out by database #14992

Merged
merged 36 commits into from
Nov 18, 2024

Conversation

samwho
Copy link
Collaborator

@samwho samwho commented Nov 6, 2024

Description

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.

Copy link

qa-wolf bot commented Nov 6, 2024

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/xl labels Nov 6, 2024
Base automatically changed from chore/sqs-always-on to master November 18, 2024 09:53
@samwho samwho marked this pull request as ready for review November 18, 2024 11:13
@samwho samwho requested a review from a team as a code owner November 18, 2024 11:13
@samwho samwho requested review from adrinr and mike12345567 and removed request for a team and adrinr November 18, 2024 11:13
@mike12345567 mike12345567 merged commit 4d018f3 into master Nov 18, 2024
19 checks passed
@mike12345567 mike12345567 deleted the split-server-tests-out-by-database branch November 18, 2024 11:28
@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
firestorm Data/Infra/Revenue Team size/xl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants