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

In-line test configuration not respected #7310

Closed
2 tasks done
shuhuiluo opened this issue Mar 4, 2024 · 1 comment · Fixed by #7431
Closed
2 tasks done

In-line test configuration not respected #7310

shuhuiluo opened this issue Mar 4, 2024 · 1 comment · Fixed by #7431
Labels
T-bug Type: bug

Comments

@shuhuiluo
Copy link

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (3df3e0c 2024-03-04T00:19:46.775990000Z)

What command(s) is the bug in?

forge test

Operating System

macOS (Apple Silicon)

Describe the bug

forge test no longer respects In-line test configuration.

To replicate, simply forge init a new Counter project. Add an in-line fuzz runs config to testFuzz_SetNumber:

    /// forge-config: default.fuzz.runs = 100
    function testFuzz_SetNumber(uint256 x) public {
        counter.setNumber(x);
        assertEq(counter.number(), x);
    }

Run forge test. Output:

Ran 2 tests for test/Counter.t.sol:CounterTest
[PASS] testFuzz_SetNumber(uint256) (runs: 256, μ: 27787, ~: 28409)
[PASS] test_Increment() (gas: 28379)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 8.41ms (8.13ms CPU time)
@shuhuiluo shuhuiluo added the T-bug Type: bug label Mar 4, 2024
@grandizzy
Copy link
Collaborator

the Solc JSON ASTs are not included anymore for test (see #7197) so inline config cannot be applied, works OK if you run forge test --ast but I think this should be on by default for tests too @mattsse @DaniPopes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
2 participants