ZIm/crates/gpui_macros/src
João Marcos f587e95a7e
Add seed argument to #[gpui::test] attribute macro (#26764)
This PR introduces the arguments `seed` and `seeds` to `gpui::test`,
e.g.:
- `#[gpui::test(seed = 10)]`
- `#[gpui::test(seeds(10, 20, 30, 40))]`

Which allows us to run a test against a specific seed value without
slowing
down our tests like `iterations` does with high values.

This was motivated by a diff hunk test that only fails in a 400+ seed,
but is
slow to run 400+ times for every `cargo test`.

If your test failed with a specific seed, you can now add the `seed` arg
to
increase the chances of detecting a regression.

There are now three ways of setting seeds, the `SEED` env var,
`iterations`,
and the args this PR adds. See docs in `gpui::test`.

---

I also relaxed the limitation on `retries` not working with
`iterations`, as
that seemed unnecessary.

Release Notes:

- N/A
2025-03-14 13:40:02 -03:00
..
derive_app_context.rs gpui: Update docs to reflect removal of View, ViewContext, WindowContext (#24008) 2025-01-31 11:40:42 -08:00
derive_into_element.rs Fix flickering (#9012) 2024-03-11 10:45:57 +01:00
derive_path_static_str.rs add ui::Vector and separate images from icons (#17815) 2024-09-13 17:44:16 -04:00
derive_render.rs Fix missed renames in #22632 (#23688) 2025-01-26 23:37:34 +00:00
derive_visual_context.rs gpui: Update docs to reflect removal of View, ViewContext, WindowContext (#24008) 2025-01-31 11:40:42 -08:00
gpui_macros.rs Add seed argument to #[gpui::test] attribute macro (#26764) 2025-03-14 13:40:02 -03:00
register_action.rs gpui: Switch from linkme to inventory for action registration (#24087) 2025-02-02 09:13:46 -08:00
styles.rs gpui: Add rounded_md token (#26179) 2025-03-06 13:41:21 -05:00
test.rs Add seed argument to #[gpui::test] attribute macro (#26764) 2025-03-14 13:40:02 -03:00