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

(refactor): split build tests into separate files per fixture #621

Merged
merged 2 commits into from
Mar 25, 2020

Commits on Mar 17, 2020

  1. (refactor): split build tests into separate files per fixture

    - 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
    agilgur5 committed Mar 17, 2020
    Configuration menu
    Copy the full SHA
    c740def View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2020

  1. (fix/test): resolve reproducibility issues w/ execWithCache

    - 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
    agilgur5 committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    9d844cd View commit details
    Browse the repository at this point in the history