test-web: Add an option to randomize the test order

This commit is contained in:
Tim Ledbetter 2025-07-27 22:52:12 +01:00 committed by Jelle Raaijmakers
commit 168ea88cb2
Notes: github-actions[bot] 2025-07-28 07:03:04 +00:00
3 changed files with 5 additions and 0 deletions

View file

@ -38,6 +38,7 @@ void Application::create_platform_arguments(Core::ArgsParser& args_parser)
args_parser.add_option(dump_gc_graph, "Dump GC graph", "dump-gc-graph", 'G');
args_parser.add_option(test_dry_run, "List the tests that would be run, without running them", "dry-run");
args_parser.add_option(rebaseline, "Rebaseline any executed layout or text tests", "rebaseline");
args_parser.add_option(shuffle, "Shuffle the order of tests before running them", "shuffle", 's');
args_parser.add_option(per_test_timeout_in_seconds, "Per-test timeout (default: 30)", "per-test-timeout", 't', "seconds");
args_parser.add_option(Core::ArgsParser::Option {

View file

@ -40,6 +40,7 @@ public:
bool test_dry_run { false };
bool rebaseline { false };
bool shuffle { false };
int per_test_timeout_in_seconds { 30 };

View file

@ -612,6 +612,9 @@ static ErrorOr<int> run_tests(Core::AnonymousBuffer const& theme, Web::DevicePix
return is_support_file || !match_glob;
});
if (app.shuffle)
shuffle(tests);
if (app.test_dry_run) {
outln("Found {} tests...", tests.size());