Skip to content

document how to skip runs in table tests #1651

@bbjubjub2494

Description

@bbjubjub2494

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge Version: 1.3.5-nightly Commit SHA: 124f134ab286da5d0939de14378573cf24121e1e Build Timestamp: 2025-09-08T06:03:40.088461379Z (1757311420) Build Profile: maxperf

What version of Foundryup are you on?

foundryup: 1.3.0

What command(s) is the bug in?

forge test

Operating System

Linux

Describe the bug

When using vm.skip in a table test, it skips not only the current table row, but also the remaining ones down the table. Any entries up the table are still de facto checked.

In this example attached, the first row is executed successfully, then the second one triggers vm.skip, which marks the whole test yellow and hides the failing test in the third row. If the order of entries is changed, the whole test can also turn red.

Neither the vm.skip documentation nor the doc page about table tests advertise this behavior.

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

import {Test} from "forge-std/Test.sol";

contract TableTest is Test {
    struct TestCase {
	    bool skipMe;
	    bool failMe;
    }

    function fixture_testcase() public pure returns (TestCase[] memory) {
	    	TestCase[] memory cases = new TestCase[](3);
	cases[0] = TestCase({skipMe: false, failMe: false});
	cases[1] = TestCase({skipMe: true, failMe: false});
	cases[2] = TestCase({skipMe: false, failMe: true});
	return cases;
    }

    function table_test(TestCase memory testcase) public {
	    vm.skip(testcase.skipMe);
	    assert(!testcase.failMe);
    }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions