fix(ci): strip CRLF from marked-test file list on Windows lanes
list_os_marked_tests.py's stdout, when redirected on Windows, carries CRLF line endings (Python text-mode \n -> \r\n). The workflow's 'set -- ' word-split on the \r too, leaving it attached to every path — pytest then failed 'file or directory not found: tests/.../test_foo.py\r' on the first file. macOS passed because LF-only there. Strip \r via 'tr -d' before word-splitting (no-op on POSIX).
This commit is contained in:
6
.github/workflows/tests-os.yml
vendored
6
.github/workflows/tests-os.yml
vendored
@@ -138,8 +138,12 @@ jobs:
|
||||
# Deliberately NOT `mapfile`: that is a bash 4 builtin and the macOS
|
||||
# runner's /bin/bash is 3.2. Word-splitting is safe here because the
|
||||
# helper emits repo-relative test paths, which contain no spaces.
|
||||
# `tr -d '\r'`: on Windows, the helper's stdout is redirected and
|
||||
# Python emits CRLF line endings — a bare `$(cat "$LIST")` would
|
||||
# leave the `\r` attached to every path ("file or directory not
|
||||
# found: tests/.../test_foo.py\r").
|
||||
# shellcheck disable=SC2046
|
||||
set -- $(cat "$LIST")
|
||||
set -- $(tr -d '\r' < "$LIST")
|
||||
echo "selected $# file(s) for ${{ matrix.marker }}:"
|
||||
cat "$LIST"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user