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

Avoid recompiling every test that uses local Vm #8857

Open
DaniPopes opened this issue Sep 12, 2024 · 1 comment
Open

Avoid recompiling every test that uses local Vm #8857

DaniPopes opened this issue Sep 12, 2024 · 1 comment
Labels
A-internals Area: internals A-testing Area: testing T-feature Type: feature

Comments

@DaniPopes
Copy link
Member

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

@DaniPopes DaniPopes added T-feature Type: feature T-needs-triage Type: this issue needs to be labelled labels Sep 12, 2024
@zerosnacks zerosnacks added A-internals Area: internals A-testing Area: testing and removed T-needs-triage Type: this issue needs to be labelled labels Sep 12, 2024
@grandizzy
Copy link
Collaborator

grandizzy commented Sep 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-internals Area: internals A-testing Area: testing T-feature Type: feature
Projects
None yet
Development

No branches or pull requests

3 participants