connext / indra

[LEGACY] Monorepo containing everything related to the core Connext protocols and network.
MIT License
84 stars 38 forks source link

[cf-core] Add regex support to test container #634

Closed ArjunBhuptani closed 4 years ago

ArjunBhuptani commented 4 years ago

Right now, you have to run make test-cf which runs every test and takes ages. Adding regex support to the jest config/bash scripts would help speed up iterations immensely.

rhlsthrm commented 4 years ago

Yes please.

bohendo commented 4 years ago

make is great for shortcuts & simplifying CI/CD but sadly it doesn't accept command line args.

That's fine though bc the test script itself already supports this. You can run just one test like this:

$ bash ops/test-cf.sh modules/cf-core/test/machine/integration/setup-then-set-state.spec.ts 
Starting indra_ethprovider_cf_tester..
e924c5fa08b4a5414f871d756181c8d3a415cc2b1bd20952c09096da281e72f8
CF tester container launched!
Waiting for ethprovider to wake up..
Launching tests!

 PASS  test/machine/integration/setup-then-set-state.spec.ts (10.826s)
  Scenario: Setup, set state on free balance, go on chain
    ✓ should distribute funds in ETH free balance when put on chain (5889ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        10.888s
Ran all test suites matching /modules\/cf-core\/test\/machine\/integration\/setup-then-set-state.spec.ts/i.
Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?

Tests finished, stopping test containers..
indra_ethprovider_cf_tester