foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(config): enable dynamic test linking by default

Open grandizzy opened this issue 8 months ago • 1 comments

Component

Forge

Describe the feature you would like

  • turn dynamic_test_linking introduced in https://github.com/foundry-rs/foundry/pull/10010 on by default
  • review all places where ProjectCompiler::new is called and where it should respect the config (e.g. script broadcast will fail with config on as it needs the proper constructor instead the vm.deployCode)
  • test combinations of forge test and forge script / other forge commands and make sure cache is not invalidated
  • Re https://github.com/foundry-rs/foundry/pull/10333#issuecomment-2814837098 make sure internal fn decoding works for preprocessed tests too (and reconsider https://github.com/foundry-rs/foundry/pull/10333#issuecomment-2815910868)

Additional context

No response

grandizzy avatar Apr 10 '25 08:04 grandizzy

Can I pick this up? I would like to work on it.

naijauser avatar May 28 '25 10:05 naijauser

I got feedback from @emo-eth at Frontiers that dynamic test linking does not always work yet and if he is able to get a reproducible he will open a ticket

We therefore need to be hesitant enabling by default cc @grandizzy

zerosnacks avatar Aug 18 '25 13:08 zerosnacks

@zerosnacks I have a (kinda janky) e2e Gambit mutation test runner - when I wrote it, I had to explicitly disable dynamic test linking in a separate profile for Gambit to get the test suite to pick up changes; the tests suites would all pass since it wouldn't re-compile the mutated source contracts (the runner just copies the entire dir including cache to a temp folder lol)

But on latest stable, it seems to be working correctly!

Will play around with it and let you know if that changes

emo-eth avatar Aug 18 '25 16:08 emo-eth