foundry icon indicating copy to clipboard operation
foundry copied to clipboard

More helpful output on test failure

Open ehildenb opened this issue 3 years ago • 0 comments

Component

Forge

Have you ensured that all of these are up to date?

  • [X] Foundry
  • [X] Foundryup

What version of Foundry are you on?

forge 0.2.0 (9ed1c37 2022-08-01T00:07:48.156201922Z)

What command(s) is the bug in?

forge test

Operating System

Linux

Describe the bug

I am writing some tests that use forking capabilities of Foundry.

My forking capability tests are broken, they aren't doing the right thing, and cause Foundry to panic.

Screenshot from 2022-08-01 11-25-45

However, the last output before panicking is talking about my Prank tests, not about my Fork tests. But deleting the file ForkTest.t.sol causes the tests to be fine, so the problem is there (in the fork tests).

Can the output be made more helpful on panic? Maybe to say which test it's panicking on?

Attached is a zip directory this is happening in:

foundry.zip

ehildenb avatar Aug 01 '22 17:08 ehildenb

For now we'll try to improve the error messages, but we should also explore if we can avoid panicking by extending REVM's Database trait

onbjerg avatar Aug 11 '22 18:08 onbjerg

This should now be handled more gracefully

onbjerg avatar Sep 08 '22 16:09 onbjerg