Commit Graph

3 Commits

Author SHA1 Message Date
Muir Manders
f06dd71851 progress: add utility to infer progress from iterable
Summary: Add progress.each() which creates a progress bar given an iterable Python object that supports len(). The progress bar automatically advances as the iterator advances.

Reviewed By: DurhamG

Differential Revision: D32512921

fbshipit-source-id: c111b0ef5c2375074a87c5c9dbcedae1f099f9f2
2021-12-01 15:42:00 -08:00
Muir Manders
499e5cbaaa progress: allow longer topics
Summary: If terminal width is 80 or greater, allow topics up to length 16 (as opposed to 12). Also, allow multiple words in topics. Topics shouldn't be long, but I feel one word is often not enough. For example, "Calculating" is quite vague.

Reviewed By: DurhamG

Differential Revision: D32512920

fbshipit-source-id: 8c122872e6747d66f81aefc62f0835390fcd9137
2021-12-01 15:41:59 -08:00
Muir Manders
1e56a67d15 progress: add test for rust progress rendering
Summary:
Add roundtrip test-progress-rust-renderer.t to cover the rust:simple renderer and rust's progress rendering loop.

The python progress tests wrap the python renderer to synchronize output and simplify tests. To achieve something similar for rust, I added a synchronization point to the progress registry, and a "lockstep" config flag that lets tests manually advance the progress rendering loop. I considered multiple other approaches, but I like this one because it exercises the real progress rendering code, gets rid of sleeps during tests, and was a pretty simple change.

Reviewed By: quark-zju

Differential Revision: D32025570

fbshipit-source-id: df41f8efeea2e9ac00f6ffa1c84f390066fd3959
2021-11-02 14:35:35 -07:00