@@ -306,7 +306,58 @@ jobs:
306306 -k 'not testsuite' \
307307 | grep "::" > "artifacts/${PR_DIR}/macos/all_tests.txt" || true
308308
309+ - name : Identify remaining tests to run (macOS)
310+ shell : micromamba-shell {0}
311+ run : |
312+ PYTHONPATH="$(grass --config python_path):${PYTHONPATH}"
313+ LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}"
314+ export PYTHONPATH
315+ export LD_LIBRARY_PATH
316+
317+ PR_DIR="pr_${PR_ID}"
318+ PREV_DIR="artifacts/${PR_DIR}/macos_prev"
319+ CURR_DIR="artifacts/${PR_DIR}/macos"
320+
321+ ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt"
322+ FAILED_PREV="${PREV_DIR}/failed_tests.txt"
323+ REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt"
324+
325+ mkdir -p "${CURR_DIR}"
326+
327+ if [[ -f "${FAILED_PREV}" && -s "${FAILED_PREV}" ]]; then
328+ echo "Computing remaining tests (excluding previously failed ones)..."
329+ grep -v -F -f "${FAILED_PREV}" "${ALL_TESTS_FILE}" > "${REMAINING_TESTS_FILE}" || true
330+ else
331+ echo "No previous failed tests list found or it is empty."
332+ echo "Treating all collected tests as remaining."
333+ cp "${ALL_TESTS_FILE}" "${REMAINING_TESTS_FILE}" || true
334+ fi
335+
336+ echo "Remaining tests to run:"
337+ cat "${REMAINING_TESTS_FILE}" || echo "No remaining tests found."
338+
339+
309340
341+ # - name: Run pytest with multiple workers in parallel (JSON report)
342+ # shell: micromamba-shell {0}
343+ # run: |
344+ # PYTHONPATH="$(grass --config python_path):${PYTHONPATH}"
345+ # LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}"
346+ # export PYTHONPATH
347+ # export LD_LIBRARY_PATH
348+
349+ # PR_DIR="pr_${PR_ID}"
350+ # mkdir -p "artifacts/${PR_DIR}/macos"
351+
352+ # OUT_JSON="artifacts/${PR_DIR}/macos/test_results.json"
353+
354+ # pytest \
355+ # @.github/workflows/pytest_args_ci.txt \
356+ # @.github/workflows/pytest_args_parallel.txt \
357+ # --junitxml=pytest.xdist.junit.xml \
358+ # --json-report --json-report-file="${OUT_JSON}" \
359+ # -k 'not testsuite' || true
360+
310361 - name : Run pytest with multiple workers in parallel (JSON report)
311362 shell : micromamba-shell {0}
312363 run : |
@@ -316,16 +367,25 @@ jobs:
316367 export LD_LIBRARY_PATH
317368
318369 PR_DIR="pr_${PR_ID}"
319- mkdir -p "artifacts/${PR_DIR}/macos"
370+ CURR_DIR="artifacts/${PR_DIR}/macos"
371+ mkdir -p "${CURR_DIR}"
320372
321- OUT_JSON="artifacts/${PR_DIR}/macos/test_results.json"
373+ OUT_JSON="${CURR_DIR}/test_results.json"
374+ REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt"
375+
376+ if [[ -s "${REMAINING_TESTS_FILE}" ]]; then
377+ echo "Running remaining test cases (macOS)..."
378+ pytest \
379+ @.github/workflows/pytest_args_ci.txt \
380+ @.github/workflows/pytest_args_parallel.txt \
381+ --junitxml=pytest.xdist.junit.xml \
382+ --json-report --json-report-file="${OUT_JSON}" \
383+ $(cat "${REMAINING_TESTS_FILE}") || true
384+ else
385+ echo "No remaining test cases to run. Writing empty JSON."
386+ echo '{"tests": []}' > "${OUT_JSON}"
387+ fi
322388
323- pytest \
324- @.github/workflows/pytest_args_ci.txt \
325- @.github/workflows/pytest_args_parallel.txt \
326- --junitxml=pytest.xdist.junit.xml \
327- --json-report --json-report-file="${OUT_JSON}" \
328- -k 'not testsuite' || true
329389
330390 - name : Extract failed and passed tests (parallel macOS)
331391 shell : micromamba-shell {0}
0 commit comments