foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(`invariants`): real-time runs counter

Open grandizzy opened this issue 11 months ago • 5 comments

Motivation

proposed way to handle #585

multiple

Solution

  • add a global invariant reporter to collect test runs and completed runs
  • display in terminal on thread that polls data progress each 100ms
  • reporter is enabled if show_progress option is set to true (or run with env var FOUNDRY_INVARIANT_SHOW_PROGRESS=true forge test)

grandizzy avatar Mar 04 '24 09:03 grandizzy

just noticed https://github.com/foundry-rs/foundry/issues/3607 I think the approach of global invariant reporter could be a good foundation of adding such, wdyt?

grandizzy avatar Mar 05 '24 06:03 grandizzy

Have you tested this in the context of multiple other unit and fuzz tests? It looks like it will constantly get "overwritten" by the other test results that stream in, so I don't think this is right.

This is something I've thought about before, and I think I'll post a proposal as an issue soon and we'll discuss this internally soon.

Also I would prefer you follow conventional commits, at least for PR names :smile_cat: (instead of feat abc (issue) you could write `feat(abc): do this thing)

DaniPopes avatar Mar 05 '24 11:03 DaniPopes

Have you tested this in the context of multiple other unit and fuzz tests? It looks like it will constantly get "overwritten" by the other test results that stream in, so I don't think this is right.

yep, I tested it, it is basically following the flow of results, see below

tests

This is something I've thought about before, and I think I'll post a proposal as an issue soon and we'll discuss this internally soon.

Also I would prefer you follow conventional commits, at least for PR names 😸 (instead of feat abc (issue) you could write `feat(abc): do this thing)

TIL, will do!

grandizzy avatar Mar 05 '24 11:03 grandizzy

Yeah you can see the spinner gets interleaved with the other results, I'd prefer we hold off on this for now.

That's a much better title, thanks!

DaniPopes avatar Mar 05 '24 12:03 DaniPopes

A different approach using indifcatif library proposal

grandizzy avatar May 10 '24 12:05 grandizzy

retired in favor of #7914

grandizzy avatar May 13 '24 09:05 grandizzy