(refactor): split build tests into separate files per fixture#621
Merged
agilgur5 merged 2 commits intojaredpalmer:masterfrom Mar 25, 2020
Merged
(refactor): split build tests into separate files per fixture#621agilgur5 merged 2 commits intojaredpalmer:masterfrom
agilgur5 merged 2 commits intojaredpalmer:masterfrom
Conversation
- better organized that way as the tests are somewhat independent of one another and previously even I was confused where to put different types of tests - also refactor some test naming and some redundant usage of flags - especially for 0-config, where flags shouldn't be used - and remove testEnvironment comment as it's already set in jest config (optim): now that it's one fixture per file, we only need to copy the fixture directory once per file, which should be a speed boost - and sometimes may not need to re-run `tsdx build` when not necessary - also the different test files get parallelized, which is also faster - before: 53s avg on my machine, after: 37s avg on my machine - avg for running all tests - pretty BIG difference
e62c0e0 to
c740def
Compare
This was referenced Mar 17, 2020
agilgur5
commented
Mar 19, 2020
- had removed some duplicate execs in the previous commit in order to
speed up tests so that exec wouldn't need to be re-run
- but this caused reproducibility issues, as if you change a test
to `it.only` temporarily, it would fail hard as nothing would be
exec'd if it weren't the first test
- this uses an `execWithCache` function to instead naive "cache"
the output and not re-run the same command twice-in-a-row
- only works with sequential tests, but good enough for now
- similar to a beforeAll() for a group of the same test, but no
nesting or confusing variables in describe scope
- N.B. no need for stageName in cache function or something more
complex because each stage is parallelized as multi-process
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
better organized that way as the tests are somewhat independent of
one another and previously even I was confused where to put different
types of tests
also refactor some test naming and some redundant usage of flags
and remove testEnvironment comment as it's already set in jest config (this is why (optim/test): use node testEnvironment #405 didn't make a big difference)
(optim): now that it's one fixture per file, we only need to copy the
fixture directory once per file, which should be a speed boost
and sometimes may not need to re-run
tsdx buildwhen not necessaryalso the different test files get parallelized, which is also faster
before: 53s avg on my machine, after: 37s avg on my machine
Been meaning to do this for a while (as well as some other test optimizations still in-progress), and now that there's more and more fixtures (e.g. #468, #525) and more and more tests, I think now is a good time to do this