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

Know on which test forge is stuck #4452

Closed
AlbertoCentonze opened this issue Feb 28, 2023 · 9 comments · Fixed by #7914
Closed

Know on which test forge is stuck #4452

AlbertoCentonze opened this issue Feb 28, 2023 · 9 comments · Fixed by #7914
Assignees
Labels
Cmd-forge-test Command: forge test T-feature Type: feature

Comments

@AlbertoCentonze
Copy link
Contributor

AlbertoCentonze commented Feb 28, 2023

Component

Forge

Describe the feature you would like

When I'm running some unit tests on foundry I often get stuck on one for some reason (bad fuzzing, slow rpc, ecc). Since I have hundreds of tests, it would be nice to know on which test I'm stuck. Currently this output
image
is shown only when all the tests in the contracts have passed (or failed). This doesn't let me know which contract I should check.

Additional context

In case you're wondering why I don't figure out on the fly that my tests are getting stuck is because I'm using watcher mode.

@AlbertoCentonze AlbertoCentonze added the T-feature Type: feature label Feb 28, 2023
@gakonst gakonst added this to Foundry Feb 28, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Feb 28, 2023
@AlbertoCentonze AlbertoCentonze changed the title Now on which test forge is stuck Know on which test forge is stuck Feb 28, 2023
@mattsse
Copy link
Member

mattsse commented Mar 2, 2023

that makes sense, I'll add a warning like:

 SLOW [> 60.000s] <test> slow

@mattsse mattsse added the Cmd-forge-test Command: forge test label Mar 2, 2023
@AlbertoCentonze
Copy link
Contributor Author

AlbertoCentonze commented Mar 2, 2023

The most important thing in my opinion would be to have the warning during the execution of the test and not after it's done. And most importantly know which test is causing the issue.

@mattsse
Copy link
Member

mattsse commented Mar 2, 2023

yes that's why I'm suggesting emitting a warning if a test exceeded like 60s and is still running

@AlbertoCentonze
Copy link
Contributor Author

Amazing thanks!

@AlbertoCentonze
Copy link
Contributor Author

Also a nice to have would be for slow tests with fuzzing, to know at which run of the fuzzing the current test is (ie 123/256)

@mattsse
Copy link
Member

mattsse commented Apr 27, 2023

cc @Evalir

@mds1
Copy link
Collaborator

mds1 commented Apr 28, 2023

Seems related to #585, maybe worth tackling both at the same time?

@0xMelkor
Copy link
Contributor

0xMelkor commented May 5, 2023

Taking this up

@mattsse mattsse assigned 0xMelkor and unassigned Evalir May 5, 2023
@Evalir Evalir assigned Evalir and unassigned 0xMelkor Jun 16, 2023
@Evalir
Copy link
Member

Evalir commented Jun 16, 2023

Gave this a bit of thought recently along with #585.

  • I think we could do this using indificatif which is what nextest uses.
  • For having "test events" (mainly pointing out slow events), we could use an unbounded_channel that sends TestEvents from the runner to the reporter for when a test is slow.
  • We can add a smol progress bar with a countup (X/Y) of the current run and total runs to be done, whenever a fuzz test comes up.
  • We could also show the name of the current test being run.

@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
Cmd-forge-test Command: forge test T-feature Type: feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants