@@ -297,14 +297,39 @@ jobs:
297297 export LD_LIBRARY_PATH
298298
299299 PR_DIR="pr_${PR_ID}"
300- mkdir -p "artifacts/${PR_DIR}/macos"
300+ CURR_DIR="artifacts/${PR_DIR}/macos"
301+ mkdir -p "${CURR_DIR}"
302+
303+ COLLECT_JSON="${CURR_DIR}/collect.json"
304+ ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt"
301305
306+ echo "Collecting test cases into JSON..."
302307 pytest \
303308 @.github/workflows/pytest_args_ci.txt \
304309 @.github/workflows/pytest_args_parallel.txt \
305- --collect-only --quiet \
306- -k 'not testsuite' \
307- | grep "::" > "artifacts/${PR_DIR}/macos/all_tests.txt" || true
310+ --collect-only \
311+ --json-report --json-report-file="${COLLECT_JSON}" \
312+ -k 'not testsuite' || true
313+
314+ echo "Extracting nodeids from collect.json..."
315+ if [[ -f "${COLLECT_JSON}" ]]; then
316+ # pytest-json-report usually stores collected tests here
317+ jq -r '.collectors[].nodes[].nodeid // empty' "${COLLECT_JSON}" > "${ALL_TESTS_FILE}" || true
318+ else
319+ echo "WARNING: ${COLLECT_JSON} not found, writing empty all_tests.txt"
320+ : > "${ALL_TESTS_FILE}"
321+ fi
322+
323+ echo "===== DEBUG: all_tests.txt ====="
324+ if [[ -f "${ALL_TESTS_FILE}" ]]; then
325+ wc -l "${ALL_TESTS_FILE}" || true
326+ echo "Sample lines:"
327+ head -n 5 "${ALL_TESTS_FILE}" || true
328+ else
329+ echo "all_tests.txt not found"
330+ fi
331+ echo "================================"
332+
308333
309334
310335 - name : Debug all_tests count (macOS)
0 commit comments