Skip to content

bug: inline config not catching some errors #5371

Open
@mds1

Description

@mds1

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 (e488e2b 2023-07-10T15:17:42.605282000Z)

What command(s) is the bug in?

forge test

Operating System

None

Describe the bug

Config file:

[profile.default]
# --- snip ---

[profile.ci]
# --- snip ---

[profile.lite]
# --- snip ---

Test

/// forge-config: default.fuzz.runs = 1
/// forge-config: default.ci.runs = 1
/// forge-config: default.lite.runs = 1
function test1() public {}

This config is wrong: there is no ci or lite config key in the default profile, so I'd have expected this error to be caught. The correct inline config is:

/// forge-config: default.fuzz.runs = 1
/// forge-config: ci.fuzz.runs = 1
/// forge-config: lite.fuzz.runs = 1
function test1() public {}

Other inline config errors are caught. For example, with /// forge-config: default.fuzz.runssss = 1, running forge test will error says Inline config error detected at test/ERC5564Announcer.t.sol:Announce:test1

So, two pieces of feedback:

  1. Also catch when the first key is not valid
  2. Improve the error message to write out the incorrect key so bugs are easier to find

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Ready For Review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions