From ed658154d2a142c3637b471ae6dcf9d63c49bcb0 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Tue, 29 Oct 2024 09:33:11 +0000 Subject: [PATCH] Meta: Set `LADYBIRD_GIT_VERSION` environment variable in `WPT.sh` This ensures the `browser_version` field of any wptreport format log files include the current git commit hash. --- Meta/WPT.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Meta/WPT.sh b/Meta/WPT.sh index 3da182685ef..f349ecca046 100755 --- a/Meta/WPT.sh +++ b/Meta/WPT.sh @@ -24,6 +24,12 @@ default_binary_path() { fi } +ladybird_git_hash() { + pushd "${LADYBIRD_SOURCE_DIR}" > /dev/null + git rev-parse --short HEAD + popd > /dev/null +} + LADYBIRD_BINARY=${LADYBIRD_BINARY:-"$(default_binary_path)/Ladybird"} WEBDRIVER_BINARY=${WEBDRIVER_BINARY:-"$(default_binary_path)/WebDriver"} WPT_PROCESSES=${WPT_PROCESSES:-$(get_number_of_processing_units)} @@ -153,8 +159,8 @@ execute_wpt() { fi WPT_ARGS+=( "--webdriver-arg=--certificate=${certificate_path}" ) done - echo QT_QPA_PLATFORM="offscreen" ./wpt run "${WPT_ARGS[@]}" ladybird "${TEST_LIST[@]}" - QT_QPA_PLATFORM="offscreen" ./wpt run "${WPT_ARGS[@]}" ladybird "${TEST_LIST[@]}" + echo QT_QPA_PLATFORM="offscreen" LADYBIRD_GIT_VERSION="$(ladybird_git_hash)" ./wpt run "${WPT_ARGS[@]}" ladybird "${TEST_LIST[@]}" + QT_QPA_PLATFORM="offscreen" LADYBIRD_GIT_VERSION="$(ladybird_git_hash)" ./wpt run "${WPT_ARGS[@]}" ladybird "${TEST_LIST[@]}" popd > /dev/null }