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

debt(forge): remove testFail* #9574

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

debt(forge): remove testFail* #9574

wants to merge 33 commits into from

Conversation

yash-atreya
Copy link
Member

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

Motivation

Closes #4437

Solution

@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
yash-atreya and others added 7 commits January 9, 2025 17:45
* rm `should_fail` from runner and TestFunctionKind

* update, document and add additional external tests

* remove newly added morpho for now

* fix

---------

Co-authored-by: Yash Atreya <[email protected]>
@yash-atreya yash-atreya marked this pull request as ready for review January 9, 2025 13:46
.collect::<Vec<_>>();

if !test_fail_instances.is_empty() {
return SuiteResult::new(start.elapsed(),[(format!("Found {} instances: {}", test_fail_instances.len(), test_fail_instances.join(", ")), TestResult::fail("`testFail*` has been deprecated. Consider changing to test_Revert[If|When]_Condition and expecting a revert".to_string()))].into(), warnings)
Copy link
Member

Choose a reason for hiding this comment

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

please split into multiple variables to make formatting work again

.collect::<Vec<_>>();

if !test_fail_instances.is_empty() {
return SuiteResult::new(start.elapsed(),[(format!("Found {} instances: {}", test_fail_instances.len(), test_fail_instances.join(", ")), TestResult::fail("`testFail*` has been deprecated. Consider changing to test_Revert[If|When]_Condition and expecting a revert".to_string()))].into(), warnings)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return SuiteResult::new(start.elapsed(),[(format!("Found {} instances: {}", test_fail_instances.len(), test_fail_instances.join(", ")), TestResult::fail("`testFail*` has been deprecated. Consider changing to test_Revert[If|When]_Condition and expecting a revert".to_string()))].into(), warnings)
return SuiteResult::new(start.elapsed(),[(format!("Found {} instances: {}", test_fail_instances.len(), test_fail_instances.join(", ")), TestResult::fail("`testFail*` has been removed. Consider changing to test_Revert[If|When]_Condition and expecting a revert".to_string()))].into(), warnings)

// This is to ensure that we don't have any stale snapshots.
// If `FORGE_SNAPSHOT_CHECK` is set, we don't remove the snapshots directory as it is
// required for comparison.
if std::env::var_os("FORGE_SNAPSHOT_CHECK").is_none() {
Copy link
Member

Choose a reason for hiding this comment

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

this looks unrelated / merge artifact

Self::UnitTest { should_fail: true } => "testFail",
Self::FuzzTest { should_fail: false } => "fuzz",
Self::FuzzTest { should_fail: true } => "fuzz fail",
Self::UnitTest { should_fail } => {
Copy link
Member

Choose a reason for hiding this comment

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

please revert, this is strictly worse

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-debt Type: code debt T-likely-breaking Type: requires changes that can be breaking
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

debt: deprecate testFail*
3 participants