foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.33k stars 1.76k forks source link

Avoid recompiling every test that uses local Vm #8857

Open DaniPopes opened 2 months ago

DaniPopes commented 2 months ago

Component

Forge

Describe the feature you would like

many tests in forge now use

    prj.wipe_contracts();
    prj.insert_ds_test();
    prj.insert_vm();
    prj.clear();

this clears the cache of the pre-compiled test project, which ruins the purpose of the forgetest_init macro, as well as making tests depend on ds-test which we have removed from forge-std long ago

we can surgically replace the forge-std Vm with the local one to have access to all the cheatcodes, or some other way so that we don't have to do this

cc @grandizzy

Additional context

No response

grandizzy commented 2 months ago

I think this can be done without any test related code structure change but following the rule of tests for new cheatcodes added as contracts inside testdata/default/cheats where they import import "cheats/Vm.sol";, will take a look into cleaning this