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: Add "after-all" hook for testing #4300

Closed
lucas-manuel opened this issue Feb 7, 2023 · 2 comments · Fixed by #8106
Closed

feat: Add "after-all" hook for testing #4300

lucas-manuel opened this issue Feb 7, 2023 · 2 comments · Fixed by #8106
Labels
T-feature Type: feature

Comments

@lucas-manuel
Copy link

lucas-manuel commented Feb 7, 2023

Component

Forge

Describe the feature you would like

In forge testing it would be very helpful to have a hook that runs at the end of each test. This would allow for:

  • Single logging of metrics as outlined in this issue as an intermediate measure until native internal metrics are implemented.
  • Post fuzz campaign testing (e.g., close out all positions and assert all funds are able to exit the system) (both fuzzing and invariant testing).

Additional context

No response

@mds1
Copy link
Collaborator

mds1 commented Feb 28, 2023

Just noting that contrary to the issue name, this does not have to be exclusive to invariant tests, and can apply to all tests. However in that case some use cases such as logging don't apply. So we may need multiple functions like afterInvariant, afterFuzz, and afterConcrete. But that feels a but cluttered, so maybe there's a single afterAll(TestType) with overloads. Needs some though here

@lucas-manuel
Copy link
Author

Up to you but I wouldn't mind a one size fits all personally

@lucas-manuel lucas-manuel changed the title feat(invariants): Add "after-all" hook feat: Add "after-all" hook for testing May 18, 2023
@jenpaff jenpaff moved this from Todo to Completed in Foundry Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-feature Type: feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants