split scale tests into separate files #57
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 adescribe
at the top level of each scale test file, we are instead exporting the function which would run in such adescribe
. And then running all of thedescribes
themselves fromscale.test.ts
.Resources: