headless-browser: Ensure crashing tests cause LibWeb tests to fail

This commit is contained in:
Timothy Flynn 2024-11-13 16:14:30 -05:00 committed by Tim Flynn
parent ce56bc29e2
commit 25c067872c
Notes: github-actions[bot] 2024-11-14 00:22:49 +00:00

View file

@ -437,6 +437,7 @@ ErrorOr<void> run_tests(Core::AnonymousBuffer const& theme, Web::DevicePixelSize
size_t timeout_count = 0; size_t timeout_count = 0;
size_t crashed_count = 0; size_t crashed_count = 0;
size_t skipped_count = 0; size_t skipped_count = 0;
bool all_tests_ok = true;
bool is_tty = isatty(STDOUT_FILENO); bool is_tty = isatty(STDOUT_FILENO);
outln("Running {} tests...", tests.size()); outln("Running {} tests...", tests.size());
@ -486,12 +487,15 @@ ErrorOr<void> run_tests(Core::AnonymousBuffer const& theme, Web::DevicePixelSize
++pass_count; ++pass_count;
break; break;
case TestResult::Fail: case TestResult::Fail:
all_tests_ok = false;
++fail_count; ++fail_count;
break; break;
case TestResult::Timeout: case TestResult::Timeout:
all_tests_ok = false;
++timeout_count; ++timeout_count;
break; break;
case TestResult::Crashed: case TestResult::Crashed:
all_tests_ok = false;
++crashed_count; ++crashed_count;
break; break;
case TestResult::Skipped: case TestResult::Skipped:
@ -558,7 +562,7 @@ ErrorOr<void> run_tests(Core::AnonymousBuffer const& theme, Web::DevicePixelSize
app.destroy_web_views(); app.destroy_web_views();
if (timeout_count == 0 && fail_count == 0) if (all_tests_ok)
return {}; return {};
return Error::from_string_literal("Failed LibWeb tests"); return Error::from_string_literal("Failed LibWeb tests");