Open transmissions11 opened 2 years ago
ideally don't run non-concrete tests (tests prefixed with prove
/invariant
and standard test
prefixed functions with arguments) during dapp snapshot
or else things could take a while
i feel like it could make sense to add a flag for doing a "quick" run in the general case, that skips the above specified longer running tests, that we could then leverage here...wdyt
would be epic.
this is some wishlist shit but would love an env var like DAPP_TEST_MODE
that could be set to 1
or 2
(0
/unset would just trigger the current behavior). In mode 1
it runs all prove tests as fuzz tests for people to quickly run their whole suite and make sure there's no low hanging fruit. In mode 2
it would do what we discussed above and ignore all non-concrete tests entirely.
Writing this down so I don't forget. Could implement this hardhat gas snapshotting pattern pretty easily by:
Adding a
dapp snapshot
command that runsdapp test
and searches through the output for(gas: XXXXX)
, then stores the results in a.dappshots
file (unless overriden via an env var/flag) with each test's gas usage tied to its nameAdding a
dapp check-snapshot
command that runsdapp snapshot
(but outputs to a temp file instead of.dappshots
) and compares it with.dappshots
. If they don't match the command exits with an error.