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: legacy_assertions config option #8263

Merged
merged 10 commits into from
Jun 28, 2024
Merged

feat: legacy_assertions config option #8263

merged 10 commits into from
Jun 28, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Jun 27, 2024

Motivation

Per Discord discussion, adds "legacy" behavior for assertions. If legacy_assertions config option is set, assertions will not revert and will instead produce logs and accumulate till the end of test execution.

Solution

cc @DaniPopes I've enabled logic for tracking GLOBAL_FAILURES_SLOT on cheatcodes address

Closes: #8049

@klkvr klkvr changed the title feat legacy_assertions config option feat: legacy_assertions config option Jun 27, 2024
/// Whether failed assertions should revert.
pub assertions_revert: bool,

/// Whether `failed()` should be invoked to check if the test have failed.
pub legacy_assertions: bool,
Copy link
Member

Choose a reason for hiding this comment

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

we should update the book and the config crate readme

crates/config/src/lib.rs Show resolved Hide resolved
@klkvr
Copy link
Member Author

klkvr commented Jun 28, 2024

@DaniPopes this should be good to merge

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

nice, this should reduce a ton of overhead by default

@mattsse mattsse merged commit 8b56536 into master Jun 28, 2024
20 checks passed
@mattsse mattsse deleted the klkvr/legacy-assertions branch June 28, 2024 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Native assertions are not skipped for expectRevert
4 participants