makerdao / spells-mainnet

Staging repo for MakerDAO weekly executive spells
GNU Affero General Public License v3.0
108 stars 45 forks source link

Add Foundry `forge` support for quicker testing #213

Closed hexonaut closed 2 years ago

hexonaut commented 2 years ago

Using Foundry forge against a local node is around 100x faster than DappTools.

Comparing both without optimizations yields:

12s on forge 20m4s on dapptools

The amount of time savings makes it clear we should be doing iterative testing using forge. Final testing should still be done on dapptools as it is tried and tested.

godsflaw commented 2 years ago

Error:

$ make test-forge
./test-dssspell-forge.sh
error: Found argument '3' which wasn't expected, or isn't valid in this context

USAGE:
    forge test --fork-url <fork-url> --libraries <libraries>... --verbosity

For more information try --help

Help for test says we need to add -vvv. This works in my local branch, pushing fix shortly.

    -v, --verbosity         Verbosity mode of EVM output as number of occurences of the `v` flag (-v, -vv, -vvv, etc.)
                                3: print test trace for failing tests
                                4: always print test trace, print setup for failing tests
                                5: always print test trace and setup
talbaneth commented 2 years ago

BTW on my local node without optimizations I got: forge: 3.44 seconds dapptools: 36.5 seconds

naszam commented 2 years ago
$ make test-forge
./test-dssspell-forge.sh match="" block=""
error: Found argument '-v' which wasn't expected, or isn't valid in this context

USAGE:
    forge test --fork-url <fork-url> --libraries <libraries>...

For more information try --help
make: *** [Makefile:8: test-forge] Error 1
$ forge --version
foundry-cli 0.1.0

you could try https://github.com/transmissions11/forgeup to point latest on master, via:

forgeup
julienmartinlevrai commented 2 years ago

@naszam please solve merge conflict

julienmartinlevrai commented 2 years ago
$ make test-forge
./test-dssspell-forge.sh match="" block=""
compiling...
success.