Cyfrin / foundry-full-course-cu

GNU General Public License v3.0
3.7k stars 916 forks source link

Issue: Unsupported -m Flag in forge test Command #2100

Closed Aletheios42 closed 4 months ago

Aletheios42 commented 4 months ago

Section

Section 7 | Foundry Fund Me

Could you please leave a link to the Cyfrin Updraft Lesson (or YouTube video timestamp) where this error occurs? (You can right click a video and "copy video URL at current time")

https://updraft.cyfrin.io/courses/foundry/foundry-fund-me/forked-tests?lesson_format=video

Operating System

Linux

Describe the bug

Context: In Section 2: Foundry Fund Me: 8. Running tests on chains forks, Patrick uses the following command to test the version of the oracle deployed in Sepolia(last test of the video: 5:36):

forge test -m testPricedFeedVersionIsAccurate -vvv --fork-url $SEPOLIA_RPC_URL

Problem: The -m flag is unsupported in the current version of Foundry: forge --version forge 0.2.0 (fe2acca 2024-07-22T00:20:15.468269927Z).

When attempting to use this command, it fails due to the unrecognized -m flag. This can be verified by running forge test --help and checking the available options under "Test filtering".

Solution: We need to use the full flag --match-test instead. The correct command line should be:

forge test --match-test testPricedFeedVersionIsAccurate -vvvv --fork-url $SEPOLIA_RPC_URL

notice that i aggregated one more "v" from -vvv to -vvvv , in order to get the same output displayed , that actually the version of the oracle is 4.

EngrPips commented 4 months ago

Thanks @AlejandroPintosAlcarazo. This will be attended to appropriately as soon as possible.

cromewar commented 4 months ago

Hello, @AlejandroPintosAlcarazo, this could also be accomplished using --mt, I will add and update to that lesson. Thanks for the heads up.