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

incompatibility with trace verbosity and fail fast #6613

Closed
2 tasks done
BlazeWasHere opened this issue Dec 17, 2023 · 0 comments · Fixed by #6628
Closed
2 tasks done

incompatibility with trace verbosity and fail fast #6613

BlazeWasHere opened this issue Dec 17, 2023 · 0 comments · Fixed by #6628
Labels
T-bug Type: bug

Comments

@BlazeWasHere
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 (88ae503 2023-12-17T00:18:48.520002484Z)

What command(s) is the bug in?

forge test -vvv --fail-fast

Operating System

Linux

Describe the bug

when using -vvv (or any level verbosity) with --fail-fast no traces are shown for failing tests

minimal repo:

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Test, console2} from "forge-std/Test.sol";
import {Counter} from "../src/Counter.sol";

contract CounterTest is Test {
    Counter public counter;

    function setUp() public {
        counter = new Counter();
        counter.setNumber(0);
    }

    function test_Fail() public {
        counter.setNumber(1);
        assertEq(counter.number(), 2);
    }
}

when running forge test -vvv --fail-fast no traces are shown

[⠒] Compiling...
No files changed, compilation skipped

Running 1 test for test/Counter.t.sol:CounterTest
[FAIL. Reason: assertion failed] test_Fail() (gas: 42826)
 
Ran 1 test suites: 0 tests passed, 0 failed, 0 skipped (0 total tests)

Failing tests:
Encountered 1 failing test in test/Counter.t.sol:CounterTest
[FAIL. Reason: assertion failed] test_Fail() (gas: 42826)

Encountered a total of 1 failing tests, 0 tests succeeded

expected behavior should be similar to forge test -vvv

[⠒] Compiling...
No files changed, compilation skipped

Running 1 test for test/Counter.t.sol:CounterTest
[FAIL. Reason: assertion failed] test_Fail() (gas: 42826)
Logs:
  Error: a == b not satisfied [uint]
        Left: 1
       Right: 2

Traces:
  [42826] CounterTest::test_Fail()
    ├─ [22290] Counter::setNumber(1)
    │   └─ ← ()
    ├─ [283] Counter::number() [staticcall]
    │   └─ ← 1
    ├─ emit log(val: "Error: a == b not satisfied [uint]")
    ├─ emit log_named_uint(key: "      Left", val: 1)
    ├─ emit log_named_uint(key: "     Right", val: 2)
    ├─ [0] VM::store(VM: [0x7109709ECfa91a80626fF3989D68f67F5b1DD12D], 0x6661696c65640000000000000000000000000000000000000000000000000000, 0x0000000000000000000000000000000000000000000000000000000000000001)
    │   └─ ← ()
    └─ ← ()

Test result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 861.88µs
 
Ran 1 test suites: 0 tests passed, 1 failed, 0 skipped (1 total tests)

Failing tests:
Encountered 1 failing test in test/Counter.t.sol:CounterTest
[FAIL. Reason: assertion failed] test_Fail() (gas: 42826)

Encountered a total of 1 failing tests, 0 tests succeeded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant