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

feat(forge): remove testFail* #9574

Merged
merged 53 commits into from
Jan 31, 2025
Merged

feat(forge): remove testFail* #9574

merged 53 commits into from
Jan 31, 2025

Conversation

yash-atreya
Copy link
Member

@yash-atreya yash-atreya commented Dec 18, 2024

Motivation

Closes #4437

Solution

  • Removes the functionality that marks a reverting test as passed if the test name starts with testFail*.
  • Migrate internal test suite using testFail*, to cli tests in order to assert internal tooling failure. See failure_assertions.rs
  • chore: update and document external tests #9644 removed/updated some ext integration tests to avoid CI failure.

@yash-atreya yash-atreya added T-likely-breaking Type: requires changes that can be breaking C-forge Command: forge Cmd-forge-test Command: forge test labels Dec 18, 2024
@yash-atreya yash-atreya changed the title debt(forge): deprecate testFail* debt(forge): remove testFail* Dec 19, 2024
@yash-atreya yash-atreya added the T-debt Type: code debt label Jan 7, 2025
@DaniPopes DaniPopes changed the title debt(forge): remove testFail* feat(forge): remove testFail* Jan 28, 2025
Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

ExtTester::new("transmissions11", "solmate", "c892309933b25c03d32b1b0d674df7ae292ba925");
// <https://github.com/transmissions11/solmate>
// #[test]
// fn solmate() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this going to be replaced with something else or should we remove it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be removed

Copy link
Member Author

@yash-atreya yash-atreya Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed a903ee0

.args(["--chain-id", "99", "--sender", "0x00a329c0648769A73afAc7F9381E08FB43dBEA72"])
fn snekmate() {
ExtTester::new("pcaversaccio", "snekmate", "df226f4a45e86c8f8c3ff1f9fa3443d260002050")
.args(["--nmc", "ERC4626VaultTest"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, this is not in snekmate master anymore, we'll update once a stable 0.4.1 vyper version to pin in CI

@grandizzy grandizzy requested a review from DaniPopes January 29, 2025 13:50
#[test]
fn forge_std() {
ExtTester::new("foundry-rs", "forge-std", "2b59872eee0b8088ddcade39fe8c041e17bb79c0")
ExtTester::new("foundry-rs", "forge-std", "08d6af5d6c8a9a60e308b689cd19751876d321e0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for future reference, this commit is from this PR: foundry-rs/forge-std#643

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, maybe we could have additional reviewers for that forge-std PR, bump @mds1 :)

Copy link
Member

@zerosnacks zerosnacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@yash-atreya yash-atreya added T-feature Type: feature and removed T-debt Type: code debt labels Jan 30, 2025
@grandizzy grandizzy merged commit abf269e into master Jan 31, 2025
22 checks passed
@grandizzy grandizzy deleted the yash/fix-4437 branch January 31, 2025 08:08
zerosnacks added a commit to foundry-rs/forge-std that referenced this pull request Jan 31, 2025
In preparation to deprecate `testFail*`:
foundry-rs/foundry#9574

- Removes `deployMockERC721` and `deployMockERC20` from `StdUtils` as
their tests includes large amount of `testFail*` tests and is generally
outdated. I haven't been able to find the `deploy*` methods being used
in any public project on Github.
- Implements workaround for other cases

Alternatively we could upstream Solady's mocks and tests (which have
been updated to not use `testFail*` but this feels out of place and
would be incomplete (ERC4626, ERC6909, etc..
https://github.com/Vectorized/solady/tree/main/test/utils/mocks). I
think it is most common for people to rely on the mocks their library
comes with (be it Solmate, Solady or OpenZeppelin) or write their own
wrapper around the token implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-test Command: forge test T-feature Type: feature T-likely-breaking Type: requires changes that can be breaking
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

debt: deprecate testFail*
4 participants