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

bug: inline config not catching some errors #5371

Open
1 of 2 tasks
mds1 opened this issue Jul 12, 2023 · 0 comments · May be fixed by #9363
Open
1 of 2 tasks

bug: inline config not catching some errors #5371

mds1 opened this issue Jul 12, 2023 · 0 comments · May be fixed by #9363
Assignees
Labels
A-config Area: config Cmd-forge-test Command: forge test P-normal Priority: normal T-bug Type: bug
Milestone

Comments

@mds1
Copy link
Collaborator

mds1 commented Jul 12, 2023

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
@mds1 mds1 added T-bug Type: bug Cmd-forge-test Command: forge test labels Jul 12, 2023
@gakonst gakonst added this to Foundry Jul 12, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Jul 12, 2023
@zerosnacks zerosnacks added the A-config Area: config label Jul 2, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy grandizzy added the P-normal Priority: normal label Nov 19, 2024
@yash-atreya yash-atreya linked a pull request Nov 20, 2024 that will close this issue
@yash-atreya yash-atreya moved this from Todo to Ready For Review in Foundry Nov 20, 2024
@yash-atreya yash-atreya self-assigned this Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-config Area: config Cmd-forge-test Command: forge test P-normal Priority: normal T-bug Type: bug
Projects
Status: Ready For Review
Development

Successfully merging a pull request may close this issue.

4 participants