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 scale tests into separate files #57

Merged
merged 2 commits into from
Nov 5, 2022
Merged

split scale tests into separate files #57

merged 2 commits into from
Nov 5, 2022

Conversation

kubikowski
Copy link
Owner

@kubikowski kubikowski commented Nov 5, 2022

Description:

There is a fundamental design decision in the Jest testing framework, such that all unit test files are run in sandboxed runtimes from each other. And there is no real way of sharing initialized TS between those isolated runtimes.

This presents a couple of issues, but the foremost is that: even if we set jest to runInBand (run the test files serially) they will each need to run the setup files. And the scale test setup itself takes a substantial amount of time to initialize, some ~15s. So, by separating the scale test files, we would be adding ~150s of initialization to the overall scale testing time. This is unacceptable.

In order to maintain a singular initialization, we are still running all scale tests from inside a singular scale.test.ts. To do this, instead of writing a describe at the top level of each scale test file, we are instead exporting the function which would run in such a describe. And then running all of the describes themselves from scale.test.ts.

Resources:

@kubikowski kubikowski added type: Refactor just cleaning code: TypeScript changes to the typescript project labels Nov 5, 2022
@kubikowski kubikowski added this to the v1.5.2 milestone Nov 5, 2022
@kubikowski kubikowski self-assigned this Nov 5, 2022
@kubikowski kubikowski merged commit df10489 into main Nov 5, 2022
@kubikowski kubikowski deleted the scale branch November 5, 2022 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code: TypeScript changes to the typescript project type: Refactor just cleaning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant