mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
Meta: Strip query string from WPT test variants before importing them
The output of `WPT.sh list-tests` includes test variants, which vary only by their query string. Since we don't care about this when importing tests, ignore any query strings and ensure duplicates are removed from the given test paths.
This commit is contained in:
parent
971aacc603
commit
79da6d48c1
Notes:
github-actions[bot]
2024-12-29 01:36:12 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/79da6d48c1a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2977 Reviewed-by: https://github.com/gmta
1 changed files with 8 additions and 4 deletions
12
Meta/WPT.sh
12
Meta/WPT.sh
|
@ -233,23 +233,27 @@ import_wpt()
|
|||
INPUT_PATHS[i]="$item"
|
||||
done
|
||||
|
||||
TESTS=()
|
||||
RAW_TESTS=()
|
||||
while IFS= read -r test_file; do
|
||||
TESTS+=("$test_file")
|
||||
RAW_TESTS+=("${test_file%%\?*}")
|
||||
done < <(
|
||||
"${ARG0}" list-tests "${INPUT_PATHS[@]}"
|
||||
)
|
||||
if [ "${#TESTS[@]}" -eq 0 ]; then
|
||||
if [ "${#RAW_TESTS[@]}" -eq 0 ]; then
|
||||
echo "No tests found for the given paths"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TESTS=()
|
||||
while IFS= read -r test_file; do
|
||||
TESTS+=("$test_file")
|
||||
done < <(printf "%s\n" "${RAW_TESTS[@]}" | sort -u)
|
||||
|
||||
pushd "${LADYBIRD_SOURCE_DIR}" > /dev/null
|
||||
./Meta/ladybird.sh build headless-browser
|
||||
set +e
|
||||
for path in "${TESTS[@]}"; do
|
||||
echo "Importing test from ${path}"
|
||||
|
||||
if ! ./Meta/import-wpt-test.py https://wpt.live/"${path}"; then
|
||||
continue
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue