From 4a8f4421b460df0cc5dfb0f56e4e02a0feb1762d Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 26 Oct 2025 19:05:56 -0400 Subject: [PATCH 01/79] check branching --- .github/workflows/macos.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 18aaeaae646..0f4199b1cce 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -6,9 +6,10 @@ name: macOS on: push: branches: - - main - - releasebranch_* + - priotestci pull_request: + branches: + - priotestci env: CACHE_NUMBER: 0 concurrency: From ab15bfc1dc89cce709b9987e7ee268bc8075d67e Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Mon, 27 Oct 2025 18:24:05 -0400 Subject: [PATCH 02/79] print PR ID and set permisions --- .github/workflows/macos.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0f4199b1cce..56629996de8 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,13 +10,15 @@ on: pull_request: branches: - priotestci + env: CACHE_NUMBER: 0 concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} cancel-in-progress: true -permissions: {} +permissions: + actions: read # Allows Github to fetch artifacts jobs: macos_build: @@ -93,6 +95,17 @@ jobs: shell: micromamba-shell {0} run: source ./.github/workflows/print_versions.sh + - name: Get PR ID + shell: bash + run: | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then + echo "PR_ID=${{ github.event.number }}" >> "$GITHUB_ENV" + echo "This run is for PR #${{ github.event.number }}" + else + echo "PR_ID=none" >> "$GITHUB_ENV" + echo "This run is not a PR (branch: ${GITHUB_REF_NAME})" + fi + - name: Run pytest with multiple workers in parallel shell: micromamba-shell {0} run: | From 9b0980cafacf78fb8b7feb9ad0c4e63bafd60145 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Wed, 5 Nov 2025 16:07:23 -0500 Subject: [PATCH 03/79] remove blank line --- .github/workflows/macos.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 56629996de8..db4fb69e121 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,7 +10,6 @@ on: pull_request: branches: - priotestci - env: CACHE_NUMBER: 0 concurrency: From 58257fdb8c36217db2310cac9b50f187ce3710a5 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Wed, 5 Nov 2025 19:24:35 -0500 Subject: [PATCH 04/79] Artifacts upload check v1 --- .github/workflows/macos.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index db4fb69e121..39a9b0bc571 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -104,6 +104,41 @@ jobs: echo "PR_ID=none" >> "$GITHUB_ENV" echo "This run is not a PR (branch: ${GITHUB_REF_NAME})" fi + + - name: Create smoketest file (pr_/macos) + shell: bash + run: | + PR_DIR="pr_${PR_ID}" + mkdir -p "artifacts/${PR_DIR}/macos" + { + echo "workflow: macOS" + echo "event: ${{ github.event_name }}" + echo "branch: ${GITHUB_REF_NAME}" + echo "pr_id: ${PR_ID}" + echo "timestamp: $(date -Iseconds)" + } > "artifacts/${PR_DIR}/macos/smoketest.txt" + + - name: Upload smoketest artifact + uses: actions/upload-artifact@v4 + with: + name: pr_${{ env.PR_ID }}_macos_smoketest + path: artifacts/pr_${{ env.PR_ID }}/macos/smoketest.txt + retention-days: 3 + + - name: Download smoketest artifact (to verify upload) + uses: actions/download-artifact@v4 + with: + name: pr_${{ env.PR_ID }}_macos_smoketest + path: retrieved + + - name: Show downloaded artifact contents + shell: bash + run: | + echo "==== Retrieved Artifact Files ====" + find retrieved -type f + echo "----------------------------------" + echo "Content of smoketest.txt:" + cat retrieved/smoketest.txt || echo "No smoketest file found." - name: Run pytest with multiple workers in parallel shell: micromamba-shell {0} From 540600112ae7a1b56b3379d6312d5ce23d40047a Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Thu, 6 Nov 2025 19:14:53 -0500 Subject: [PATCH 05/79] Check if previous artifacts exist --- .github/workflows/macos.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 39a9b0bc571..305e2c6da27 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -104,6 +104,31 @@ jobs: echo "PR_ID=none" >> "$GITHUB_ENV" echo "This run is not a PR (branch: ${GITHUB_REF_NAME})" fi + + - name: Install jq in micromamba env + shell: micromamba-shell {0} + run: micromamba install -y jq + + + - name: Check If Previous Artifacts Exist + id: check_artifacts + shell: micromamba-shell {0} + run: | + echo "Checking if previous artifacts exist for PR-${PR_ID}..." + ARTIFACTS_RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${{ github.repository }}/actions/artifacts") + + ARTIFACT_COUNT=$(echo "$ARTIFACTS_RESPONSE" \ + | jq -r --arg NAME "pr_${PR_ID}_macos_smoketest" \ + '[.artifacts[] | select(.name==$NAME and .expired==false)] | length') + + echo "Found ${ARTIFACT_COUNT} matching artifact(s)." + if [[ "$ARTIFACT_COUNT" -gt 0 ]]; then + echo "PREV_ARTIFACT_EXISTS=true" >> "$GITHUB_ENV" + else + echo "PREV_ARTIFACT_EXISTS=false" >> "$GITHUB_ENV" + fi - name: Create smoketest file (pr_/macos) shell: bash From cbfb5fe94692dd7c4eee0a60e0bf2e3328059c6c Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Wed, 12 Nov 2025 19:06:02 -0500 Subject: [PATCH 06/79] uploading actual test results --- .github/workflows/macos.yml | 86 +++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 305e2c6da27..b083bbab932 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -109,7 +109,10 @@ jobs: shell: micromamba-shell {0} run: micromamba install -y jq - + - name: Install pytest-json-report + shell: micromamba-shell {0} + run: python -m pip install --upgrade pytest-json-report + - name: Check If Previous Artifacts Exist id: check_artifacts shell: micromamba-shell {0} @@ -165,18 +168,95 @@ jobs: echo "Content of smoketest.txt:" cat retrieved/smoketest.txt || echo "No smoketest file found." - - name: Run pytest with multiple workers in parallel + # - name: Run pytest with multiple workers in parallel + # shell: micromamba-shell {0} + # run: | + # PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + # LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + # export PYTHONPATH + # export LD_LIBRARY_PATH + # pytest \ + # @.github/workflows/pytest_args_ci.txt \ + # @.github/workflows/pytest_args_parallel.txt \ + # --junitxml=pytest.xdist.junit.xml \ + # -k 'not testsuite' + + - name: Collect all test cases (parallel macOS) shell: micromamba-shell {0} run: | PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" export PYTHONPATH export LD_LIBRARY_PATH + + PR_DIR="pr_${PR_ID}" + mkdir -p "artifacts/${PR_DIR}/macos" + + pytest \ + @.github/workflows/pytest_args_ci.txt \ + @.github/workflows/pytest_args_parallel.txt \ + --collect-only --quiet \ + -k 'not testsuite' \ + | grep "::" > "artifacts/${PR_DIR}/macos/all_tests.txt" || true + + + - name: Run pytest with multiple workers in parallel (JSON report) + shell: micromamba-shell {0} + run: | + PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + export PYTHONPATH + export LD_LIBRARY_PATH + + PR_DIR="pr_${PR_ID}" + mkdir -p "artifacts/${PR_DIR}/macos" + + OUT_JSON="artifacts/${PR_DIR}/macos/test_results.json" + pytest \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ --junitxml=pytest.xdist.junit.xml \ - -k 'not testsuite' + --json-report --json-report-file="${OUT_JSON}" \ + -k 'not testsuite' || true + + - name: Extract failed and passed tests (parallel macOS) + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + BASE_DIR="artifacts/${PR_DIR}/macos" + RESULTS="${BASE_DIR}/test_results.json" + FAILED="${BASE_DIR}/failed_tests.txt" + PASSED="${BASE_DIR}/passed_tests.txt" + + if [[ -f "${RESULTS}" ]]; then + jq -r '.tests | map(select(.outcome == "failed")) | .[].nodeid' \ + "${RESULTS}" > "${FAILED}" || true + jq -r '.tests | map(select(.outcome == "passed")) | .[].nodeid' \ + "${RESULTS}" > "${PASSED}" || true + else + : > "${FAILED}" + : > "${PASSED}" + fi + + echo "Failed tests:" + cat "${FAILED}" || true + echo "Passed tests:" + cat "${PASSED}" || true + + + - name: Upload macOS parallel test artifacts + uses: actions/upload-artifact@v4 + with: + name: pr_${{ env.PR_ID }}_macos_parallel_results + path: | + artifacts/pr_${{ env.PR_ID }}/macos/all_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos/failed_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos/passed_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos/test_results.json + retention-days: 7 + + - name: Run pytest with a single worker (for tests marked with needs_solo_run) shell: micromamba-shell {0} run: | From e5bac08d0cafbd17bf724f72ae8f033d580836f7 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Thu, 13 Nov 2025 19:26:16 -0500 Subject: [PATCH 07/79] adding failing testfile to test failure --- general/g.version/tests/g_version_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/general/g.version/tests/g_version_test.py b/general/g.version/tests/g_version_test.py index cc8912bdd82..165dce0f53c 100644 --- a/general/g.version/tests/g_version_test.py +++ b/general/g.version/tests/g_version_test.py @@ -9,6 +9,8 @@ "build_off_t_size", ] +def test_priotestci_force_fail(): + assert False, "Intentional failure to test PrioTestCI artifacts" def curly_brackets_paired(text): """Check whether all curly brackets in the given text are properly paired.""" From db980c398cb6b763789aa84ba36733a6496a2791 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Wed, 19 Nov 2025 17:31:26 -0500 Subject: [PATCH 08/79] Retrieve previous testcases --- .github/workflows/macos.yml | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b083bbab932..93129d6f58f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -181,6 +181,54 @@ jobs: # --junitxml=pytest.xdist.junit.xml \ # -k 'not testsuite' + - name: Check If Previous macOS Parallel Artifacts Exist + shell: micromamba-shell {0} + run: | + echo "Checking previous artifacts for PR-${PR_ID}..." + + ARTIFACTS_RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${{ github.repository }}/actions/artifacts") + + ARTIFACT_COUNT=$(echo "$ARTIFACTS_RESPONSE" \ + | jq -r --arg NAME "pr_${PR_ID}_macos_parallel_results" \ + '[.artifacts[] | select(.name==$NAME and .expired==false)] | length') + + echo "Found ${ARTIFACT_COUNT} matching artifact(s)." + + if [[ "$ARTIFACT_COUNT" -gt 0 ]]; then + echo "PREV_ARTIFACT_EXISTS=true" >> "$GITHUB_ENV" + else + echo "PREV_ARTIFACT_EXISTS=false" >> "$GITHUB_ENV" + fi + + - name: Retrieve Previous macOS Parallel Artifacts + if: env.PREV_ARTIFACT_EXISTS == 'true' + shell: micromamba-shell {0} + run: | + echo "Retrieving previous macOS parallel results for PR-${PR_ID}..." + + ARTIFACT_URL=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${{ github.repository }}/actions/artifacts" \ + | jq -r --arg NAME "pr_${PR_ID}_macos_parallel_results" \ + '[.artifacts[] | select(.name==$NAME)] | sort_by(.created_at) | reverse | .[0].archive_download_url') + + if [[ -z "$ARTIFACT_URL" || "$ARTIFACT_URL" == "null" ]]; then + echo "Artifact URL not found." + exit 0 + fi + + mkdir -p artifacts/pr_${PR_ID}/macos_prev + curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -o artifacts/pr_${PR_ID}/macos_prev/results.zip "$ARTIFACT_URL" + + unzip -o artifacts/pr_${PR_ID}/macos_prev/results.zip -d artifacts/pr_${PR_ID}/macos_prev + + echo "===== Previous macOS parallel test results =====" + cat artifacts/pr_${PR_ID}/macos_prev/test_results.json || echo "No previous JSON found" + echo "================================================" + - name: Collect all test cases (parallel macOS) shell: micromamba-shell {0} run: | From 06870491686efe03b2f6e1d08f2a588efb72e347 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 23 Nov 2025 19:08:55 -0500 Subject: [PATCH 09/79] Run previously failed first --- .github/workflows/macos.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 93129d6f58f..f8dc2bfb025 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -229,6 +229,38 @@ jobs: cat artifacts/pr_${PR_ID}/macos_prev/test_results.json || echo "No previous JSON found" echo "================================================" + - name: Run previously failed tests first (macOS) + shell: micromamba-shell {0} + run: | + PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + export PYTHONPATH + export LD_LIBRARY_PATH + + PR_DIR="pr_${PR_ID}" + PREV_DIR="artifacts/${PR_DIR}/macos_prev" + CURR_DIR="artifacts/${PR_DIR}/macos" + + mkdir -p "${CURR_DIR}" + + FAILED_TESTS_FILE="${PREV_DIR}/failed_tests.txt" + TEMP_RESULTS="${CURR_DIR}/temp_test_results.json" + + if [[ -s "${FAILED_TESTS_FILE}" ]]; then + echo "Re-running previously failed tests first:" + cat "${FAILED_TESTS_FILE}" + + pytest \ + @.github/workflows/pytest_args_ci.txt \ + @.github/workflows/pytest_args_parallel.txt \ + --json-report --json-report-file="${TEMP_RESULTS}" \ + $(cat "${FAILED_TESTS_FILE}") || true + else + echo "No previously failed tests found." + # create empty JSON file so next steps never break + echo '{"tests": []}' > "${TEMP_RESULTS}" + fi + - name: Collect all test cases (parallel macOS) shell: micromamba-shell {0} run: | From 106ed9610da70ec9fa99057705e512e0a898fbbf Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Fri, 28 Nov 2025 19:09:10 -0500 Subject: [PATCH 10/79] Check if any tests failed again --- .github/workflows/macos.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f8dc2bfb025..4bdddd871db 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -261,6 +261,33 @@ jobs: echo '{"tests": []}' > "${TEMP_RESULTS}" fi + - name: Check if any tests failed again (macOS) + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos" + TEMP_RESULTS="${CURR_DIR}/temp_test_results.json" + FAILED_AGAIN_FILE="${CURR_DIR}/failed_again.txt" + + if [[ -f "${TEMP_RESULTS}" ]]; then + echo "Checking if any previously failed tests are still failing..." + jq -r '.tests | map(select(.outcome == "failed")) | .[].nodeid' \ + "${TEMP_RESULTS}" > "${FAILED_AGAIN_FILE}" || true + else + echo "No temp JSON results found, assuming no tests failed again." + : > "${FAILED_AGAIN_FILE}" + fi + + if [[ -s "${FAILED_AGAIN_FILE}" ]]; then + echo "Some tests failed again. Stopping execution." + echo "Tests failing again:" + cat "${FAILED_AGAIN_FILE}" + exit 1 + else + echo "No tests failed again. Continuing with remaining tests..." + fi + + - name: Collect all test cases (parallel macOS) shell: micromamba-shell {0} run: | From 7d30aaa8e6432bc67a18e42be4123d8e566ec72f Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 6 Dec 2025 18:59:38 -0500 Subject: [PATCH 11/79] run remaining testcases --- .github/workflows/macos.yml | 76 ++++++++++++++++++++--- general/g.version/tests/g_version_test.py | 3 - 2 files changed, 68 insertions(+), 11 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4bdddd871db..50d97626833 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -306,7 +306,58 @@ jobs: -k 'not testsuite' \ | grep "::" > "artifacts/${PR_DIR}/macos/all_tests.txt" || true + - name: Identify remaining tests to run (macOS) + shell: micromamba-shell {0} + run: | + PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + export PYTHONPATH + export LD_LIBRARY_PATH + + PR_DIR="pr_${PR_ID}" + PREV_DIR="artifacts/${PR_DIR}/macos_prev" + CURR_DIR="artifacts/${PR_DIR}/macos" + + ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt" + FAILED_PREV="${PREV_DIR}/failed_tests.txt" + REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" + + mkdir -p "${CURR_DIR}" + + if [[ -f "${FAILED_PREV}" && -s "${FAILED_PREV}" ]]; then + echo "Computing remaining tests (excluding previously failed ones)..." + grep -v -F -f "${FAILED_PREV}" "${ALL_TESTS_FILE}" > "${REMAINING_TESTS_FILE}" || true + else + echo "No previous failed tests list found or it is empty." + echo "Treating all collected tests as remaining." + cp "${ALL_TESTS_FILE}" "${REMAINING_TESTS_FILE}" || true + fi + + echo "Remaining tests to run:" + cat "${REMAINING_TESTS_FILE}" || echo "No remaining tests found." + + + # - name: Run pytest with multiple workers in parallel (JSON report) + # shell: micromamba-shell {0} + # run: | + # PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + # LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + # export PYTHONPATH + # export LD_LIBRARY_PATH + + # PR_DIR="pr_${PR_ID}" + # mkdir -p "artifacts/${PR_DIR}/macos" + + # OUT_JSON="artifacts/${PR_DIR}/macos/test_results.json" + + # pytest \ + # @.github/workflows/pytest_args_ci.txt \ + # @.github/workflows/pytest_args_parallel.txt \ + # --junitxml=pytest.xdist.junit.xml \ + # --json-report --json-report-file="${OUT_JSON}" \ + # -k 'not testsuite' || true + - name: Run pytest with multiple workers in parallel (JSON report) shell: micromamba-shell {0} run: | @@ -316,16 +367,25 @@ jobs: export LD_LIBRARY_PATH PR_DIR="pr_${PR_ID}" - mkdir -p "artifacts/${PR_DIR}/macos" + CURR_DIR="artifacts/${PR_DIR}/macos" + mkdir -p "${CURR_DIR}" - OUT_JSON="artifacts/${PR_DIR}/macos/test_results.json" + OUT_JSON="${CURR_DIR}/test_results.json" + REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" + + if [[ -s "${REMAINING_TESTS_FILE}" ]]; then + echo "Running remaining test cases (macOS)..." + pytest \ + @.github/workflows/pytest_args_ci.txt \ + @.github/workflows/pytest_args_parallel.txt \ + --junitxml=pytest.xdist.junit.xml \ + --json-report --json-report-file="${OUT_JSON}" \ + $(cat "${REMAINING_TESTS_FILE}") || true + else + echo "No remaining test cases to run. Writing empty JSON." + echo '{"tests": []}' > "${OUT_JSON}" + fi - pytest \ - @.github/workflows/pytest_args_ci.txt \ - @.github/workflows/pytest_args_parallel.txt \ - --junitxml=pytest.xdist.junit.xml \ - --json-report --json-report-file="${OUT_JSON}" \ - -k 'not testsuite' || true - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} diff --git a/general/g.version/tests/g_version_test.py b/general/g.version/tests/g_version_test.py index 165dce0f53c..2dd9c3106c0 100644 --- a/general/g.version/tests/g_version_test.py +++ b/general/g.version/tests/g_version_test.py @@ -9,9 +9,6 @@ "build_off_t_size", ] -def test_priotestci_force_fail(): - assert False, "Intentional failure to test PrioTestCI artifacts" - def curly_brackets_paired(text): """Check whether all curly brackets in the given text are properly paired.""" counter = 0 From 8bdb01ece1c57f56c96853a490a7d93f7665a7a9 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 6 Dec 2025 19:17:53 -0500 Subject: [PATCH 12/79] Fail testcases --- general/g.version/tests/g_version_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/general/g.version/tests/g_version_test.py b/general/g.version/tests/g_version_test.py index 2dd9c3106c0..165dce0f53c 100644 --- a/general/g.version/tests/g_version_test.py +++ b/general/g.version/tests/g_version_test.py @@ -9,6 +9,9 @@ "build_off_t_size", ] +def test_priotestci_force_fail(): + assert False, "Intentional failure to test PrioTestCI artifacts" + def curly_brackets_paired(text): """Check whether all curly brackets in the given text are properly paired.""" counter = 0 From 2713724a47cae2bb26c040d24b56b9c8ef9393b6 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 6 Dec 2025 20:26:57 -0500 Subject: [PATCH 13/79] run remaining testcases after fixing failed --- general/g.version/tests/g_version_test.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/general/g.version/tests/g_version_test.py b/general/g.version/tests/g_version_test.py index 165dce0f53c..2dd9c3106c0 100644 --- a/general/g.version/tests/g_version_test.py +++ b/general/g.version/tests/g_version_test.py @@ -9,9 +9,6 @@ "build_off_t_size", ] -def test_priotestci_force_fail(): - assert False, "Intentional failure to test PrioTestCI artifacts" - def curly_brackets_paired(text): """Check whether all curly brackets in the given text are properly paired.""" counter = 0 From 96015e9054c5b8fd22e1d360a8c40ce31b97d4e9 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 7 Dec 2025 14:09:51 -0500 Subject: [PATCH 14/79] fail on purpose --- general/g.version/tests/g_version_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/general/g.version/tests/g_version_test.py b/general/g.version/tests/g_version_test.py index 2dd9c3106c0..3206669c7ea 100644 --- a/general/g.version/tests/g_version_test.py +++ b/general/g.version/tests/g_version_test.py @@ -8,6 +8,8 @@ "build_platform", "build_off_t_size", ] +def test_priotestci_force_fail(): + assert False, "Intentional failure to test PrioTestCI artifacts" def curly_brackets_paired(text): """Check whether all curly brackets in the given text are properly paired.""" From 59358fc61be8c522d626915009566ccdc09495ac Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 7 Dec 2025 19:36:35 -0500 Subject: [PATCH 15/79] correction in remainingtest --- .github/workflows/macos.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 50d97626833..608a7302cec 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -386,7 +386,6 @@ jobs: echo '{"tests": []}' > "${OUT_JSON}" fi - - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From 5021680d1e998a46a35518db0bf655281159d666 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 7 Dec 2025 20:01:56 -0500 Subject: [PATCH 16/79] Debug error --- .github/workflows/macos.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 608a7302cec..f6876c62eae 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -306,6 +306,43 @@ jobs: -k 'not testsuite' \ | grep "::" > "artifacts/${PR_DIR}/macos/all_tests.txt" || true + + - name: Debug all_tests count (macOS) + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos" + ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt" + + echo "===== DEBUG: all_tests.txt =====" + if [[ -f "${ALL_TESTS_FILE}" ]]; then + wc -l "${ALL_TESTS_FILE}" || true + echo "Sample lines:" + head -n 5 "${ALL_TESTS_FILE}" || true + else + echo "all_tests.txt not found" + fi + echo "================================" + + - name: Debug remaining_tests count (macOS) + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos" + REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" + + echo "===== DEBUG: remaining_tests.txt =====" + if [[ -f "${REMAINING_TESTS_FILE}" ]]; then + wc -l "${REMAINING_TESTS_FILE}" || true + echo "Sample lines:" + head -n 5 "${REMAINING_TESTS_FILE}" || true + else + echo "remaining_tests.txt not found" + fi + echo "======================================" + + + - name: Identify remaining tests to run (macOS) shell: micromamba-shell {0} run: | From 0d14d8f4b6603a456a88b644e640a231fc7e8581 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 7 Dec 2025 20:25:44 -0500 Subject: [PATCH 17/79] modify collect all testcases --- .github/workflows/macos.yml | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f6876c62eae..b4363e39830 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -297,14 +297,39 @@ jobs: export LD_LIBRARY_PATH PR_DIR="pr_${PR_ID}" - mkdir -p "artifacts/${PR_DIR}/macos" + CURR_DIR="artifacts/${PR_DIR}/macos" + mkdir -p "${CURR_DIR}" + + COLLECT_JSON="${CURR_DIR}/collect.json" + ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt" + echo "Collecting test cases into JSON..." pytest \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ - --collect-only --quiet \ - -k 'not testsuite' \ - | grep "::" > "artifacts/${PR_DIR}/macos/all_tests.txt" || true + --collect-only \ + --json-report --json-report-file="${COLLECT_JSON}" \ + -k 'not testsuite' || true + + echo "Extracting nodeids from collect.json..." + if [[ -f "${COLLECT_JSON}" ]]; then + # pytest-json-report usually stores collected tests here + jq -r '.collectors[].nodes[].nodeid // empty' "${COLLECT_JSON}" > "${ALL_TESTS_FILE}" || true + else + echo "WARNING: ${COLLECT_JSON} not found, writing empty all_tests.txt" + : > "${ALL_TESTS_FILE}" + fi + + echo "===== DEBUG: all_tests.txt =====" + if [[ -f "${ALL_TESTS_FILE}" ]]; then + wc -l "${ALL_TESTS_FILE}" || true + echo "Sample lines:" + head -n 5 "${ALL_TESTS_FILE}" || true + else + echo "all_tests.txt not found" + fi + echo "================================" + - name: Debug all_tests count (macOS) From 70f88c4e799861064f4fdf959294ebdddcae753f Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Thu, 11 Dec 2025 20:30:22 -0500 Subject: [PATCH 18/79] debug --- .github/workflows/macos.yml | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b4363e39830..cdb7f54101e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -300,36 +300,18 @@ jobs: CURR_DIR="artifacts/${PR_DIR}/macos" mkdir -p "${CURR_DIR}" - COLLECT_JSON="${CURR_DIR}/collect.json" ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt" - echo "Collecting test cases into JSON..." + echo "Collecting test nodeids..." pytest \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ - --collect-only \ - --json-report --json-report-file="${COLLECT_JSON}" \ - -k 'not testsuite' || true - - echo "Extracting nodeids from collect.json..." - if [[ -f "${COLLECT_JSON}" ]]; then - # pytest-json-report usually stores collected tests here - jq -r '.collectors[].nodes[].nodeid // empty' "${COLLECT_JSON}" > "${ALL_TESTS_FILE}" || true - else - echo "WARNING: ${COLLECT_JSON} not found, writing empty all_tests.txt" - : > "${ALL_TESTS_FILE}" - fi + --collect-only --quiet \ + -k 'not testsuite' | grep "::" > "${ALL_TESTS_FILE}" || true echo "===== DEBUG: all_tests.txt =====" - if [[ -f "${ALL_TESTS_FILE}" ]]; then - wc -l "${ALL_TESTS_FILE}" || true - echo "Sample lines:" - head -n 5 "${ALL_TESTS_FILE}" || true - else - echo "all_tests.txt not found" - fi - echo "================================" - + wc -l "${ALL_TESTS_FILE}" || true + head -n 10 "${ALL_TESTS_FILE}" || true - name: Debug all_tests count (macOS) From d09b48555a62f2e9e0d646ad3f792428e3d11360 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Thu, 11 Dec 2025 21:01:20 -0500 Subject: [PATCH 19/79] debug --- .github/workflows/macos.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index cdb7f54101e..7249f722303 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -300,18 +300,28 @@ jobs: CURR_DIR="artifacts/${PR_DIR}/macos" mkdir -p "${CURR_DIR}" + RAW_COLLECT="${CURR_DIR}/raw_collect.txt" ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt" echo "Collecting test nodeids..." + # 1) Capture ALL output (stdout + stderr) pytest \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ - --collect-only --quiet \ - -k 'not testsuite' | grep "::" > "${ALL_TESTS_FILE}" || true + --collect-only -q \ + -k 'not testsuite' > "${RAW_COLLECT}" 2>&1 || true + + echo "===== DEBUG: raw_collect (first 40 lines) =====" + head -n 40 "${RAW_COLLECT}" || true + echo "===============================================" + + # 2) Extract lines that look like nodeids + grep "::" "${RAW_COLLECT}" > "${ALL_TESTS_FILE}" || true echo "===== DEBUG: all_tests.txt =====" wc -l "${ALL_TESTS_FILE}" || true head -n 10 "${ALL_TESTS_FILE}" || true + echo "================================" - name: Debug all_tests count (macOS) From 41ad2dbd2536a3ce88c8d78869f552dcf8db7725 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 13 Dec 2025 19:39:04 -0500 Subject: [PATCH 20/79] remaining file modified --- .github/workflows/macos.yml | 51 +++++++++++++------------------------ 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 7249f722303..c68624c0c52 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -288,40 +288,28 @@ jobs: fi - - name: Collect all test cases (parallel macOS) + - name: Collect all test cases (nodeids) (macOS) shell: micromamba-shell {0} run: | PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - export PYTHONPATH - export LD_LIBRARY_PATH + export PYTHONPATH LD_LIBRARY_PATH PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos" mkdir -p "${CURR_DIR}" - RAW_COLLECT="${CURR_DIR}/raw_collect.txt" ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt" - echo "Collecting test nodeids..." - # 1) Capture ALL output (stdout + stderr) - pytest \ - @.github/workflows/pytest_args_ci.txt \ - @.github/workflows/pytest_args_parallel.txt \ - --collect-only -q \ - -k 'not testsuite' > "${RAW_COLLECT}" 2>&1 || true - - echo "===== DEBUG: raw_collect (first 40 lines) =====" - head -n 40 "${RAW_COLLECT}" || true - echo "===============================================" - - # 2) Extract lines that look like nodeids - grep "::" "${RAW_COLLECT}" > "${ALL_TESTS_FILE}" || true + # IMPORTANT: + # -q makes pytest print nodeids instead of the tree + # don't include @pytest_args_*.txt here because they may enable verbose collection output + pytest --collect-only -q -k 'not testsuite' 2>/dev/null > "${ALL_TESTS_FILE}" || true echo "===== DEBUG: all_tests.txt =====" wc -l "${ALL_TESTS_FILE}" || true head -n 10 "${ALL_TESTS_FILE}" || true - echo "================================" + - name: Debug all_tests count (macOS) @@ -363,11 +351,6 @@ jobs: - name: Identify remaining tests to run (macOS) shell: micromamba-shell {0} run: | - PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" - LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - export PYTHONPATH - export LD_LIBRARY_PATH - PR_DIR="pr_${PR_ID}" PREV_DIR="artifacts/${PR_DIR}/macos_prev" CURR_DIR="artifacts/${PR_DIR}/macos" @@ -376,19 +359,21 @@ jobs: FAILED_PREV="${PREV_DIR}/failed_tests.txt" REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" - mkdir -p "${CURR_DIR}" - - if [[ -f "${FAILED_PREV}" && -s "${FAILED_PREV}" ]]; then - echo "Computing remaining tests (excluding previously failed ones)..." + if [[ -s "${FAILED_PREV}" ]]; then grep -v -F -f "${FAILED_PREV}" "${ALL_TESTS_FILE}" > "${REMAINING_TESTS_FILE}" || true + # fallback if it becomes empty + if [[ ! -s "${REMAINING_TESTS_FILE}" ]]; then + echo "Remaining became empty after filtering; falling back to ALL tests." + cp "${ALL_TESTS_FILE}" "${REMAINING_TESTS_FILE}" + fi else - echo "No previous failed tests list found or it is empty." - echo "Treating all collected tests as remaining." - cp "${ALL_TESTS_FILE}" "${REMAINING_TESTS_FILE}" || true + cp "${ALL_TESTS_FILE}" "${REMAINING_TESTS_FILE}" fi - echo "Remaining tests to run:" - cat "${REMAINING_TESTS_FILE}" || echo "No remaining tests found." + echo "===== DEBUG: remaining_tests.txt =====" + wc -l "${REMAINING_TESTS_FILE}" || true + head -n 10 "${REMAINING_TESTS_FILE}" || true + From 701d9a872714b71b25add871f24bcad17e3c2e13 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Fri, 19 Dec 2025 19:31:02 -0500 Subject: [PATCH 21/79] Run remaining by formatting fil --- .github/workflows/macos.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index c68624c0c52..70f2b9d7da3 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -414,17 +414,20 @@ jobs: if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining test cases (macOS)..." + tr -d '\r' < "${REMAINING_TESTS_FILE}" > /tmp/remaining_tests_clean.txt + pytest \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ --junitxml=pytest.xdist.junit.xml \ --json-report --json-report-file="${OUT_JSON}" \ - $(cat "${REMAINING_TESTS_FILE}") || true + $(cat /tmp/remaining_tests_clean.txt) || true else echo "No remaining test cases to run. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" fi + - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From 7bfb3c46972f623ccde956e14f20411714d723ce Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Fri, 19 Dec 2025 20:43:07 -0500 Subject: [PATCH 22/79] xargs --- .github/workflows/macos.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 70f2b9d7da3..9faa644e08f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -402,8 +402,7 @@ jobs: run: | PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - export PYTHONPATH - export LD_LIBRARY_PATH + export PYTHONPATH LD_LIBRARY_PATH PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos" @@ -416,18 +415,18 @@ jobs: echo "Running remaining test cases (macOS)..." tr -d '\r' < "${REMAINING_TESTS_FILE}" > /tmp/remaining_tests_clean.txt - pytest \ + xargs -a /tmp/remaining_tests_clean.txt pytest \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ --junitxml=pytest.xdist.junit.xml \ - --json-report --json-report-file="${OUT_JSON}" \ - $(cat /tmp/remaining_tests_clean.txt) || true + --json-report --json-report-file="${OUT_JSON}" || true else echo "No remaining test cases to run. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" fi + - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From 6d5706c4b9250230870937d743749ee281db1216 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Fri, 19 Dec 2025 21:03:47 -0500 Subject: [PATCH 23/79] modify xargs --- .github/workflows/macos.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9faa644e08f..cea468bb554 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -402,7 +402,8 @@ jobs: run: | PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - export PYTHONPATH LD_LIBRARY_PATH + export PYTHONPATH + export LD_LIBRARY_PATH PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos" @@ -413,13 +414,17 @@ jobs: if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining test cases (macOS)..." + + # macOS-safe: remove CRLF if the file came from Windows/zip tr -d '\r' < "${REMAINING_TESTS_FILE}" > /tmp/remaining_tests_clean.txt - xargs -a /tmp/remaining_tests_clean.txt pytest \ + # macOS/BSD xargs doesn't support -a, so use stdin redirection + xargs pytest \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ --junitxml=pytest.xdist.junit.xml \ - --json-report --json-report-file="${OUT_JSON}" || true + --json-report --json-report-file="${OUT_JSON}" \ + < /tmp/remaining_tests_clean.txt || true else echo "No remaining test cases to run. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" @@ -427,6 +432,7 @@ jobs: + - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From 2e1e62e82e314f2ddda0e720b69ac0978d10051f Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Fri, 19 Dec 2025 21:19:07 -0500 Subject: [PATCH 24/79] bash array --- .github/workflows/macos.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index cea468bb554..f2ccde6402d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -402,8 +402,7 @@ jobs: run: | PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - export PYTHONPATH - export LD_LIBRARY_PATH + export PYTHONPATH LD_LIBRARY_PATH PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos" @@ -415,16 +414,19 @@ jobs: if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining test cases (macOS)..." - # macOS-safe: remove CRLF if the file came from Windows/zip - tr -d '\r' < "${REMAINING_TESTS_FILE}" > /tmp/remaining_tests_clean.txt + # Read nodeids safely (strip CR, drop empty lines) into a bash array + mapfile -t TESTS < <(tr -d '\r' < "${REMAINING_TESTS_FILE}" | sed '/^[[:space:]]*$/d') - # macOS/BSD xargs doesn't support -a, so use stdin redirection - xargs pytest \ + echo "Count: ${#TESTS[@]}" + echo "First 5:" + printf '%s\n' "${TESTS[@]:0:5}" + + pytest \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ --junitxml=pytest.xdist.junit.xml \ --json-report --json-report-file="${OUT_JSON}" \ - < /tmp/remaining_tests_clean.txt || true + "${TESTS[@]}" || true else echo "No remaining test cases to run. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" @@ -433,6 +435,7 @@ jobs: + - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From 4659a552057a9203088d261f820eec17229fec14 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Fri, 19 Dec 2025 22:03:14 -0500 Subject: [PATCH 25/79] exclude gunittest execution --- .github/workflows/macos.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f2ccde6402d..33e6f176d09 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -402,7 +402,8 @@ jobs: run: | PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - export PYTHONPATH LD_LIBRARY_PATH + export PYTHONPATH + export LD_LIBRARY_PATH PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos" @@ -412,30 +413,24 @@ jobs: REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" if [[ -s "${REMAINING_TESTS_FILE}" ]]; then - echo "Running remaining test cases (macOS)..." - - # Read nodeids safely (strip CR, drop empty lines) into a bash array - mapfile -t TESTS < <(tr -d '\r' < "${REMAINING_TESTS_FILE}" | sed '/^[[:space:]]*$/d') + echo "Running remaining pytest test cases (excluding testsuite)..." - echo "Count: ${#TESTS[@]}" - echo "First 5:" - printf '%s\n' "${TESTS[@]:0:5}" + # macOS safety: remove CRLF just in case + tr -d '\r' < "${REMAINING_TESTS_FILE}" > /tmp/remaining_tests_clean.txt pytest \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ + -k 'not testsuite' \ --junitxml=pytest.xdist.junit.xml \ --json-report --json-report-file="${OUT_JSON}" \ - "${TESTS[@]}" || true + $(cat /tmp/remaining_tests_clean.txt) || true else echo "No remaining test cases to run. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" fi - - - - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From bde61329839ffeee33b28ba14d6d743978766886 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Fri, 19 Dec 2025 22:34:57 -0500 Subject: [PATCH 26/79] temporary disable early exit --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 33e6f176d09..34d5bc9790d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -282,7 +282,7 @@ jobs: echo "Some tests failed again. Stopping execution." echo "Tests failing again:" cat "${FAILED_AGAIN_FILE}" - exit 1 + # exit 1 else echo "No tests failed again. Continuing with remaining tests..." fi From 33231eeb72acd1f3d132ebac75f38d52f604cfd5 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Fri, 19 Dec 2025 22:53:09 -0500 Subject: [PATCH 27/79] remove cat --- .github/workflows/macos.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 34d5bc9790d..4928df59778 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -402,8 +402,7 @@ jobs: run: | PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - export PYTHONPATH - export LD_LIBRARY_PATH + export PYTHONPATH LD_LIBRARY_PATH PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos" @@ -415,8 +414,15 @@ jobs: if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining pytest test cases (excluding testsuite)..." - # macOS safety: remove CRLF just in case - tr -d '\r' < "${REMAINING_TESTS_FILE}" > /tmp/remaining_tests_clean.txt + # Clean CRLF + remove blank lines + tr -d '\r' < "${REMAINING_TESTS_FILE}" | sed '/^[[:space:]]*$/d' > /tmp/remaining_tests_clean.txt + + # Load nodeids safely into an array (NO word-splitting issues) + mapfile -t TESTS < /tmp/remaining_tests_clean.txt + + echo "Remaining tests count: ${#TESTS[@]}" + echo "First 5:" + printf '%s\n' "${TESTS[@]:0:5}" pytest \ @.github/workflows/pytest_args_ci.txt \ @@ -424,13 +430,14 @@ jobs: -k 'not testsuite' \ --junitxml=pytest.xdist.junit.xml \ --json-report --json-report-file="${OUT_JSON}" \ - $(cat /tmp/remaining_tests_clean.txt) || true + "${TESTS[@]}" || true else echo "No remaining test cases to run. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" fi + - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From 9a18f4726e01d7c91d00cf9452c42d812ab9cb1f Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 00:53:41 -0500 Subject: [PATCH 28/79] check remaining count --- .github/workflows/macos.yml | 44 +++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4928df59778..0b281b2b2a4 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -400,41 +400,51 @@ jobs: - name: Run pytest with multiple workers in parallel (JSON report) shell: micromamba-shell {0} run: | - PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" - LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - export PYTHONPATH LD_LIBRARY_PATH + bash -lc ' + PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + export PYTHONPATH LD_LIBRARY_PATH - PR_DIR="pr_${PR_ID}" - CURR_DIR="artifacts/${PR_DIR}/macos" - mkdir -p "${CURR_DIR}" + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos" + mkdir -p "${CURR_DIR}" - OUT_JSON="${CURR_DIR}/test_results.json" - REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" + OUT_JSON="${CURR_DIR}/test_results.json" + REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" + + if [[ ! -s "${REMAINING_TESTS_FILE}" ]]; then + echo "No remaining test cases to run. Writing empty JSON." + echo "{\"tests\": []}" > "${OUT_JSON}" + exit 0 + fi - if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining pytest test cases (excluding testsuite)..." # Clean CRLF + remove blank lines - tr -d '\r' < "${REMAINING_TESTS_FILE}" | sed '/^[[:space:]]*$/d' > /tmp/remaining_tests_clean.txt + tr -d "\r" < "${REMAINING_TESTS_FILE}" | sed "/^[[:space:]]*$/d" > /tmp/remaining_tests_clean.txt - # Load nodeids safely into an array (NO word-splitting issues) + # Load nodeids into array mapfile -t TESTS < /tmp/remaining_tests_clean.txt echo "Remaining tests count: ${#TESTS[@]}" echo "First 5:" - printf '%s\n' "${TESTS[@]:0:5}" + printf "%s\n" "${TESTS[@]:0:5}" + + # IMPORTANT: if empty, do NOT run full suite by accident + if [[ ${#TESTS[@]} -eq 0 ]]; then + echo "ERROR: remaining_tests_clean.txt produced 0 nodeids. Refusing to run full suite." + exit 2 + fi pytest \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ - -k 'not testsuite' \ + -k "not testsuite" \ --junitxml=pytest.xdist.junit.xml \ --json-report --json-report-file="${OUT_JSON}" \ "${TESTS[@]}" || true - else - echo "No remaining test cases to run. Writing empty JSON." - echo '{"tests": []}' > "${OUT_JSON}" - fi + ' + From 4dd4a63003f5d3764880bde3fa1138234f8a5be6 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 01:11:18 -0500 Subject: [PATCH 29/79] no mapfile --- .github/workflows/macos.yml | 50 ++++++++++++++----------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0b281b2b2a4..9c20be7b1c6 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -400,51 +400,39 @@ jobs: - name: Run pytest with multiple workers in parallel (JSON report) shell: micromamba-shell {0} run: | - bash -lc ' - PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" - LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - export PYTHONPATH LD_LIBRARY_PATH - - PR_DIR="pr_${PR_ID}" - CURR_DIR="artifacts/${PR_DIR}/macos" - mkdir -p "${CURR_DIR}" + PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + export PYTHONPATH LD_LIBRARY_PATH - OUT_JSON="${CURR_DIR}/test_results.json" - REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos" + mkdir -p "${CURR_DIR}" - if [[ ! -s "${REMAINING_TESTS_FILE}" ]]; then - echo "No remaining test cases to run. Writing empty JSON." - echo "{\"tests\": []}" > "${OUT_JSON}" - exit 0 - fi + OUT_JSON="${CURR_DIR}/test_results.json" + REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" + if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining pytest test cases (excluding testsuite)..." # Clean CRLF + remove blank lines - tr -d "\r" < "${REMAINING_TESTS_FILE}" | sed "/^[[:space:]]*$/d" > /tmp/remaining_tests_clean.txt + tr -d '\r' < "${REMAINING_TESTS_FILE}" | sed '/^[[:space:]]*$/d' > /tmp/remaining_tests_clean.txt - # Load nodeids into array - mapfile -t TESTS < /tmp/remaining_tests_clean.txt - - echo "Remaining tests count: ${#TESTS[@]}" + echo "Remaining tests count: $(wc -l < /tmp/remaining_tests_clean.txt)" echo "First 5:" - printf "%s\n" "${TESTS[@]:0:5}" - - # IMPORTANT: if empty, do NOT run full suite by accident - if [[ ${#TESTS[@]} -eq 0 ]]; then - echo "ERROR: remaining_tests_clean.txt produced 0 nodeids. Refusing to run full suite." - exit 2 - fi + head -n 5 /tmp/remaining_tests_clean.txt || true + # IMPORTANT: pass nodeids + keep filter to avoid testsuite pytest \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ - -k "not testsuite" \ + -k 'not testsuite' \ --junitxml=pytest.xdist.junit.xml \ --json-report --json-report-file="${OUT_JSON}" \ - "${TESTS[@]}" || true - ' - + $(cat /tmp/remaining_tests_clean.txt) || true + else + echo "No remaining test cases to run. Writing empty JSON." + echo '{"tests": []}' > "${OUT_JSON}" + fi From b0d38d16225040d2f725c806dabda98ef59706a1 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 01:35:17 -0500 Subject: [PATCH 30/79] pass file first arg --- .github/workflows/macos.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9c20be7b1c6..b5475cb7809 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -422,16 +422,15 @@ jobs: head -n 5 /tmp/remaining_tests_clean.txt || true # IMPORTANT: pass nodeids + keep filter to avoid testsuite + pytest \ + @/tmp/remaining_tests_clean.txt \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ -k 'not testsuite' \ --junitxml=pytest.xdist.junit.xml \ - --json-report --json-report-file="${OUT_JSON}" \ - $(cat /tmp/remaining_tests_clean.txt) || true - else - echo "No remaining test cases to run. Writing empty JSON." - echo '{"tests": []}' > "${OUT_JSON}" + --json-report --json-report-file="${OUT_JSON}" || true + fi From 87325d13f723cf682b6e7dde61b1ec36e9f63b82 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 01:50:38 -0500 Subject: [PATCH 31/79] remove testsuite --- .github/workflows/macos.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b5475cb7809..a9882025211 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -414,23 +414,26 @@ jobs: if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining pytest test cases (excluding testsuite)..." - # Clean CRLF + remove blank lines - tr -d '\r' < "${REMAINING_TESTS_FILE}" | sed '/^[[:space:]]*$/d' > /tmp/remaining_tests_clean.txt + # Clean CRLF + remove blank lines + filter out testsuite + tr -d '\r' < "${REMAINING_TESTS_FILE}" \ + | sed '/^[[:space:]]*$/d' \ + | grep -v 'testsuite' > /tmp/remaining_tests_clean.txt || true echo "Remaining tests count: $(wc -l < /tmp/remaining_tests_clean.txt)" echo "First 5:" head -n 5 /tmp/remaining_tests_clean.txt || true - # IMPORTANT: pass nodeids + keep filter to avoid testsuite - + # Run pytest with explicit node IDs (removed -k filter) pytest \ @/tmp/remaining_tests_clean.txt \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ - -k 'not testsuite' \ --junitxml=pytest.xdist.junit.xml \ --json-report --json-report-file="${OUT_JSON}" || true - + + else + echo "No remaining test cases to run. Writing empty JSON." + echo '{"tests": []}' > "${OUT_JSON}" fi From 1dd7aa3bdbd0e9557a21496b28d4732c992db1be Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 19:50:32 -0500 Subject: [PATCH 32/79] new --- .github/workflows/macos.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a9882025211..58e2d0993e1 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -400,6 +400,8 @@ jobs: - name: Run pytest with multiple workers in parallel (JSON report) shell: micromamba-shell {0} run: | + set -euo pipefail + PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" export PYTHONPATH LD_LIBRARY_PATH @@ -410,6 +412,7 @@ jobs: OUT_JSON="${CURR_DIR}/test_results.json" REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" + CLEAN_FILE="/tmp/remaining_tests_clean.txt" if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining pytest test cases (excluding testsuite)..." @@ -417,20 +420,26 @@ jobs: # Clean CRLF + remove blank lines + filter out testsuite tr -d '\r' < "${REMAINING_TESTS_FILE}" \ | sed '/^[[:space:]]*$/d' \ - | grep -v 'testsuite' > /tmp/remaining_tests_clean.txt || true + | grep -v 'testsuite' > "${CLEAN_FILE}" || true - echo "Remaining tests count: $(wc -l < /tmp/remaining_tests_clean.txt)" + echo "Remaining tests count: $(wc -l < "${CLEAN_FILE}")" echo "First 5:" - head -n 5 /tmp/remaining_tests_clean.txt || true + head -n 5 "${CLEAN_FILE}" || true + + # Safety: if empty, DO NOT run full suite + if [[ "$(wc -l < "${CLEAN_FILE}")" -eq 0 ]]; then + echo "ERROR: ${CLEAN_FILE} has 0 nodeids. Refusing to run full suite." + exit 2 + fi - # Run pytest with explicit node IDs (removed -k filter) + # IMPORTANT: options first, nodeids last pytest \ - @/tmp/remaining_tests_clean.txt \ @.github/workflows/pytest_args_ci.txt \ @.github/workflows/pytest_args_parallel.txt \ --junitxml=pytest.xdist.junit.xml \ - --json-report --json-report-file="${OUT_JSON}" || true - + --json-report --json-report-file="${OUT_JSON}" \ + @"${CLEAN_FILE}" || true + else echo "No remaining test cases to run. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" @@ -438,6 +447,7 @@ jobs: + - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From a3768854bfcbb0c98ea126d1b89c402e62d48d75 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 20:04:22 -0500 Subject: [PATCH 33/79] pytest command --- .github/workflows/macos.yml | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 58e2d0993e1..46d4368edd8 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -400,8 +400,6 @@ jobs: - name: Run pytest with multiple workers in parallel (JSON report) shell: micromamba-shell {0} run: | - set -euo pipefail - PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" export PYTHONPATH LD_LIBRARY_PATH @@ -412,34 +410,32 @@ jobs: OUT_JSON="${CURR_DIR}/test_results.json" REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" - CLEAN_FILE="/tmp/remaining_tests_clean.txt" if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining pytest test cases (excluding testsuite)..." - # Clean CRLF + remove blank lines + filter out testsuite + # Clean CRLF + remove blank lines tr -d '\r' < "${REMAINING_TESTS_FILE}" \ - | sed '/^[[:space:]]*$/d' \ - | grep -v 'testsuite' > "${CLEAN_FILE}" || true + | sed '/^[[:space:]]*$/d' > /tmp/remaining_tests_clean.txt - echo "Remaining tests count: $(wc -l < "${CLEAN_FILE}")" + echo "Remaining tests count: $(wc -l < /tmp/remaining_tests_clean.txt)" echo "First 5:" - head -n 5 "${CLEAN_FILE}" || true - - # Safety: if empty, DO NOT run full suite - if [[ "$(wc -l < "${CLEAN_FILE}")" -eq 0 ]]; then - echo "ERROR: ${CLEAN_FILE} has 0 nodeids. Refusing to run full suite." - exit 2 - fi + head -n 5 /tmp/remaining_tests_clean.txt || true - # IMPORTANT: options first, nodeids last + # Run pytest - test files first, then options pytest \ - @.github/workflows/pytest_args_ci.txt \ - @.github/workflows/pytest_args_parallel.txt \ + --verbose \ + --color=yes \ + --durations=0 \ + --durations-min=0.5 \ + --numprocesses=auto \ --junitxml=pytest.xdist.junit.xml \ - --json-report --json-report-file="${OUT_JSON}" \ - @"${CLEAN_FILE}" || true - + -o junit_family=xunit2 \ + --json-report \ + --json-report-file="${OUT_JSON}" \ + -ra \ + @/tmp/remaining_tests_clean.txt || true + else echo "No remaining test cases to run. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" @@ -447,7 +443,6 @@ jobs: - - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From 1c501b853eaac7f36c5addaf05369a4b67c8b386 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 20:19:26 -0500 Subject: [PATCH 34/79] debug path --- .github/workflows/macos.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 46d4368edd8..0ae92a036e5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -422,7 +422,20 @@ jobs: echo "First 5:" head -n 5 /tmp/remaining_tests_clean.txt || true - # Run pytest - test files first, then options + # DEBUG: Check if test files exist + echo "Current directory: $(pwd)" + echo "Checking if first test file exists:" + FIRST_TEST=$(head -n 1 /tmp/remaining_tests_clean.txt | cut -d':' -f1) + echo "First test file: ${FIRST_TEST}" + if [[ -f "${FIRST_TEST}" ]]; then + echo "✓ File exists!" + else + echo "✗ File NOT found!" + echo "Looking for it..." + find . -name "$(basename ${FIRST_TEST})" -type f | head -5 + fi + + # Run pytest with explicit node IDs pytest \ --verbose \ --color=yes \ From a7c2afc4cae46505b1345995b501f2f76c2bdfaa Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 20:33:41 -0500 Subject: [PATCH 35/79] change to xargs --- .github/workflows/macos.yml | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0ae92a036e5..2846ed6347e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -422,21 +422,8 @@ jobs: echo "First 5:" head -n 5 /tmp/remaining_tests_clean.txt || true - # DEBUG: Check if test files exist - echo "Current directory: $(pwd)" - echo "Checking if first test file exists:" - FIRST_TEST=$(head -n 1 /tmp/remaining_tests_clean.txt | cut -d':' -f1) - echo "First test file: ${FIRST_TEST}" - if [[ -f "${FIRST_TEST}" ]]; then - echo "✓ File exists!" - else - echo "✗ File NOT found!" - echo "Looking for it..." - find . -name "$(basename ${FIRST_TEST})" -type f | head -5 - fi - - # Run pytest with explicit node IDs - pytest \ + # Run pytest - pass test nodeids directly via command line (not @file) + cat /tmp/remaining_tests_clean.txt | xargs pytest \ --verbose \ --color=yes \ --durations=0 \ @@ -446,8 +433,7 @@ jobs: -o junit_family=xunit2 \ --json-report \ --json-report-file="${OUT_JSON}" \ - -ra \ - @/tmp/remaining_tests_clean.txt || true + -ra || true else echo "No remaining test cases to run. Writing empty JSON." From 9fade8c974d4d5d4c4f37b6f0d26c2394e1beab1 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 20:49:00 -0500 Subject: [PATCH 36/79] pass files instead of nodeids --- .github/workflows/macos.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2846ed6347e..945fb0d1074 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -403,45 +403,53 @@ jobs: PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" export PYTHONPATH LD_LIBRARY_PATH - + PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos" mkdir -p "${CURR_DIR}" - + OUT_JSON="${CURR_DIR}/test_results.json" REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" - + if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining pytest test cases (excluding testsuite)..." - + # Clean CRLF + remove blank lines tr -d '\r' < "${REMAINING_TESTS_FILE}" \ | sed '/^[[:space:]]*$/d' > /tmp/remaining_tests_clean.txt - + echo "Remaining tests count: $(wc -l < /tmp/remaining_tests_clean.txt)" echo "First 5:" head -n 5 /tmp/remaining_tests_clean.txt || true - - # Run pytest - pass test nodeids directly via command line (not @file) - cat /tmp/remaining_tests_clean.txt | xargs pytest \ + + # Extract unique test file paths (remove ::test_name parts) + awk -F'::' '{print $1}' /tmp/remaining_tests_clean.txt | sort -u > /tmp/test_files.txt + + echo "Test files count: $(wc -l < /tmp/test_files.txt)" + echo "Test files:" + cat /tmp/test_files.txt + + # Run pytest with parallel workers on test files + # xdist will automatically discover and distribute all tests in these files + pytest \ --verbose \ --color=yes \ --durations=0 \ --durations-min=0.5 \ - --numprocesses=auto \ + -n auto \ --junitxml=pytest.xdist.junit.xml \ -o junit_family=xunit2 \ --json-report \ --json-report-file="${OUT_JSON}" \ - -ra || true - + -ra \ + $(cat /tmp/test_files.txt) || true + else echo "No remaining test cases to run. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" fi - - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From db660be20cfda7d0e9f3b506fd5a86a0133ec009 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 21:00:51 -0500 Subject: [PATCH 37/79] override marker --- .github/workflows/macos.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 945fb0d1074..02d8fcaac64 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -422,21 +422,21 @@ jobs: echo "First 5:" head -n 5 /tmp/remaining_tests_clean.txt || true - # Extract unique test file paths (remove ::test_name parts) + # Extract unique test file paths awk -F'::' '{print $1}' /tmp/remaining_tests_clean.txt | sort -u > /tmp/test_files.txt echo "Test files count: $(wc -l < /tmp/test_files.txt)" echo "Test files:" cat /tmp/test_files.txt - # Run pytest with parallel workers on test files - # xdist will automatically discover and distribute all tests in these files + # Run pytest with parallel workers - OVERRIDE marker filter with empty -m pytest \ --verbose \ --color=yes \ --durations=0 \ --durations-min=0.5 \ -n auto \ + -m "" \ --junitxml=pytest.xdist.junit.xml \ -o junit_family=xunit2 \ --json-report \ From 33ad29a7fe7c1eff11dd46f430e8b12b18cf6d02 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 22:18:36 -0500 Subject: [PATCH 38/79] try --- .github/workflows/macos.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 02d8fcaac64..6a18d9191db 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -422,27 +422,19 @@ jobs: echo "First 5:" head -n 5 /tmp/remaining_tests_clean.txt || true - # Extract unique test file paths - awk -F'::' '{print $1}' /tmp/remaining_tests_clean.txt | sort -u > /tmp/test_files.txt - - echo "Test files count: $(wc -l < /tmp/test_files.txt)" - echo "Test files:" - cat /tmp/test_files.txt - - # Run pytest with parallel workers - OVERRIDE marker filter with empty -m + # Run pytest with -c to IGNORE pyproject.toml config pytest \ + -c /dev/null \ --verbose \ --color=yes \ --durations=0 \ --durations-min=0.5 \ -n auto \ - -m "" \ --junitxml=pytest.xdist.junit.xml \ - -o junit_family=xunit2 \ --json-report \ --json-report-file="${OUT_JSON}" \ -ra \ - $(cat /tmp/test_files.txt) || true + $(cat /tmp/remaining_tests_clean.txt) || true else echo "No remaining test cases to run. Writing empty JSON." From 77ec57d82368886084c4c72ebae788e246bd9deb Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 22:57:54 -0500 Subject: [PATCH 39/79] marker --- .github/workflows/macos.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 6a18d9191db..88b5bcdd85f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -422,19 +422,17 @@ jobs: echo "First 5:" head -n 5 /tmp/remaining_tests_clean.txt || true - # Run pytest with -c to IGNORE pyproject.toml config + # Create a custom args file WITHOUT the -m filter + grep -v '^-m' .github/workflows/pytest_args_parallel.txt > /tmp/pytest_args_parallel_nomarker.txt + + # Run pytest with explicit node IDs pytest \ - -c /dev/null \ - --verbose \ - --color=yes \ - --durations=0 \ - --durations-min=0.5 \ - -n auto \ + @.github/workflows/pytest_args_ci.txt \ + @/tmp/pytest_args_parallel_nomarker.txt \ --junitxml=pytest.xdist.junit.xml \ --json-report \ --json-report-file="${OUT_JSON}" \ - -ra \ - $(cat /tmp/remaining_tests_clean.txt) || true + @/tmp/remaining_tests_clean.txt || true else echo "No remaining test cases to run. Writing empty JSON." From 67320d311fc45164dc717ce5c70de7104083e575 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 23:13:41 -0500 Subject: [PATCH 40/79] change --- .github/workflows/macos.yml | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 88b5bcdd85f..9543f44a54b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -403,43 +403,46 @@ jobs: PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" export PYTHONPATH LD_LIBRARY_PATH - + PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos" mkdir -p "${CURR_DIR}" - + OUT_JSON="${CURR_DIR}/test_results.json" REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" - + if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining pytest test cases (excluding testsuite)..." - - # Clean CRLF + remove blank lines + + # Clean CRLF + remove blank lines + drop testsuite just in case tr -d '\r' < "${REMAINING_TESTS_FILE}" \ - | sed '/^[[:space:]]*$/d' > /tmp/remaining_tests_clean.txt - + | sed '/^[[:space:]]*$/d' \ + | grep -v 'testsuite' > /tmp/remaining_tests_clean.txt || true + echo "Remaining tests count: $(wc -l < /tmp/remaining_tests_clean.txt)" echo "First 5:" head -n 5 /tmp/remaining_tests_clean.txt || true - - # Create a custom args file WITHOUT the -m filter - grep -v '^-m' .github/workflows/pytest_args_parallel.txt > /tmp/pytest_args_parallel_nomarker.txt - - # Run pytest with explicit node IDs + + # Remove selection filters when running explicit node IDs + # (otherwise pytest can deselect everything and you get 0 items) + grep -vE '^-m(\s|$)|^-k(\s|$)' .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_noselect.txt + grep -vE '^-m(\s|$)|^-k(\s|$)' .github/workflows/pytest_args_parallel.txt > /tmp/pytest_args_parallel_noselect.txt + pytest \ - @.github/workflows/pytest_args_ci.txt \ - @/tmp/pytest_args_parallel_nomarker.txt \ + @/tmp/pytest_args_ci_noselect.txt \ + @/tmp/pytest_args_parallel_noselect.txt \ --junitxml=pytest.xdist.junit.xml \ --json-report \ --json-report-file="${OUT_JSON}" \ @/tmp/remaining_tests_clean.txt || true - + else echo "No remaining test cases to run. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" fi + - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From eabcb2542ceb1f06b7976d3dcba2a091f5b4cd0a Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 23:25:37 -0500 Subject: [PATCH 41/79] debug --- .github/workflows/macos.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9543f44a54b..4260730b8eb 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -414,7 +414,7 @@ jobs: if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining pytest test cases (excluding testsuite)..." - # Clean CRLF + remove blank lines + drop testsuite just in case + # Clean CRLF + remove blank lines + drop testsuite tr -d '\r' < "${REMAINING_TESTS_FILE}" \ | sed '/^[[:space:]]*$/d' \ | grep -v 'testsuite' > /tmp/remaining_tests_clean.txt || true @@ -423,14 +423,21 @@ jobs: echo "First 5:" head -n 5 /tmp/remaining_tests_clean.txt || true - # Remove selection filters when running explicit node IDs - # (otherwise pytest can deselect everything and you get 0 items) - grep -vE '^-m(\s|$)|^-k(\s|$)' .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_noselect.txt - grep -vE '^-m(\s|$)|^-k(\s|$)' .github/workflows/pytest_args_parallel.txt > /tmp/pytest_args_parallel_noselect.txt + echo "=== Sanity: do these nodeids collect WITHOUT any CI args? ===" + pytest --collect-only -q @/tmp/remaining_tests_clean.txt || true + # Remove filters that can cause 0 collection when explicit nodeids are used + # (markers/keywords + ignore rules) + grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=)' \ + .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_clean.txt + + grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=)' \ + .github/workflows/pytest_args_parallel.txt > /tmp/pytest_args_parallel_clean.txt + + echo "=== Running with cleaned args + explicit nodeids ===" pytest \ - @/tmp/pytest_args_ci_noselect.txt \ - @/tmp/pytest_args_parallel_noselect.txt \ + @/tmp/pytest_args_ci_clean.txt \ + @/tmp/pytest_args_parallel_clean.txt \ --junitxml=pytest.xdist.junit.xml \ --json-report \ --json-report-file="${OUT_JSON}" \ @@ -443,6 +450,7 @@ jobs: + - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From c54ed96ee516bc1d6259ee52d166d79f054829a1 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 23:38:10 -0500 Subject: [PATCH 42/79] check path --- .github/workflows/macos.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4260730b8eb..4cd88589ec9 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -423,6 +423,11 @@ jobs: echo "First 5:" head -n 5 /tmp/remaining_tests_clean.txt || true + echo "Check whether first file exists:" + first_path="$(head -n 1 /tmp/remaining_tests_clean.txt | cut -d':' -f1)" + echo "first_path=$first_path" + ls -la "$first_path" || true + echo "=== Sanity: do these nodeids collect WITHOUT any CI args? ===" pytest --collect-only -q @/tmp/remaining_tests_clean.txt || true From 7b2e3366f8bc20ed0f9047459c426e633f5093d4 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 20 Dec 2025 23:50:14 -0500 Subject: [PATCH 43/79] debug --- .github/workflows/macos.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4cd88589ec9..b9018c6fde1 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -414,32 +414,30 @@ jobs: if [[ -s "${REMAINING_TESTS_FILE}" ]]; then echo "Running remaining pytest test cases (excluding testsuite)..." - # Clean CRLF + remove blank lines + drop testsuite + # Keep ONLY valid pytest nodeids (protect against log/junk lines) tr -d '\r' < "${REMAINING_TESTS_FILE}" \ | sed '/^[[:space:]]*$/d' \ - | grep -v 'testsuite' > /tmp/remaining_tests_clean.txt || true + | grep -v 'testsuite' \ + | grep -E '\.py::' \ + > /tmp/remaining_tests_clean.txt echo "Remaining tests count: $(wc -l < /tmp/remaining_tests_clean.txt)" echo "First 5:" head -n 5 /tmp/remaining_tests_clean.txt || true - echo "Check whether first file exists:" - first_path="$(head -n 1 /tmp/remaining_tests_clean.txt | cut -d':' -f1)" - echo "first_path=$first_path" - ls -la "$first_path" || true + echo "Suspicious lines (should be empty):" + grep -n -v '::' /tmp/remaining_tests_clean.txt || true - echo "=== Sanity: do these nodeids collect WITHOUT any CI args? ===" - pytest --collect-only -q @/tmp/remaining_tests_clean.txt || true - - # Remove filters that can cause 0 collection when explicit nodeids are used - # (markers/keywords + ignore rules) + # Remove selection + ignore filters when using explicit nodeids grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=)' \ .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_clean.txt grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=)' \ .github/workflows/pytest_args_parallel.txt > /tmp/pytest_args_parallel_clean.txt - echo "=== Running with cleaned args + explicit nodeids ===" + # Sanity collect + pytest --collect-only -q @/tmp/remaining_tests_clean.txt || true + pytest \ @/tmp/pytest_args_ci_clean.txt \ @/tmp/pytest_args_parallel_clean.txt \ @@ -447,7 +445,6 @@ jobs: --json-report \ --json-report-file="${OUT_JSON}" \ @/tmp/remaining_tests_clean.txt || true - else echo "No remaining test cases to run. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" @@ -456,6 +453,7 @@ jobs: + - name: Extract failed and passed tests (parallel macOS) shell: micromamba-shell {0} run: | From a59697b70ef162b4728d22ae609fdd2465e68bfe Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 21 Dec 2025 11:50:34 -0500 Subject: [PATCH 44/79] test_flow --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b9018c6fde1..a3e81e6835e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -282,7 +282,7 @@ jobs: echo "Some tests failed again. Stopping execution." echo "Tests failing again:" cat "${FAILED_AGAIN_FILE}" - # exit 1 + exit 1 else echo "No tests failed again. Continuing with remaining tests..." fi From 414363cfb7216684c8e3a295bc1ae2f67869ee34 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 21 Dec 2025 14:00:09 -0500 Subject: [PATCH 45/79] check passing failed testcases --- general/g.version/tests/g_version_test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/general/g.version/tests/g_version_test.py b/general/g.version/tests/g_version_test.py index 3206669c7ea..2dd9c3106c0 100644 --- a/general/g.version/tests/g_version_test.py +++ b/general/g.version/tests/g_version_test.py @@ -8,8 +8,6 @@ "build_platform", "build_off_t_size", ] -def test_priotestci_force_fail(): - assert False, "Intentional failure to test PrioTestCI artifacts" def curly_brackets_paired(text): """Check whether all curly brackets in the given text are properly paired.""" From cd9fdd73fff1212fea9c28f3ad3e89cbbde96bea Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 21 Dec 2025 14:27:16 -0500 Subject: [PATCH 46/79] modify previously failed testcases --- .github/workflows/macos.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a3e81e6835e..e4b3d17d47f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -250,17 +250,27 @@ jobs: echo "Re-running previously failed tests first:" cat "${FAILED_TESTS_FILE}" + # Clean CRLF + blank lines + keep only real nodeids (prevents junk lines like "786/3259 ...") + tr -d '\r' < "${FAILED_TESTS_FILE}" \ + | sed '/^[[:space:]]*$/d' \ + | grep -E '\.py::' > /tmp/failed_tests_clean.txt || true + + # Strip marker/keyword filters for explicit-nodeid run (avoid 0 items) + grep -vE '(^-m(\s|$)|^-k(\s|$))' .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_noselect.txt + grep -vE '(^-m(\s|$)|^-k(\s|$))' .github/workflows/pytest_args_parallel.txt > /tmp/pytest_args_parallel_noselect.txt + pytest \ - @.github/workflows/pytest_args_ci.txt \ - @.github/workflows/pytest_args_parallel.txt \ + @/tmp/pytest_args_ci_noselect.txt \ + @/tmp/pytest_args_parallel_noselect.txt \ --json-report --json-report-file="${TEMP_RESULTS}" \ - $(cat "${FAILED_TESTS_FILE}") || true + @/tmp/failed_tests_clean.txt || true else echo "No previously failed tests found." # create empty JSON file so next steps never break echo '{"tests": []}' > "${TEMP_RESULTS}" fi + - name: Check if any tests failed again (macOS) shell: micromamba-shell {0} run: | From 9b31114875ac7e5e8540017fc4c7267f398a1fc5 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 21 Dec 2025 14:28:10 -0500 Subject: [PATCH 47/79] fail purpose --- general/g.version/tests/g_version_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/general/g.version/tests/g_version_test.py b/general/g.version/tests/g_version_test.py index 2dd9c3106c0..3206669c7ea 100644 --- a/general/g.version/tests/g_version_test.py +++ b/general/g.version/tests/g_version_test.py @@ -8,6 +8,8 @@ "build_platform", "build_off_t_size", ] +def test_priotestci_force_fail(): + assert False, "Intentional failure to test PrioTestCI artifacts" def curly_brackets_paired(text): """Check whether all curly brackets in the given text are properly paired.""" From 5c53980d385aa6c49158431bda09540c281886e2 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 21 Dec 2025 17:00:30 -0500 Subject: [PATCH 48/79] pass --- general/g.version/tests/g_version_test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/general/g.version/tests/g_version_test.py b/general/g.version/tests/g_version_test.py index 3206669c7ea..2dd9c3106c0 100644 --- a/general/g.version/tests/g_version_test.py +++ b/general/g.version/tests/g_version_test.py @@ -8,8 +8,6 @@ "build_platform", "build_off_t_size", ] -def test_priotestci_force_fail(): - assert False, "Intentional failure to test PrioTestCI artifacts" def curly_brackets_paired(text): """Check whether all curly brackets in the given text are properly paired.""" From 7ca9d9f079188c96934b513ba5670cc624bb9ba2 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 21 Dec 2025 19:19:47 -0500 Subject: [PATCH 49/79] test --- .github/workflows/macos.yml | 17 ++++++++++------- general/g.version/tests/g_version_test.py | 2 ++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e4b3d17d47f..f72a9598638 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -250,27 +250,30 @@ jobs: echo "Re-running previously failed tests first:" cat "${FAILED_TESTS_FILE}" - # Clean CRLF + blank lines + keep only real nodeids (prevents junk lines like "786/3259 ...") + # Clean CRLF + blank lines + keep only real nodeids tr -d '\r' < "${FAILED_TESTS_FILE}" \ | sed '/^[[:space:]]*$/d' \ | grep -E '\.py::' > /tmp/failed_tests_clean.txt || true - # Strip marker/keyword filters for explicit-nodeid run (avoid 0 items) - grep -vE '(^-m(\s|$)|^-k(\s|$))' .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_noselect.txt - grep -vE '(^-m(\s|$)|^-k(\s|$))' .github/workflows/pytest_args_parallel.txt > /tmp/pytest_args_parallel_noselect.txt + echo "Cleaned failed tests count: $(wc -l < /tmp/failed_tests_clean.txt)" + echo "First 5 cleaned:" + head -n 5 /tmp/failed_tests_clean.txt || true + + # Use ONLY CI args, and remove selection + xdist options for this rerun + grep -vE '(^-m(\s|$)|^-k(\s|$)|^-n(\s|$)|^--dist(\s|$))' \ + .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_rerun.txt pytest \ - @/tmp/pytest_args_ci_noselect.txt \ - @/tmp/pytest_args_parallel_noselect.txt \ + @/tmp/pytest_args_ci_rerun.txt \ --json-report --json-report-file="${TEMP_RESULTS}" \ @/tmp/failed_tests_clean.txt || true else echo "No previously failed tests found." - # create empty JSON file so next steps never break echo '{"tests": []}' > "${TEMP_RESULTS}" fi + - name: Check if any tests failed again (macOS) shell: micromamba-shell {0} run: | diff --git a/general/g.version/tests/g_version_test.py b/general/g.version/tests/g_version_test.py index 2dd9c3106c0..3206669c7ea 100644 --- a/general/g.version/tests/g_version_test.py +++ b/general/g.version/tests/g_version_test.py @@ -8,6 +8,8 @@ "build_platform", "build_off_t_size", ] +def test_priotestci_force_fail(): + assert False, "Intentional failure to test PrioTestCI artifacts" def curly_brackets_paired(text): """Check whether all curly brackets in the given text are properly paired.""" From f7670beb0e1f9cd14942403cd79cd5c468e0f900 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 21 Dec 2025 20:21:30 -0500 Subject: [PATCH 50/79] empty commit for early fail From 12b43f1e26519f8e32e71d2ef3505d03fead8d74 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 21 Dec 2025 20:33:16 -0500 Subject: [PATCH 51/79] fix failed testcase --- general/g.version/tests/g_version_test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/general/g.version/tests/g_version_test.py b/general/g.version/tests/g_version_test.py index 3206669c7ea..cc8912bdd82 100644 --- a/general/g.version/tests/g_version_test.py +++ b/general/g.version/tests/g_version_test.py @@ -8,8 +8,7 @@ "build_platform", "build_off_t_size", ] -def test_priotestci_force_fail(): - assert False, "Intentional failure to test PrioTestCI artifacts" + def curly_brackets_paired(text): """Check whether all curly brackets in the given text are properly paired.""" From ff429fe53de0d05ce40e7f0b8f652f94f1b01d05 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 11 Jan 2026 18:37:13 -0500 Subject: [PATCH 52/79] solo run --- .github/workflows/macos.yml | 257 +++++++++++++++++++++++++++++++++++- 1 file changed, 251 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f72a9598638..4bb072ed243 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -504,18 +504,263 @@ jobs: retention-days: 7 - - name: Run pytest with a single worker (for tests marked with needs_solo_run) + # - name: Run pytest with a single worker (for tests marked with needs_solo_run) + # shell: micromamba-shell {0} + # run: | + # PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + # LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + # export PYTHONPATH + # export LD_LIBRARY_PATH + # pytest \ + # @.github/workflows/pytest_args_ci.txt \ + # @.github/workflows/pytest_args_not_parallel.txt \ + # --junitxml=pytest.needs_solo_run.junit.xml \ + # -k 'not testsuite' + + - name: Check If Previous macOS Solo Artifacts Exist + shell: micromamba-shell {0} + run: | + echo "Checking previous SOLO artifacts for PR-${PR_ID}..." + + ARTIFACTS_RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${{ github.repository }}/actions/artifacts") + + SOLO_COUNT=$(echo "$ARTIFACTS_RESPONSE" \ + | jq -r --arg NAME "pr_${PR_ID}_macos_solo_results" \ + '[.artifacts[] | select(.name==$NAME and .expired==false)] | length') + + echo "Found ${SOLO_COUNT} matching SOLO artifact(s)." + + if [[ "$SOLO_COUNT" -gt 0 ]]; then + echo "PREV_SOLO_EXISTS=true" >> "$GITHUB_ENV" + else + echo "PREV_SOLO_EXISTS=false" >> "$GITHUB_ENV" + fi + + - name: Retrieve Previous macOS Solo Artifacts + if: env.PREV_SOLO_EXISTS == 'true' + shell: micromamba-shell {0} + run: | + echo "Retrieving previous macOS SOLO results for PR-${PR_ID}..." + + ARTIFACT_URL=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${{ github.repository }}/actions/artifacts" \ + | jq -r --arg NAME "pr_${PR_ID}_macos_solo_results" \ + '[.artifacts[] | select(.name==$NAME)] | sort_by(.created_at) | reverse | .[0].archive_download_url') + + if [[ -z "$ARTIFACT_URL" || "$ARTIFACT_URL" == "null" ]]; then + echo "SOLO artifact URL not found." + exit 0 + fi + + mkdir -p artifacts/pr_${PR_ID}/macos_solo_prev + curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -o artifacts/pr_${PR_ID}/macos_solo_prev/results.zip "$ARTIFACT_URL" + + unzip -o artifacts/pr_${PR_ID}/macos_solo_prev/results.zip -d artifacts/pr_${PR_ID}/macos_solo_prev + + echo "===== Previous macOS SOLO test results =====" + ls -la artifacts/pr_${PR_ID}/macos_solo_prev || true + cat artifacts/pr_${PR_ID}/macos_solo_prev/failed_tests.txt || echo "No previous solo failed_tests.txt" + echo "===========================================" + + - name: Run previously failed SOLO tests first (macOS needs_solo_run) shell: micromamba-shell {0} run: | PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - export PYTHONPATH - export LD_LIBRARY_PATH + export PYTHONPATH LD_LIBRARY_PATH + + PR_DIR="pr_${PR_ID}" + PREV_DIR="artifacts/${PR_DIR}/macos_solo_prev" + CURR_DIR="artifacts/${PR_DIR}/macos_solo" + mkdir -p "${CURR_DIR}" + + FAILED_TESTS_FILE="${PREV_DIR}/failed_tests.txt" + TEMP_RESULTS="${CURR_DIR}/temp_test_results.json" + + if [[ -s "${FAILED_TESTS_FILE}" ]]; then + echo "Re-running previously failed SOLO tests first:" + cat "${FAILED_TESTS_FILE}" + + tr -d '\r' < "${FAILED_TESTS_FILE}" \ + | sed '/^[[:space:]]*$/d' \ + | grep -E '\.py::' > /tmp/solo_failed_clean.txt || true + + echo "Cleaned solo-failed count: $(wc -l < /tmp/solo_failed_clean.txt)" + head -n 5 /tmp/solo_failed_clean.txt || true + + # When using explicit nodeids, remove selection/filters that can conflict. + # Keep the core CI args, and also keep "not parallel" args if they contain timeouts etc, + # but remove -m/-k/ignore type args (same as you did for parallel). + grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=|^-n(\s|$)|^--dist(\s|$))' \ + .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_solo_rerun.txt + + grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=|^-n(\s|$)|^--dist(\s|$))' \ + .github/workflows/pytest_args_not_parallel.txt > /tmp/pytest_args_not_parallel_clean.txt + + pytest \ + @/tmp/pytest_args_ci_solo_rerun.txt \ + @/tmp/pytest_args_not_parallel_clean.txt \ + --json-report --json-report-file="${TEMP_RESULTS}" \ + @/tmp/solo_failed_clean.txt || true + else + echo "No previously failed SOLO tests found." + echo '{"tests": []}' > "${TEMP_RESULTS}" + fi + + - name: Check if any SOLO tests failed again (macOS needs_solo_run) + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos_solo" + TEMP_RESULTS="${CURR_DIR}/temp_test_results.json" + FAILED_AGAIN_FILE="${CURR_DIR}/failed_again.txt" + + if [[ -f "${TEMP_RESULTS}" ]]; then + jq -r '.tests | map(select(.outcome == "failed")) | .[].nodeid' \ + "${TEMP_RESULTS}" > "${FAILED_AGAIN_FILE}" || true + else + : > "${FAILED_AGAIN_FILE}" + fi + + if [[ -s "${FAILED_AGAIN_FILE}" ]]; then + echo "Some SOLO tests failed again. Stopping execution." + cat "${FAILED_AGAIN_FILE}" + exit 1 + else + echo "No SOLO tests failed again. Continuing..." + fi + + - name: Collect SOLO test cases (nodeids) (macOS needs_solo_run) + shell: micromamba-shell {0} + run: | + PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + export PYTHONPATH LD_LIBRARY_PATH + + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos_solo" + mkdir -p "${CURR_DIR}" + + ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt" + + # Collect with the same bucket definition (not-parallel args), but keep output clean: + # Remove verbose/collection-noise options if they exist; we only want nodeids. + grep -vE '(^--maxfail=|^--durations=|^--durations-min=|^--capture=|^-r(\s|$))' \ + .github/workflows/pytest_args_not_parallel.txt > /tmp/pytest_args_not_parallel_collect.txt + pytest \ @.github/workflows/pytest_args_ci.txt \ - @.github/workflows/pytest_args_not_parallel.txt \ - --junitxml=pytest.needs_solo_run.junit.xml \ - -k 'not testsuite' + @/tmp/pytest_args_not_parallel_collect.txt \ + --collect-only -q \ + -k 'not testsuite' 2>/dev/null \ + > "${ALL_TESTS_FILE}" || true + + echo "SOLO all_tests count: $(wc -l < "${ALL_TESTS_FILE}")" + head -n 10 "${ALL_TESTS_FILE}" || true + + - name: Identify remaining SOLO tests to run (macOS needs_solo_run) + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + PREV_DIR="artifacts/${PR_DIR}/macos_solo_prev" + CURR_DIR="artifacts/${PR_DIR}/macos_solo" + + ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt" + FAILED_PREV="${PREV_DIR}/failed_tests.txt" + REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" + + if [[ -s "${FAILED_PREV}" ]]; then + tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' | grep -E '\.py::' > /tmp/solo_failed_prev_clean.txt || true + grep -v -F -f /tmp/solo_failed_prev_clean.txt "${ALL_TESTS_FILE}" > "${REMAINING_TESTS_FILE}" || true + if [[ ! -s "${REMAINING_TESTS_FILE}" ]]; then + echo "Remaining SOLO became empty after filtering; falling back to ALL solo tests." + cp "${ALL_TESTS_FILE}" "${REMAINING_TESTS_FILE}" + fi + else + cp "${ALL_TESTS_FILE}" "${REMAINING_TESTS_FILE}" + fi + + echo "SOLO remaining count: $(wc -l < "${REMAINING_TESTS_FILE}")" + head -n 10 "${REMAINING_TESTS_FILE}" || true + + - name: Run pytest SOLO remaining tests (JSON report) (macOS needs_solo_run) + shell: micromamba-shell {0} + run: | + PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + export PYTHONPATH LD_LIBRARY_PATH + + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos_solo" + mkdir -p "${CURR_DIR}" + + OUT_JSON="${CURR_DIR}/test_results.json" + REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" + + if [[ -s "${REMAINING_TESTS_FILE}" ]]; then + tr -d '\r' < "${REMAINING_TESTS_FILE}" \ + | sed '/^[[:space:]]*$/d' \ + | grep -v 'testsuite' \ + | grep -E '\.py::' > /tmp/solo_remaining_clean.txt + + echo "SOLO remaining tests count: $(wc -l < /tmp/solo_remaining_clean.txt)" + head -n 5 /tmp/solo_remaining_clean.txt || true + + # Remove conflicting filters when feeding explicit nodeids + grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=|^-n(\s|$)|^--dist(\s|$))' \ + .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_solo_clean.txt + + grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=)' \ + .github/workflows/pytest_args_not_parallel.txt > /tmp/pytest_args_not_parallel_clean2.txt + + pytest \ + @/tmp/pytest_args_ci_solo_clean.txt \ + @/tmp/pytest_args_not_parallel_clean2.txt \ + --junitxml=pytest.needs_solo_run.junit.xml \ + --json-report --json-report-file="${OUT_JSON}" \ + @/tmp/solo_remaining_clean.txt || true + else + echo "No SOLO remaining test cases to run. Writing empty JSON." + echo '{"tests": []}' > "${OUT_JSON}" + fi + + - name: Extract failed and passed SOLO tests (macOS needs_solo_run) + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + BASE_DIR="artifacts/${PR_DIR}/macos_solo" + RESULTS="${BASE_DIR}/test_results.json" + FAILED="${BASE_DIR}/failed_tests.txt" + PASSED="${BASE_DIR}/passed_tests.txt" + + if [[ -f "${RESULTS}" ]]; then + jq -r '.tests | map(select(.outcome == "failed")) | .[].nodeid' "${RESULTS}" > "${FAILED}" || true + jq -r '.tests | map(select(.outcome == "passed")) | .[].nodeid' "${RESULTS}" > "${PASSED}" || true + else + : > "${FAILED}" + : > "${PASSED}" + fi + + echo "SOLO failed count: $(wc -l < "${FAILED}")" + echo "SOLO passed count: $(wc -l < "${PASSED}")" + + - name: Upload macOS SOLO test artifacts + uses: actions/upload-artifact@v4 + with: + name: pr_${{ env.PR_ID }}_macos_solo_results + path: | + artifacts/pr_${{ env.PR_ID }}/macos_solo/all_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_solo/remaining_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_solo/failed_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_solo/passed_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_solo/test_results.json + retention-days: 7 + + - name: Run pytest with a single worker (for gunittest-based tests) shell: micromamba-shell {0} run: | From 61470dbc36d1995f905e5742bbda5c8533fca627 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Fri, 16 Jan 2026 19:12:37 -0500 Subject: [PATCH 53/79] gunittest run --- .github/workflows/macos.yml | 233 ++++++++++++++++-------------------- 1 file changed, 104 insertions(+), 129 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4bb072ed243..6a43fda9d87 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -504,69 +504,78 @@ jobs: retention-days: 7 - # - name: Run pytest with a single worker (for tests marked with needs_solo_run) - # shell: micromamba-shell {0} - # run: | - # PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" - # LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - # export PYTHONPATH - # export LD_LIBRARY_PATH - # pytest \ - # @.github/workflows/pytest_args_ci.txt \ - # @.github/workflows/pytest_args_not_parallel.txt \ - # --junitxml=pytest.needs_solo_run.junit.xml \ - # -k 'not testsuite' - - - name: Check If Previous macOS Solo Artifacts Exist + - name: Run pytest with a single worker (for tests marked with needs_solo_run) shell: micromamba-shell {0} run: | - echo "Checking previous SOLO artifacts for PR-${PR_ID}..." + PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + export PYTHONPATH + export LD_LIBRARY_PATH + pytest \ + @.github/workflows/pytest_args_ci.txt \ + @.github/workflows/pytest_args_not_parallel.txt \ + --junitxml=pytest.needs_solo_run.junit.xml \ + -k 'not testsuite' + + + + #- name: Run pytest with a single worker (for gunittest-based tests) + # shell: micromamba-shell {0} + #run: | + # PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" + #LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" + #export PYTHONPATH + #export LD_LIBRARY_PATH + #pytest \ + # @.github/workflows/pytest_args_gunittest.txt \ + #--junitxml=pytest.gunittest.junit.xml + + - name: Check If Previous macOS gunittest Artifacts Exist + shell: micromamba-shell {0} + run: | + echo "Checking previous gunittest artifacts for PR-${PR_ID}..." ARTIFACTS_RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/actions/artifacts") - SOLO_COUNT=$(echo "$ARTIFACTS_RESPONSE" \ - | jq -r --arg NAME "pr_${PR_ID}_macos_solo_results" \ + COUNT=$(echo "$ARTIFACTS_RESPONSE" \ + | jq -r --arg NAME "pr_${PR_ID}_macos_gunittest_results" \ '[.artifacts[] | select(.name==$NAME and .expired==false)] | length') - echo "Found ${SOLO_COUNT} matching SOLO artifact(s)." + echo "Found ${COUNT} matching gunittest artifact(s)." - if [[ "$SOLO_COUNT" -gt 0 ]]; then - echo "PREV_SOLO_EXISTS=true" >> "$GITHUB_ENV" + if [[ "$COUNT" -gt 0 ]]; then + echo "PREV_GUNITTEST_EXISTS=true" >> "$GITHUB_ENV" else - echo "PREV_SOLO_EXISTS=false" >> "$GITHUB_ENV" + echo "PREV_GUNITTEST_EXISTS=false" >> "$GITHUB_ENV" fi - - name: Retrieve Previous macOS Solo Artifacts - if: env.PREV_SOLO_EXISTS == 'true' + - name: Retrieve Previous macOS gunittest Artifacts + if: env.PREV_GUNITTEST_EXISTS == 'true' shell: micromamba-shell {0} run: | - echo "Retrieving previous macOS SOLO results for PR-${PR_ID}..." - ARTIFACT_URL=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/actions/artifacts" \ - | jq -r --arg NAME "pr_${PR_ID}_macos_solo_results" \ + | jq -r --arg NAME "pr_${PR_ID}_macos_gunittest_results" \ '[.artifacts[] | select(.name==$NAME)] | sort_by(.created_at) | reverse | .[0].archive_download_url') if [[ -z "$ARTIFACT_URL" || "$ARTIFACT_URL" == "null" ]]; then - echo "SOLO artifact URL not found." + echo "gunittest artifact URL not found." exit 0 fi - mkdir -p artifacts/pr_${PR_ID}/macos_solo_prev + mkdir -p artifacts/pr_${PR_ID}/macos_gunittest_prev curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - -o artifacts/pr_${PR_ID}/macos_solo_prev/results.zip "$ARTIFACT_URL" + -o artifacts/pr_${PR_ID}/macos_gunittest_prev/results.zip "$ARTIFACT_URL" - unzip -o artifacts/pr_${PR_ID}/macos_solo_prev/results.zip -d artifacts/pr_${PR_ID}/macos_solo_prev + unzip -o artifacts/pr_${PR_ID}/macos_gunittest_prev/results.zip -d artifacts/pr_${PR_ID}/macos_gunittest_prev - echo "===== Previous macOS SOLO test results =====" - ls -la artifacts/pr_${PR_ID}/macos_solo_prev || true - cat artifacts/pr_${PR_ID}/macos_solo_prev/failed_tests.txt || echo "No previous solo failed_tests.txt" - echo "===========================================" + echo "Previous gunittest failed tests:" + cat artifacts/pr_${PR_ID}/macos_gunittest_prev/failed_tests.txt || true - - name: Run previously failed SOLO tests first (macOS needs_solo_run) + - name: Run previously failed gunittest tests first (macOS) shell: micromamba-shell {0} run: | PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" @@ -574,48 +583,42 @@ jobs: export PYTHONPATH LD_LIBRARY_PATH PR_DIR="pr_${PR_ID}" - PREV_DIR="artifacts/${PR_DIR}/macos_solo_prev" - CURR_DIR="artifacts/${PR_DIR}/macos_solo" + PREV_DIR="artifacts/${PR_DIR}/macos_gunittest_prev" + CURR_DIR="artifacts/${PR_DIR}/macos_gunittest" mkdir -p "${CURR_DIR}" FAILED_TESTS_FILE="${PREV_DIR}/failed_tests.txt" TEMP_RESULTS="${CURR_DIR}/temp_test_results.json" if [[ -s "${FAILED_TESTS_FILE}" ]]; then - echo "Re-running previously failed SOLO tests first:" - cat "${FAILED_TESTS_FILE}" - tr -d '\r' < "${FAILED_TESTS_FILE}" \ | sed '/^[[:space:]]*$/d' \ - | grep -E '\.py::' > /tmp/solo_failed_clean.txt || true - - echo "Cleaned solo-failed count: $(wc -l < /tmp/solo_failed_clean.txt)" - head -n 5 /tmp/solo_failed_clean.txt || true + | grep -E '\.py::' > /tmp/gunittest_failed_clean.txt || true - # When using explicit nodeids, remove selection/filters that can conflict. - # Keep the core CI args, and also keep "not parallel" args if they contain timeouts etc, - # but remove -m/-k/ignore type args (same as you did for parallel). - grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=|^-n(\s|$)|^--dist(\s|$))' \ - .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_solo_rerun.txt + if [[ ! -s /tmp/gunittest_failed_clean.txt ]]; then + echo "No valid gunittest nodeids after cleaning." + echo '{"tests": []}' > "${TEMP_RESULTS}" + exit 0 + fi - grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=|^-n(\s|$)|^--dist(\s|$))' \ - .github/workflows/pytest_args_not_parallel.txt > /tmp/pytest_args_not_parallel_clean.txt + # For explicit nodeids, remove ignore filters to avoid accidental deselection + grep -vE '(^--ignore=|^--ignore-glob=|^--norecursedirs=|^-k(\s|$)|^-m(\s|$))' \ + .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_gunittest_rerun.txt pytest \ - @/tmp/pytest_args_ci_solo_rerun.txt \ - @/tmp/pytest_args_not_parallel_clean.txt \ + @/tmp/pytest_args_ci_gunittest_rerun.txt \ --json-report --json-report-file="${TEMP_RESULTS}" \ - @/tmp/solo_failed_clean.txt || true + @/tmp/gunittest_failed_clean.txt || true else - echo "No previously failed SOLO tests found." + echo "No previous gunittest failed tests." echo '{"tests": []}' > "${TEMP_RESULTS}" fi - - name: Check if any SOLO tests failed again (macOS needs_solo_run) + - name: Stop if gunittest failures repeat (macOS) shell: micromamba-shell {0} run: | PR_DIR="pr_${PR_ID}" - CURR_DIR="artifacts/${PR_DIR}/macos_solo" + CURR_DIR="artifacts/${PR_DIR}/macos_gunittest" TEMP_RESULTS="${CURR_DIR}/temp_test_results.json" FAILED_AGAIN_FILE="${CURR_DIR}/failed_again.txt" @@ -627,14 +630,13 @@ jobs: fi if [[ -s "${FAILED_AGAIN_FILE}" ]]; then - echo "Some SOLO tests failed again. Stopping execution." + echo "gunittest tests still failing:" cat "${FAILED_AGAIN_FILE}" exit 1 - else - echo "No SOLO tests failed again. Continuing..." fi - - name: Collect SOLO test cases (nodeids) (macOS needs_solo_run) + + - name: Collect gunittest bucket nodeids (macOS) shell: micromamba-shell {0} run: | PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" @@ -642,52 +644,50 @@ jobs: export PYTHONPATH LD_LIBRARY_PATH PR_DIR="pr_${PR_ID}" - CURR_DIR="artifacts/${PR_DIR}/macos_solo" + CURR_DIR="artifacts/${PR_DIR}/macos_gunittest" mkdir -p "${CURR_DIR}" ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt" - # Collect with the same bucket definition (not-parallel args), but keep output clean: - # Remove verbose/collection-noise options if they exist; we only want nodeids. - grep -vE '(^--maxfail=|^--durations=|^--durations-min=|^--capture=|^-r(\s|$))' \ - .github/workflows/pytest_args_not_parallel.txt > /tmp/pytest_args_not_parallel_collect.txt - pytest \ - @.github/workflows/pytest_args_ci.txt \ - @/tmp/pytest_args_not_parallel_collect.txt \ - --collect-only -q \ - -k 'not testsuite' 2>/dev/null \ + @.github/workflows/pytest_args_gunittest.txt \ + --collect-only -q 2>/dev/null \ > "${ALL_TESTS_FILE}" || true - echo "SOLO all_tests count: $(wc -l < "${ALL_TESTS_FILE}")" + # Keep only nodeids (defensive) + tr -d '\r' < "${ALL_TESTS_FILE}" | grep -E '\.py::' > /tmp/gunittest_all_clean.txt || true + mv /tmp/gunittest_all_clean.txt "${ALL_TESTS_FILE}" + + echo "gunittest all_tests count: $(wc -l < "${ALL_TESTS_FILE}")" head -n 10 "${ALL_TESTS_FILE}" || true - - name: Identify remaining SOLO tests to run (macOS needs_solo_run) + - name: Identify remaining gunittest tests to run (macOS) shell: micromamba-shell {0} run: | PR_DIR="pr_${PR_ID}" - PREV_DIR="artifacts/${PR_DIR}/macos_solo_prev" - CURR_DIR="artifacts/${PR_DIR}/macos_solo" + PREV_DIR="artifacts/${PR_DIR}/macos_gunittest_prev" + CURR_DIR="artifacts/${PR_DIR}/macos_gunittest" ALL_TESTS_FILE="${CURR_DIR}/all_tests.txt" FAILED_PREV="${PREV_DIR}/failed_tests.txt" REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" if [[ -s "${FAILED_PREV}" ]]; then - tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' | grep -E '\.py::' > /tmp/solo_failed_prev_clean.txt || true - grep -v -F -f /tmp/solo_failed_prev_clean.txt "${ALL_TESTS_FILE}" > "${REMAINING_TESTS_FILE}" || true + tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' | grep -E '\.py::' > /tmp/gunittest_failed_prev_clean.txt || true + grep -v -F -f /tmp/gunittest_failed_prev_clean.txt "${ALL_TESTS_FILE}" > "${REMAINING_TESTS_FILE}" || true + if [[ ! -s "${REMAINING_TESTS_FILE}" ]]; then - echo "Remaining SOLO became empty after filtering; falling back to ALL solo tests." + echo "Remaining gunittest empty; fallback to ALL." cp "${ALL_TESTS_FILE}" "${REMAINING_TESTS_FILE}" fi else cp "${ALL_TESTS_FILE}" "${REMAINING_TESTS_FILE}" fi - echo "SOLO remaining count: $(wc -l < "${REMAINING_TESTS_FILE}")" + echo "gunittest remaining count: $(wc -l < "${REMAINING_TESTS_FILE}")" head -n 10 "${REMAINING_TESTS_FILE}" || true - - name: Run pytest SOLO remaining tests (JSON report) (macOS needs_solo_run) + - name: Run gunittest remaining tests (JSON report) (macOS) shell: micromamba-shell {0} run: | PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" @@ -695,44 +695,33 @@ jobs: export PYTHONPATH LD_LIBRARY_PATH PR_DIR="pr_${PR_ID}" - CURR_DIR="artifacts/${PR_DIR}/macos_solo" + CURR_DIR="artifacts/${PR_DIR}/macos_gunittest" mkdir -p "${CURR_DIR}" OUT_JSON="${CURR_DIR}/test_results.json" - REMAINING_TESTS_FILE="${CURR_DIR}/remaining_tests.txt" + REMAINING="${CURR_DIR}/remaining_tests.txt" - if [[ -s "${REMAINING_TESTS_FILE}" ]]; then - tr -d '\r' < "${REMAINING_TESTS_FILE}" \ - | sed '/^[[:space:]]*$/d' \ - | grep -v 'testsuite' \ - | grep -E '\.py::' > /tmp/solo_remaining_clean.txt - - echo "SOLO remaining tests count: $(wc -l < /tmp/solo_remaining_clean.txt)" - head -n 5 /tmp/solo_remaining_clean.txt || true - - # Remove conflicting filters when feeding explicit nodeids - grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=|^-n(\s|$)|^--dist(\s|$))' \ - .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_solo_clean.txt - - grep -vE '(^-m(\s|$)|^-k(\s|$)|^--ignore=|^--ignore-glob=|^--norecursedirs=)' \ - .github/workflows/pytest_args_not_parallel.txt > /tmp/pytest_args_not_parallel_clean2.txt - - pytest \ - @/tmp/pytest_args_ci_solo_clean.txt \ - @/tmp/pytest_args_not_parallel_clean2.txt \ - --junitxml=pytest.needs_solo_run.junit.xml \ - --json-report --json-report-file="${OUT_JSON}" \ - @/tmp/solo_remaining_clean.txt || true - else - echo "No SOLO remaining test cases to run. Writing empty JSON." + if [[ ! -s "${REMAINING}" ]]; then + echo "No remaining gunittest tests. Writing empty JSON." echo '{"tests": []}' > "${OUT_JSON}" + exit 0 fi - - name: Extract failed and passed SOLO tests (macOS needs_solo_run) + # When feeding explicit nodeids, remove ignore filters from args file + grep -vE '(^--ignore=|^--ignore-glob=|^--norecursedirs=|^-k(\s|$)|^-m(\s|$))' \ + .github/workflows/pytest_args_ci.txt > /tmp/pytest_args_ci_gunittest_clean.txt + + pytest \ + @/tmp/pytest_args_ci_gunittest_clean.txt \ + --junitxml=pytest.gunittest.junit.xml \ + --json-report --json-report-file="${OUT_JSON}" \ + @"${REMAINING}" || true + + - name: Extract failed and passed tests (gunittest macOS) shell: micromamba-shell {0} run: | PR_DIR="pr_${PR_ID}" - BASE_DIR="artifacts/${PR_DIR}/macos_solo" + BASE_DIR="artifacts/${PR_DIR}/macos_gunittest" RESULTS="${BASE_DIR}/test_results.json" FAILED="${BASE_DIR}/failed_tests.txt" PASSED="${BASE_DIR}/passed_tests.txt" @@ -745,32 +734,18 @@ jobs: : > "${PASSED}" fi - echo "SOLO failed count: $(wc -l < "${FAILED}")" - echo "SOLO passed count: $(wc -l < "${PASSED}")" - - - name: Upload macOS SOLO test artifacts + - name: Upload macOS gunittest test artifacts uses: actions/upload-artifact@v4 with: - name: pr_${{ env.PR_ID }}_macos_solo_results + name: pr_${{ env.PR_ID }}_macos_gunittest_results path: | - artifacts/pr_${{ env.PR_ID }}/macos_solo/all_tests.txt - artifacts/pr_${{ env.PR_ID }}/macos_solo/remaining_tests.txt - artifacts/pr_${{ env.PR_ID }}/macos_solo/failed_tests.txt - artifacts/pr_${{ env.PR_ID }}/macos_solo/passed_tests.txt - artifacts/pr_${{ env.PR_ID }}/macos_solo/test_results.json + artifacts/pr_${{ env.PR_ID }}/macos_gunittest/all_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_gunittest/remaining_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_gunittest/failed_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_gunittest/passed_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_gunittest/test_results.json retention-days: 7 - - - name: Run pytest with a single worker (for gunittest-based tests) - shell: micromamba-shell {0} - run: | - PYTHONPATH="$(grass --config python_path):${PYTHONPATH}" - LD_LIBRARY_PATH="$(grass --config path)/lib:${LD_LIBRARY_PATH}" - export PYTHONPATH - export LD_LIBRARY_PATH - pytest \ - @.github/workflows/pytest_args_gunittest.txt \ - --junitxml=pytest.gunittest.junit.xml - name: Upload test results to Codecov if: ${{ !cancelled() }} From 694acb660c30d6ef25885d2f914ec18d442c7760 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 25 Jan 2026 18:54:54 -0500 Subject: [PATCH 54/79] adding fail testcase --- lib/vector/Vlib/testsuite/test_vlib_box.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/vector/Vlib/testsuite/test_vlib_box.py b/lib/vector/Vlib/testsuite/test_vlib_box.py index 71166d4fd29..3e5adbd76c0 100644 --- a/lib/vector/Vlib/testsuite/test_vlib_box.py +++ b/lib/vector/Vlib/testsuite/test_vlib_box.py @@ -89,6 +89,10 @@ def check_point_out_2d(self, x, y): msg="Point should be outside the bbox", ) + def test_intentional_failure(self): + """Intentional failure to validate CI stop-on-failure logic.""" + self.assertTrue(False, msg="Intentional failure (should stop pipeline)") + if __name__ == "__main__": test() From e945338f71061987fcc376f90430e3e8b7e6efed Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 25 Jan 2026 19:53:33 -0500 Subject: [PATCH 55/79] recheck failure if fails again From fcef301a47eedd4583d9c08df5a1b432a7b382d9 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 25 Jan 2026 20:43:02 -0500 Subject: [PATCH 56/79] remove failed one --- lib/vector/Vlib/testsuite/test_vlib_box.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/vector/Vlib/testsuite/test_vlib_box.py b/lib/vector/Vlib/testsuite/test_vlib_box.py index 3e5adbd76c0..ee0e53b5385 100644 --- a/lib/vector/Vlib/testsuite/test_vlib_box.py +++ b/lib/vector/Vlib/testsuite/test_vlib_box.py @@ -89,10 +89,5 @@ def check_point_out_2d(self, x, y): msg="Point should be outside the bbox", ) - def test_intentional_failure(self): - """Intentional failure to validate CI stop-on-failure logic.""" - self.assertTrue(False, msg="Intentional failure (should stop pipeline)") - - if __name__ == "__main__": test() From e54905478cd8f68a90b89363e959f3a6611e9a47 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 1 Feb 2026 16:36:34 -0500 Subject: [PATCH 57/79] run gunittest --- .github/workflows/macos.yml | 210 +++++++++++++++++++++++++++++++++++- 1 file changed, 206 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 6a43fda9d87..d10bebe3af6 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -779,12 +779,214 @@ jobs: path: sample-data/nc_spm_full_v2alpha2.tar.gz key: nc_spm_full_v2alpha2.tar.gz - - name: Run gunittest tests + #- name: Run gunittest tests + # shell: micromamba-shell {0} + #run: .github/workflows/test_thorough.sh --config .github/workflows/macos_gunittest.cfg + #env: + # SAMPLE_DATA_URL: "file://${{ github.workspace }}/sample-data/\ + # nc_spm_full_v2alpha2.tar.gz" + + - name: Check If Previous macOS gunittest thorough Artifacts Exist shell: micromamba-shell {0} - run: .github/workflows/test_thorough.sh --config .github/workflows/macos_gunittest.cfg + run: | + echo "Checking previous gunittest thorough artifacts for PR-${PR_ID}..." + + ARTIFACTS_RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${{ github.repository }}/actions/artifacts") + + COUNT=$(echo "$ARTIFACTS_RESPONSE" \ + | jq -r --arg NAME "pr_${PR_ID}_macos_gunittest_thorough_results" \ + '[.artifacts[] | select(.name==$NAME and .expired==false)] | length') + + echo "Found ${COUNT} matching gunittest thorough artifact(s)." + + if [[ "$COUNT" -gt 0 ]]; then + echo "PREV_GUNITTEST_THOROUGH_EXISTS=true" >> "$GITHUB_ENV" + else + echo "PREV_GUNITTEST_THOROUGH_EXISTS=false" >> "$GITHUB_ENV" + fi + + - name: Retrieve Previous macOS gunittest thorough Artifacts + if: env.PREV_GUNITTEST_THOROUGH_EXISTS == 'true' + shell: micromamba-shell {0} + run: | + ARTIFACT_URL=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${{ github.repository }}/actions/artifacts" \ + | jq -r --arg NAME "pr_${PR_ID}_macos_gunittest_thorough_results" \ + '[.artifacts[] | select(.name==$NAME)] | sort_by(.created_at) | reverse | .[0].archive_download_url') + + if [[ -z "$ARTIFACT_URL" || "$ARTIFACT_URL" == "null" ]]; then + echo "gunittest thorough artifact URL not found." + exit 0 + fi + + mkdir -p artifacts/pr_${PR_ID}/macos_gunittest_thorough_prev + curl -L -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -o artifacts/pr_${PR_ID}/macos_gunittest_thorough_prev/results.zip "$ARTIFACT_URL" + + unzip -o artifacts/pr_${PR_ID}/macos_gunittest_thorough_prev/results.zip -d artifacts/pr_${PR_ID}/macos_gunittest_thorough_prev + + echo "Previous gunittest thorough failed files:" + cat artifacts/pr_${PR_ID}/macos_gunittest_thorough_prev/failed_tests.txt || true + + - name: Run previously failed gunittest thorough tests first (STOP if repeat) + if: env.PREV_GUNITTEST_THOROUGH_EXISTS == 'true' + shell: micromamba-shell {0} + run: | + set -e + + PR_DIR="pr_${PR_ID}" + PREV_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough_prev" + CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" + mkdir -p "${CURR_DIR}" + + FAILED_FILE="${PREV_DIR}/failed_tests.txt" + RERUN_LIST="/tmp/gunittest_thorough_failed_clean.txt" + + if [[ ! -s "${FAILED_FILE}" ]]; then + echo "No previous gunittest thorough failed list." + exit 0 + fi + + # Clean (CRLF, blanks). Keep repo-relative paths only. + tr -d '\r' < "${FAILED_FILE}" | sed '/^[[:space:]]*$/d' > "${RERUN_LIST}" || true + + if [[ ! -s "${RERUN_LIST}" ]]; then + echo "Failed list became empty after cleaning." + exit 0 + fi + + echo "Re-running previously failed gunittest thorough files first:" + head -n 50 "${RERUN_LIST}" || true + + # Put output in a separate folder + OUTDIR="${CURR_DIR}/rerun_prev" + mkdir -p "${OUTDIR}" + + # IMPORTANT: do NOT swallow failure; we want STOP-ON-REPEAT + .github/workflows/test_thorough.sh \ + --config .github/workflows/macos_gunittest.cfg \ + --output "${OUTDIR}" \ + $(cat "${RERUN_LIST}") env: - SAMPLE_DATA_URL: "file://${{ github.workspace }}/sample-data/\ - nc_spm_full_v2alpha2.tar.gz" + SAMPLE_DATA_URL: "file://${{ github.workspace }}/sample-data/nc_spm_full_v2alpha2.tar.gz" + + - name: Collect all gunittest thorough test files (repo scan) + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" + mkdir -p "${CURR_DIR}" + + ALL_FILE="${CURR_DIR}/all_tests.txt" + + # Repo-relative testsuite files (py + sh) + find . -type f \ + \( -path "*/testsuite/*.py" -o -path "*/testsuite/*.sh" \) \ + | sed 's|^\./||' \ + | sort > "${ALL_FILE}" + + echo "All gunittest thorough files: $(wc -l < "${ALL_FILE}")" + head -n 20 "${ALL_FILE}" || true + + - name: Identify remaining gunittest thorough tests to run + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" + PREV_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough_prev" + + ALL="${CURR_DIR}/all_tests.txt" + REM="${CURR_DIR}/remaining_tests.txt" + FAILED_PREV="${PREV_DIR}/failed_tests.txt" + + if [[ -s "${FAILED_PREV}" ]]; then + tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' > /tmp/failed_prev_clean.txt || true + grep -v -F -f /tmp/failed_prev_clean.txt "${ALL}" > "${REM}" || true + if [[ ! -s "${REM}" ]]; then + echo "Remaining empty; fallback to ALL." + cp "${ALL}" "${REM}" + fi + else + cp "${ALL}" "${REM}" + fi + + echo "Remaining gunittest thorough files: $(wc -l < "${REM}")" + head -n 20 "${REM}" || true + + - name: Run gunittest thorough remaining tests + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" + OUTDIR="${CURR_DIR}/full_run" + mkdir -p "${OUTDIR}" + + REM="${CURR_DIR}/remaining_tests.txt" + if [[ ! -s "${REM}" ]]; then + echo "No remaining tests; skipping." + exit 0 + fi + + .github/workflows/test_thorough.sh \ + --config .github/workflows/macos_gunittest.cfg \ + --output "${OUTDIR}" \ + $(cat "${REM}") + env: + SAMPLE_DATA_URL: "file://${{ github.workspace }}/sample-data/nc_spm_full_v2alpha2.tar.gz" + + - name: Extract failed/passed gunittest thorough files + if: always() + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" + OUTDIR="${CURR_DIR}/full_run" + + FAILED="${CURR_DIR}/failed_tests.txt" + PASSED="${CURR_DIR}/passed_tests.txt" + : > "${FAILED}" + : > "${PASSED}" + + # Parse keyvalue results + while IFS= read -r kv; do + status="$(grep -E '^status=' "$kv" | head -n 1 | cut -d= -f2- || true)" + name="$(grep -E '^name=' "$kv" | head -n 1 | cut -d= -f2- || true)" + # 'name' is often module name; we want file path when available: + # invoker keyval also has 'file=' in some setups; try that first. + file="$(grep -E '^file=' "$kv" | head -n 1 | cut -d= -f2- || true)" + target="${file:-$name}" + + [[ -z "${target}" || -z "${status}" ]] && continue + + if [[ "$status" == "failed" ]]; then + echo "${target}" >> "${FAILED}" + elif [[ "$status" == "passed" ]]; then + echo "${target}" >> "${PASSED}" + fi + done < <(find "${OUTDIR}" -type f -name "test_keyvalue_result.txt" 2>/dev/null || true) + + sort -u -o "${FAILED}" "${FAILED}" || true + sort -u -o "${PASSED}" "${PASSED}" || true + + echo "Failed thorough count: $(wc -l < "${FAILED}" || echo 0)" + echo "Passed thorough count: $(wc -l < "${PASSED}" || echo 0)" + head -n 30 "${FAILED}" || true + + - name: Upload macOS gunittest thorough artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: pr_${{ env.PR_ID }}_macos_gunittest_thorough_results + path: | + artifacts/pr_${{ env.PR_ID }}/macos_gunittest_thorough/all_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_gunittest_thorough/remaining_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_gunittest_thorough/failed_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_gunittest_thorough/passed_tests.txt + artifacts/pr_${{ env.PR_ID }}/macos_gunittest_thorough/full_run + retention-days: 7 - name: Make HTML test report available if: ${{ !cancelled() }} From fd968bc45f90a582d1b48be72bd12f4135257f14 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 7 Feb 2026 20:24:04 -0500 Subject: [PATCH 58/79] fixing positional arguments --- .github/workflows/macos.yml | 60 +++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d10bebe3af6..6abac191c97 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -831,48 +831,41 @@ jobs: echo "Previous gunittest thorough failed files:" cat artifacts/pr_${PR_ID}/macos_gunittest_thorough_prev/failed_tests.txt || true + - name: Run previously failed gunittest thorough tests first (STOP if repeat) if: env.PREV_GUNITTEST_THOROUGH_EXISTS == 'true' shell: micromamba-shell {0} run: | set -e - PR_DIR="pr_${PR_ID}" PREV_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough_prev" CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" mkdir -p "${CURR_DIR}" - FAILED_FILE="${PREV_DIR}/failed_tests.txt" - RERUN_LIST="/tmp/gunittest_thorough_failed_clean.txt" - - if [[ ! -s "${FAILED_FILE}" ]]; then - echo "No previous gunittest thorough failed list." - exit 0 - fi + ALL="${CURR_DIR}/all_tests.txt" + FAILED_PREV="${PREV_DIR}/failed_tests.txt" - # Clean (CRLF, blanks). Keep repo-relative paths only. - tr -d '\r' < "${FAILED_FILE}" | sed '/^[[:space:]]*$/d' > "${RERUN_LIST}" || true + # Clean + sort inputs for comm + tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' | sort -u > /tmp/failed_prev_clean.txt || true + sort -u "${ALL}" > /tmp/all_sorted.txt - if [[ ! -s "${RERUN_LIST}" ]]; then - echo "Failed list became empty after cleaning." - exit 0 - fi + # Exclude everything except previously failed: (ALL − FAILED_PREV) + comm -23 /tmp/all_sorted.txt /tmp/failed_prev_clean.txt > /tmp/exclude_only_failed.txt || true - echo "Re-running previously failed gunittest thorough files first:" - head -n 50 "${RERUN_LIST}" || true + # Build temp cfg = base cfg + dynamic excludes + TMP_CFG="/tmp/macos_gunittest_only_failed.cfg" + cp .github/workflows/macos_gunittest.cfg "${TMP_CFG}" + cat /tmp/exclude_only_failed.txt >> "${TMP_CFG}" - # Put output in a separate folder OUTDIR="${CURR_DIR}/rerun_prev" - mkdir -p "${OUTDIR}" - - # IMPORTANT: do NOT swallow failure; we want STOP-ON-REPEAT .github/workflows/test_thorough.sh \ - --config .github/workflows/macos_gunittest.cfg \ - --output "${OUTDIR}" \ - $(cat "${RERUN_LIST}") + --config "${TMP_CFG}" \ + --output "${OUTDIR}" env: SAMPLE_DATA_URL: "file://${{ github.workspace }}/sample-data/nc_spm_full_v2alpha2.tar.gz" + + - name: Collect all gunittest thorough test files (repo scan) shell: micromamba-shell {0} run: | @@ -919,21 +912,22 @@ jobs: - name: Run gunittest thorough remaining tests shell: micromamba-shell {0} run: | + set -e PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" - OUTDIR="${CURR_DIR}/full_run" - mkdir -p "${OUTDIR}" + PREV_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough_prev" - REM="${CURR_DIR}/remaining_tests.txt" - if [[ ! -s "${REM}" ]]; then - echo "No remaining tests; skipping." - exit 0 - fi + FAILED_PREV="${PREV_DIR}/failed_tests.txt" + tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' | sort -u > /tmp/failed_prev_clean.txt || true + TMP_CFG="/tmp/macos_gunittest_remaining.cfg" + cp .github/workflows/macos_gunittest.cfg "${TMP_CFG}" + cat /tmp/failed_prev_clean.txt >> "${TMP_CFG}" + + OUTDIR="${CURR_DIR}/full_run" .github/workflows/test_thorough.sh \ - --config .github/workflows/macos_gunittest.cfg \ - --output "${OUTDIR}" \ - $(cat "${REM}") + --config "${TMP_CFG}" \ + --output "${OUTDIR}" env: SAMPLE_DATA_URL: "file://${{ github.workspace }}/sample-data/nc_spm_full_v2alpha2.tar.gz" From fad13afce21304d8710d6f733ed9e7b5c1cb601c Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 7 Feb 2026 23:38:37 -0500 Subject: [PATCH 59/79] fix command --- .github/workflows/macos.yml | 111 ++++++++++++++++++++++++++++++------ 1 file changed, 94 insertions(+), 17 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 6abac191c97..570d84faba7 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -836,7 +836,9 @@ jobs: if: env.PREV_GUNITTEST_THOROUGH_EXISTS == 'true' shell: micromamba-shell {0} run: | - set -e + set -euo pipefail + export PATH="/usr/bin:/bin:/usr/sbin:/sbin:${PATH}" + PR_DIR="pr_${PR_ID}" PREV_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough_prev" CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" @@ -845,19 +847,51 @@ jobs: ALL="${CURR_DIR}/all_tests.txt" FAILED_PREV="${PREV_DIR}/failed_tests.txt" + # Ensure ALL exists (this step may run before the repo-scan step) + if [[ ! -f "${ALL}" ]]; then + find . -type f \( -path "*/testsuite/*.py" -o -path "*/testsuite/*.sh" \) \ + | sed 's|^\./||' \ + | sort > "${ALL}" + fi + + # If no previous failed list, nothing to rerun + if [[ ! -s "${FAILED_PREV}" ]]; then + echo "No previous failed gunittest thorough list; skipping rerun." + exit 0 + fi + # Clean + sort inputs for comm - tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' | sort -u > /tmp/failed_prev_clean.txt || true + tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' | sed 's|^\./||' | sort -u > /tmp/failed_prev_clean.txt sort -u "${ALL}" > /tmp/all_sorted.txt # Exclude everything except previously failed: (ALL − FAILED_PREV) comm -23 /tmp/all_sorted.txt /tmp/failed_prev_clean.txt > /tmp/exclude_only_failed.txt || true - # Build temp cfg = base cfg + dynamic excludes + # Build temp cfg = base cfg + dynamic excludes INSIDE exclude= block TMP_CFG="/tmp/macos_gunittest_only_failed.cfg" cp .github/workflows/macos_gunittest.cfg "${TMP_CFG}" - cat /tmp/exclude_only_failed.txt >> "${TMP_CFG}" + + awk ' + BEGIN { inserted=0 } + { + print $0 + if (!inserted && $0 ~ /^exclude[[:space:]]*=/) { + while ((getline line < "/tmp/exclude_only_failed.txt") > 0) { + gsub(/\r/, "", line) + if (line ~ /^[[:space:]]*$/) continue + print " " line + } + close("/tmp/exclude_only_failed.txt") + inserted=1 + } + } + ' "${TMP_CFG}" > "${TMP_CFG}.new" + mv "${TMP_CFG}.new" "${TMP_CFG}" OUTDIR="${CURR_DIR}/rerun_prev" + mkdir -p "${OUTDIR}" + + # STOP-ON-REPEAT behavior: do NOT swallow failure .github/workflows/test_thorough.sh \ --config "${TMP_CFG}" \ --output "${OUTDIR}" @@ -912,29 +946,63 @@ jobs: - name: Run gunittest thorough remaining tests shell: micromamba-shell {0} run: | - set -e + set -euo pipefail + export PATH="/usr/bin:/bin:/usr/sbin:/sbin:${PATH}" + PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" PREV_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough_prev" + OUTDIR="${CURR_DIR}/full_run" + mkdir -p "${OUTDIR}" + FAILED_PREV="${PREV_DIR}/failed_tests.txt" - tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' | sort -u > /tmp/failed_prev_clean.txt || true + + # If no previous failed list, just run base cfg (no dynamic exclude) + if [[ ! -s "${FAILED_PREV}" ]]; then + echo "No previous failed list; running full gunittest thorough suite." + .github/workflows/test_thorough.sh \ + --config .github/workflows/macos_gunittest.cfg \ + --output "${OUTDIR}" + exit 0 + fi + + tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' | sed 's|^\./||' | sort -u > /tmp/failed_prev_clean.txt TMP_CFG="/tmp/macos_gunittest_remaining.cfg" cp .github/workflows/macos_gunittest.cfg "${TMP_CFG}" - cat /tmp/failed_prev_clean.txt >> "${TMP_CFG}" - OUTDIR="${CURR_DIR}/full_run" + # Add previous-failed files to exclude= so this run executes "remaining" + awk ' + BEGIN { inserted=0 } + { + print $0 + if (!inserted && $0 ~ /^exclude[[:space:]]*=/) { + while ((getline line < "/tmp/failed_prev_clean.txt") > 0) { + gsub(/\r/, "", line) + if (line ~ /^[[:space:]]*$/) continue + print " " line + } + close("/tmp/failed_prev_clean.txt") + inserted=1 + } + } + ' "${TMP_CFG}" > "${TMP_CFG}.new" + mv "${TMP_CFG}.new" "${TMP_CFG}" + .github/workflows/test_thorough.sh \ --config "${TMP_CFG}" \ --output "${OUTDIR}" env: SAMPLE_DATA_URL: "file://${{ github.workspace }}/sample-data/nc_spm_full_v2alpha2.tar.gz" + - name: Extract failed/passed gunittest thorough files if: always() shell: micromamba-shell {0} run: | + export PATH="/usr/bin:/bin:/usr/sbin:/sbin:${PATH}" + PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" OUTDIR="${CURR_DIR}/full_run" @@ -944,31 +1012,40 @@ jobs: : > "${FAILED}" : > "${PASSED}" - # Parse keyvalue results + if [[ ! -d "${OUTDIR}" ]]; then + echo "No full_run output dir found at: ${OUTDIR}" + exit 0 + fi + while IFS= read -r kv; do status="$(grep -E '^status=' "$kv" | head -n 1 | cut -d= -f2- || true)" - name="$(grep -E '^name=' "$kv" | head -n 1 | cut -d= -f2- || true)" - # 'name' is often module name; we want file path when available: - # invoker keyval also has 'file=' in some setups; try that first. file="$(grep -E '^file=' "$kv" | head -n 1 | cut -d= -f2- || true)" - target="${file:-$name}" + test="$(grep -E '^test=' "$kv" | head -n 1 | cut -d= -f2- || true)" + name="$(grep -E '^name=' "$kv" | head -n 1 | cut -d= -f2- || true)" + + target="${file:-${test:-$name}}" + target="$(echo "${target}" | tr -d '\r' | sed 's|^\./||' | sed 's|^[[:space:]]*||;s|[[:space:]]*$||')" [[ -z "${target}" || -z "${status}" ]] && continue - if [[ "$status" == "failed" ]]; then + if [[ "${status}" == "failed" ]]; then echo "${target}" >> "${FAILED}" - elif [[ "$status" == "passed" ]]; then + elif [[ "${status}" == "passed" ]]; then echo "${target}" >> "${PASSED}" fi done < <(find "${OUTDIR}" -type f -name "test_keyvalue_result.txt" 2>/dev/null || true) - sort -u -o "${FAILED}" "${FAILED}" || true - sort -u -o "${PASSED}" "${PASSED}" || true + tr -d '\r' < "${FAILED}" | sed '/^[[:space:]]*$/d' | sort -u > /tmp/failed_thorough_unique.txt || true + tr -d '\r' < "${PASSED}" | sed '/^[[:space:]]*$/d' | sort -u > /tmp/passed_thorough_unique.txt || true + mv /tmp/failed_thorough_unique.txt "${FAILED}" + mv /tmp/passed_thorough_unique.txt "${PASSED}" echo "Failed thorough count: $(wc -l < "${FAILED}" || echo 0)" echo "Passed thorough count: $(wc -l < "${PASSED}" || echo 0)" head -n 30 "${FAILED}" || true + + - name: Upload macOS gunittest thorough artifacts if: always() uses: actions/upload-artifact@v4 From 4c3a9f4e2b6bc3ab14141cf00f7b57f8559bb816 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 15 Feb 2026 20:19:35 -0500 Subject: [PATCH 60/79] remove path --- .github/workflows/macos.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 570d84faba7..23f0f7b75d2 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -837,7 +837,8 @@ jobs: shell: micromamba-shell {0} run: | set -euo pipefail - export PATH="/usr/bin:/bin:/usr/sbin:/sbin:${PATH}" + which python3 + python3 --version PR_DIR="pr_${PR_ID}" PREV_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough_prev" @@ -947,7 +948,8 @@ jobs: shell: micromamba-shell {0} run: | set -euo pipefail - export PATH="/usr/bin:/bin:/usr/sbin:/sbin:${PATH}" + which python3 + python3 --version PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" @@ -1001,7 +1003,8 @@ jobs: if: always() shell: micromamba-shell {0} run: | - export PATH="/usr/bin:/bin:/usr/sbin:/sbin:${PATH}" + which python3 + python3 --version PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" From dd681835fe2b50b0d4520663f1c454a9c1dbc542 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 22 Feb 2026 19:04:30 -0500 Subject: [PATCH 61/79] check with intentional failure --- imagery/i.albedo/testsuite/test_i_albedo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/imagery/i.albedo/testsuite/test_i_albedo.py b/imagery/i.albedo/testsuite/test_i_albedo.py index bc5a4a2dd8b..1583d8aed93 100644 --- a/imagery/i.albedo/testsuite/test_i_albedo.py +++ b/imagery/i.albedo/testsuite/test_i_albedo.py @@ -8,6 +8,10 @@ class TestIAlbedo(TestCase): output_raster = "albedo_output" + def test_intentional_failure_for_ci(self): + """Intentional failure to validate CI failure.""" + self.fail("Intentional failure).") + def setUp(self): """Initialize temporary region with 10x10 grid""" self.use_temp_region() From 1a77e5de03a93a6cc27a95d2b16b34e802ae03ff Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 22 Feb 2026 20:22:39 -0500 Subject: [PATCH 62/79] early check From 3d5ed76390d1e5f32e317841f86bdbf574f23609 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Mon, 2 Mar 2026 20:53:52 -0500 Subject: [PATCH 63/79] fix testcases path issue --- .github/workflows/macos.yml | 50 +++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 23f0f7b75d2..18f35fa10dd 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1003,9 +1003,6 @@ jobs: if: always() shell: micromamba-shell {0} run: | - which python3 - python3 --version - PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" OUTDIR="${CURR_DIR}/full_run" @@ -1022,14 +1019,43 @@ jobs: while IFS= read -r kv; do status="$(grep -E '^status=' "$kv" | head -n 1 | cut -d= -f2- || true)" + + # Primary: use file= from the keyvalue result file="$(grep -E '^file=' "$kv" | head -n 1 | cut -d= -f2- || true)" - test="$(grep -E '^test=' "$kv" | head -n 1 | cut -d= -f2- || true)" - name="$(grep -E '^name=' "$kv" | head -n 1 | cut -d= -f2- || true)" + + # Fallback: derive path from the keyvalue file's directory structure + # e.g. full_run/raster/r.slope.aspect/testsuite/test_something/test_keyvalue_result.txt + # We want: raster/r.slope.aspect/testsuite/test_something.py (or .sh) + if [[ -z "${file}" ]]; then + # Get the parent dir name (test name) and grandparent path (testsuite location) + kv_dir="$(dirname "$kv")" + test_name="$(basename "$kv_dir")" + testsuite_dir="$(dirname "$kv_dir")" + + # Try to find the actual test file + for ext in py sh; do + candidate="${testsuite_dir}/${test_name}.${ext}" + # Convert from output dir path back to repo-relative path + repo_candidate="$(echo "${candidate}" | sed "s|^${OUTDIR}/||")" + if [[ -f "${repo_candidate}" ]] || [[ -f "./${repo_candidate}" ]]; then + file="${repo_candidate}" + break + fi + done + + # If still empty, try to find it in the repo + if [[ -z "${file}" ]]; then + found="$(find . -type f \( -name "${test_name}.py" -o -name "${test_name}.sh" \) -path "*/testsuite/*" | head -n 1 | sed 's|^\./||' || true)" + file="${found}" + fi + fi - target="${file:-${test:-$name}}" - target="$(echo "${target}" | tr -d '\r' | sed 's|^\./||' | sed 's|^[[:space:]]*||;s|[[:space:]]*$||')" + target="$(echo "${file}" | tr -d '\r' | sed 's|^\./||' | sed 's|^[[:space:]]*||;s|[[:space:]]*$||')" - [[ -z "${target}" || -z "${status}" ]] && continue + if [[ -z "${target}" || -z "${status}" ]]; then + echo "WARN: could not resolve path for keyvalue file: $kv (status=${status})" + continue + fi if [[ "${status}" == "failed" ]]; then echo "${target}" >> "${FAILED}" @@ -1038,17 +1064,15 @@ jobs: fi done < <(find "${OUTDIR}" -type f -name "test_keyvalue_result.txt" 2>/dev/null || true) - tr -d '\r' < "${FAILED}" | sed '/^[[:space:]]*$/d' | sort -u > /tmp/failed_thorough_unique.txt || true - tr -d '\r' < "${PASSED}" | sed '/^[[:space:]]*$/d' | sort -u > /tmp/passed_thorough_unique.txt || true - mv /tmp/failed_thorough_unique.txt "${FAILED}" - mv /tmp/passed_thorough_unique.txt "${PASSED}" + # Deduplicate + sort -u "${FAILED}" -o "${FAILED}" + sort -u "${PASSED}" -o "${PASSED}" echo "Failed thorough count: $(wc -l < "${FAILED}" || echo 0)" echo "Passed thorough count: $(wc -l < "${PASSED}" || echo 0)" head -n 30 "${FAILED}" || true - - name: Upload macOS gunittest thorough artifacts if: always() uses: actions/upload-artifact@v4 From bd546c9e65e323940e62a2c6b2272d26ace1ef17 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Mon, 2 Mar 2026 22:09:53 -0500 Subject: [PATCH 64/79] trigger fail again From 6b7816d7022f7e9011ee315c877b4be2d06d8390 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Tue, 3 Mar 2026 18:57:25 -0500 Subject: [PATCH 65/79] pass --- imagery/i.albedo/testsuite/test_i_albedo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imagery/i.albedo/testsuite/test_i_albedo.py b/imagery/i.albedo/testsuite/test_i_albedo.py index 1583d8aed93..27e1ae28a16 100644 --- a/imagery/i.albedo/testsuite/test_i_albedo.py +++ b/imagery/i.albedo/testsuite/test_i_albedo.py @@ -10,7 +10,8 @@ class TestIAlbedo(TestCase): def test_intentional_failure_for_ci(self): """Intentional failure to validate CI failure.""" - self.fail("Intentional failure).") + """self.fail("Intentional failure).")""" + self.assertTrue(True) def setUp(self): """Initialize temporary region with 10x10 grid""" From 91cf232459f41f8258c38dcc8b0447edc5180d55 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 8 Mar 2026 21:03:49 -0400 Subject: [PATCH 66/79] folder correction --- .github/workflows/macos.yml | 90 ++++++++++----------- imagery/i.albedo/testsuite/test_i_albedo.py | 3 +- 2 files changed, 44 insertions(+), 49 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 18f35fa10dd..6671492b9d5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1005,66 +1005,61 @@ jobs: run: | PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" - OUTDIR="${CURR_DIR}/full_run" FAILED="${CURR_DIR}/failed_tests.txt" PASSED="${CURR_DIR}/passed_tests.txt" : > "${FAILED}" : > "${PASSED}" - if [[ ! -d "${OUTDIR}" ]]; then - echo "No full_run output dir found at: ${OUTDIR}" - exit 0 - fi + # Search BOTH full_run and rerun_prev directories + for OUTDIR in "${CURR_DIR}/full_run" "${CURR_DIR}/rerun_prev"; do + if [[ ! -d "${OUTDIR}" ]]; then + echo "Directory not found: ${OUTDIR}, skipping." + continue + fi + + echo "Processing results from: ${OUTDIR}" + + while IFS= read -r kv; do + status="$(grep -E '^status=' "$kv" | head -n 1 | cut -d= -f2- || true)" + + file="$(grep -E '^file=' "$kv" | head -n 1 | cut -d= -f2- || true)" - while IFS= read -r kv; do - status="$(grep -E '^status=' "$kv" | head -n 1 | cut -d= -f2- || true)" - - # Primary: use file= from the keyvalue result - file="$(grep -E '^file=' "$kv" | head -n 1 | cut -d= -f2- || true)" - - # Fallback: derive path from the keyvalue file's directory structure - # e.g. full_run/raster/r.slope.aspect/testsuite/test_something/test_keyvalue_result.txt - # We want: raster/r.slope.aspect/testsuite/test_something.py (or .sh) - if [[ -z "${file}" ]]; then - # Get the parent dir name (test name) and grandparent path (testsuite location) - kv_dir="$(dirname "$kv")" - test_name="$(basename "$kv_dir")" - testsuite_dir="$(dirname "$kv_dir")" - - # Try to find the actual test file - for ext in py sh; do - candidate="${testsuite_dir}/${test_name}.${ext}" - # Convert from output dir path back to repo-relative path - repo_candidate="$(echo "${candidate}" | sed "s|^${OUTDIR}/||")" - if [[ -f "${repo_candidate}" ]] || [[ -f "./${repo_candidate}" ]]; then - file="${repo_candidate}" - break - fi - done - - # If still empty, try to find it in the repo if [[ -z "${file}" ]]; then - found="$(find . -type f \( -name "${test_name}.py" -o -name "${test_name}.sh" \) -path "*/testsuite/*" | head -n 1 | sed 's|^\./||' || true)" - file="${found}" + kv_dir="$(dirname "$kv")" + test_name="$(basename "$kv_dir")" + testsuite_dir="$(dirname "$kv_dir")" + + for ext in py sh; do + candidate="${testsuite_dir}/${test_name}.${ext}" + repo_candidate="$(echo "${candidate}" | sed "s|^${OUTDIR}/||")" + if [[ -f "${repo_candidate}" ]] || [[ -f "./${repo_candidate}" ]]; then + file="${repo_candidate}" + break + fi + done + + if [[ -z "${file}" ]]; then + found="$(find . -type f \( -name "${test_name}.py" -o -name "${test_name}.sh" \) -path "*/testsuite/*" | head -n 1 | sed 's|^\./||' || true)" + file="${found}" + fi fi - fi - target="$(echo "${file}" | tr -d '\r' | sed 's|^\./||' | sed 's|^[[:space:]]*||;s|[[:space:]]*$||')" + target="$(echo "${file}" | tr -d '\r' | sed 's|^\./||' | sed 's|^[[:space:]]*||;s|[[:space:]]*$||')" - if [[ -z "${target}" || -z "${status}" ]]; then - echo "WARN: could not resolve path for keyvalue file: $kv (status=${status})" - continue - fi + if [[ -z "${target}" || -z "${status}" ]]; then + echo "WARN: could not resolve path for keyvalue file: $kv (status=${status})" + continue + fi - if [[ "${status}" == "failed" ]]; then - echo "${target}" >> "${FAILED}" - elif [[ "${status}" == "passed" ]]; then - echo "${target}" >> "${PASSED}" - fi - done < <(find "${OUTDIR}" -type f -name "test_keyvalue_result.txt" 2>/dev/null || true) + if [[ "${status}" == "failed" ]]; then + echo "${target}" >> "${FAILED}" + elif [[ "${status}" == "passed" ]]; then + echo "${target}" >> "${PASSED}" + fi + done < <(find "${OUTDIR}" -type f -name "test_keyvalue_result.txt" 2>/dev/null || true) + done - # Deduplicate sort -u "${FAILED}" -o "${FAILED}" sort -u "${PASSED}" -o "${PASSED}" @@ -1072,7 +1067,6 @@ jobs: echo "Passed thorough count: $(wc -l < "${PASSED}" || echo 0)" head -n 30 "${FAILED}" || true - - name: Upload macOS gunittest thorough artifacts if: always() uses: actions/upload-artifact@v4 diff --git a/imagery/i.albedo/testsuite/test_i_albedo.py b/imagery/i.albedo/testsuite/test_i_albedo.py index 27e1ae28a16..95cc1817a0a 100644 --- a/imagery/i.albedo/testsuite/test_i_albedo.py +++ b/imagery/i.albedo/testsuite/test_i_albedo.py @@ -11,7 +11,8 @@ class TestIAlbedo(TestCase): def test_intentional_failure_for_ci(self): """Intentional failure to validate CI failure.""" """self.fail("Intentional failure).")""" - self.assertTrue(True) + #self.assertTrue(True) + self.fail("Intentional failure.") def setUp(self): """Initialize temporary region with 10x10 grid""" From 7108952ca71297496ef0a210811ddec99aabad4f Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 8 Mar 2026 22:16:44 -0400 Subject: [PATCH 67/79] correct the path --- .github/workflows/macos.yml | 27 ++++++++++++++++----- imagery/i.albedo/testsuite/test_i_albedo.py | 4 +-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 6671492b9d5..9eb7964f723 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1011,7 +1011,6 @@ jobs: : > "${FAILED}" : > "${PASSED}" - # Search BOTH full_run and rerun_prev directories for OUTDIR in "${CURR_DIR}/full_run" "${CURR_DIR}/rerun_prev"; do if [[ ! -d "${OUTDIR}" ]]; then echo "Directory not found: ${OUTDIR}, skipping." @@ -1022,19 +1021,29 @@ jobs: while IFS= read -r kv; do status="$(grep -E '^status=' "$kv" | head -n 1 | cut -d= -f2- || true)" + [[ -z "${status}" ]] && continue file="$(grep -E '^file=' "$kv" | head -n 1 | cut -d= -f2- || true)" + # Strip any artifact/output prefix to get repo-relative path + if [[ -n "${file}" ]]; then + # Remove everything up to and including full_run/ or rerun_prev/ + file="$(echo "${file}" | sed -E 's|^.*(full_run|rerun_prev)/||')" + fi + + # Fallback: derive from keyvalue file location if [[ -z "${file}" ]]; then kv_dir="$(dirname "$kv")" test_name="$(basename "$kv_dir")" testsuite_dir="$(dirname "$kv_dir")" + # Strip OUTDIR prefix from testsuite_dir + testsuite_dir_rel="$(echo "${testsuite_dir}" | sed -E "s|^${OUTDIR}/||")" + for ext in py sh; do - candidate="${testsuite_dir}/${test_name}.${ext}" - repo_candidate="$(echo "${candidate}" | sed "s|^${OUTDIR}/||")" - if [[ -f "${repo_candidate}" ]] || [[ -f "./${repo_candidate}" ]]; then - file="${repo_candidate}" + candidate="${testsuite_dir_rel}/${test_name}.${ext}" + if [[ -f "${candidate}" ]] || [[ -f "./${candidate}" ]]; then + file="${candidate}" break fi done @@ -1047,11 +1056,17 @@ jobs: target="$(echo "${file}" | tr -d '\r' | sed 's|^\./||' | sed 's|^[[:space:]]*||;s|[[:space:]]*$||')" - if [[ -z "${target}" || -z "${status}" ]]; then + if [[ -z "${target}" ]]; then echo "WARN: could not resolve path for keyvalue file: $kv (status=${status})" continue fi + # Skip top-level keyvalue files that aren't actual tests + if [[ ! "${target}" == *"/testsuite/"* ]]; then + echo "SKIP: not a testsuite file: ${target} (status=${status})" + continue + fi + if [[ "${status}" == "failed" ]]; then echo "${target}" >> "${FAILED}" elif [[ "${status}" == "passed" ]]; then diff --git a/imagery/i.albedo/testsuite/test_i_albedo.py b/imagery/i.albedo/testsuite/test_i_albedo.py index 95cc1817a0a..256945a4813 100644 --- a/imagery/i.albedo/testsuite/test_i_albedo.py +++ b/imagery/i.albedo/testsuite/test_i_albedo.py @@ -11,8 +11,8 @@ class TestIAlbedo(TestCase): def test_intentional_failure_for_ci(self): """Intentional failure to validate CI failure.""" """self.fail("Intentional failure).")""" - #self.assertTrue(True) - self.fail("Intentional failure.") + self.assertTrue(True) + #self.fail("Intentional failure.") def setUp(self): """Initialize temporary region with 10x10 grid""" From 129efcd98b780c2f396fa668d3474bf8c6da687c Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Mon, 9 Mar 2026 21:06:38 -0400 Subject: [PATCH 68/79] updated with folder --- .github/workflows/macos.yml | 128 +++++++++++++++++++++++++++++------- 1 file changed, 104 insertions(+), 24 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9eb7964f723..dae6008c292 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -831,14 +831,23 @@ jobs: echo "Previous gunittest thorough failed files:" cat artifacts/pr_${PR_ID}/macos_gunittest_thorough_prev/failed_tests.txt || true + + - name: Clean previous artifact test files + if: env.PREV_GUNITTEST_THOROUGH_EXISTS == 'true' + shell: bash + run: | + PR_DIR="pr_${PR_ID}" + PREV_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough_prev" + echo "Removing .py/.sh test files from previous artifact to prevent accidental execution..." + find "${PREV_DIR}" -name "*.py" -path "*/testsuite/*" -delete 2>/dev/null || true + find "${PREV_DIR}" -name "*.sh" -path "*/testsuite/*" -delete 2>/dev/null || true + echo "Done cleaning previous artifact." - name: Run previously failed gunittest thorough tests first (STOP if repeat) if: env.PREV_GUNITTEST_THOROUGH_EXISTS == 'true' shell: micromamba-shell {0} run: | set -euo pipefail - which python3 - python3 --version PR_DIR="pr_${PR_ID}" PREV_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough_prev" @@ -848,27 +857,44 @@ jobs: ALL="${CURR_DIR}/all_tests.txt" FAILED_PREV="${PREV_DIR}/failed_tests.txt" - # Ensure ALL exists (this step may run before the repo-scan step) + # Build ALL from repo only (exclude artifacts directory) if [[ ! -f "${ALL}" ]]; then find . -type f \( -path "*/testsuite/*.py" -o -path "*/testsuite/*.sh" \) \ + -not -path "./artifacts/*" \ | sed 's|^\./||' \ | sort > "${ALL}" fi - # If no previous failed list, nothing to rerun if [[ ! -s "${FAILED_PREV}" ]]; then echo "No previous failed gunittest thorough list; skipping rerun." exit 0 fi - # Clean + sort inputs for comm - tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' | sed 's|^\./||' | sort -u > /tmp/failed_prev_clean.txt + # Normalize previous failed paths to repo-relative + # Strip any artifact prefix (e.g. artifacts/.../full_run/ or rerun_prev/) + tr -d '\r' < "${FAILED_PREV}" \ + | sed '/^[[:space:]]*$/d' \ + | sed 's|^\./||' \ + | sed -E 's|^.*/(full_run|rerun_prev)/||' \ + | sort -u > /tmp/failed_prev_clean.txt + + # Keep only entries that actually exist in the repo's test list sort -u "${ALL}" > /tmp/all_sorted.txt + comm -12 /tmp/all_sorted.txt /tmp/failed_prev_clean.txt > /tmp/failed_prev_valid.txt - # Exclude everything except previously failed: (ALL − FAILED_PREV) - comm -23 /tmp/all_sorted.txt /tmp/failed_prev_clean.txt > /tmp/exclude_only_failed.txt || true + VALID_COUNT=$(wc -l < /tmp/failed_prev_valid.txt) + echo "Previous failed (raw): $(wc -l < /tmp/failed_prev_clean.txt)" + echo "Previous failed (valid in repo): ${VALID_COUNT}" + cat /tmp/failed_prev_valid.txt + + if [[ "${VALID_COUNT}" -eq 0 ]]; then + echo "No valid previously-failed test files found in repo. Skipping rerun." + exit 0 + fi + + # Exclude everything EXCEPT the valid previously-failed tests + comm -23 /tmp/all_sorted.txt /tmp/failed_prev_valid.txt > /tmp/exclude_only_failed.txt || true - # Build temp cfg = base cfg + dynamic excludes INSIDE exclude= block TMP_CFG="/tmp/macos_gunittest_only_failed.cfg" cp .github/workflows/macos_gunittest.cfg "${TMP_CFG}" @@ -892,15 +918,38 @@ jobs: OUTDIR="${CURR_DIR}/rerun_prev" mkdir -p "${OUTDIR}" - # STOP-ON-REPEAT behavior: do NOT swallow failure + # Capture exit code instead of letting pipefail kill us + RERUN_RC=0 .github/workflows/test_thorough.sh \ --config "${TMP_CFG}" \ - --output "${OUTDIR}" + --output "${OUTDIR}" || RERUN_RC=$? + + # Check actual test results from keyvalue files + STILL_FAILING=0 + while IFS= read -r kv; do + status="$(grep -E '^status=' "$kv" | head -n 1 | cut -d= -f2- || true)" + if [[ "${status}" == "failed" ]]; then + STILL_FAILING=$((STILL_FAILING + 1)) + name="$(grep -E '^name=' "$kv" | head -n 1 | cut -d= -f2- || true)" + echo "STILL FAILING: ${name}" + fi + done < <(find "${OUTDIR}" -type f -name "test_keyvalue_result.txt" 2>/dev/null || true) + + if [[ "${STILL_FAILING}" -gt 0 ]]; then + echo "ERROR: ${STILL_FAILING} previously-failed test(s) are STILL failing. Stopping." + exit 1 + fi + + if [[ "${RERUN_RC}" -ne 0 ]]; then + echo "WARN: test_thorough.sh exited with ${RERUN_RC} but no tests reported as failed." + echo "This may be an infrastructure issue. Continuing with remaining tests." + fi + + echo "All previously-failed tests now pass. Continuing." env: SAMPLE_DATA_URL: "file://${{ github.workspace }}/sample-data/nc_spm_full_v2alpha2.tar.gz" - - name: Collect all gunittest thorough test files (repo scan) shell: micromamba-shell {0} run: | @@ -910,9 +959,10 @@ jobs: ALL_FILE="${CURR_DIR}/all_tests.txt" - # Repo-relative testsuite files (py + sh) + # Repo-relative testsuite files (py + sh) — EXCLUDE artifacts directory find . -type f \ \( -path "*/testsuite/*.py" -o -path "*/testsuite/*.sh" \) \ + -not -path "./artifacts/*" \ | sed 's|^\./||' \ | sort > "${ALL_FILE}" @@ -931,12 +981,26 @@ jobs: FAILED_PREV="${PREV_DIR}/failed_tests.txt" if [[ -s "${FAILED_PREV}" ]]; then - tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' > /tmp/failed_prev_clean.txt || true - grep -v -F -f /tmp/failed_prev_clean.txt "${ALL}" > "${REM}" || true + # Normalize previous failed paths to repo-relative + tr -d '\r' < "${FAILED_PREV}" \ + | sed '/^[[:space:]]*$/d' \ + | sed 's|^\./||' \ + | sed -E 's|^.*/(full_run|rerun_prev)/||' \ + | sort -u > /tmp/failed_prev_clean.txt + + # Only keep entries that exist in ALL + sort -u "${ALL}" > /tmp/all_sorted.txt + comm -12 /tmp/all_sorted.txt /tmp/failed_prev_clean.txt > /tmp/failed_prev_valid.txt + + # Remaining = ALL minus valid previously-failed + comm -23 /tmp/all_sorted.txt /tmp/failed_prev_valid.txt > "${REM}" || true + if [[ ! -s "${REM}" ]]; then echo "Remaining empty; fallback to ALL." cp "${ALL}" "${REM}" fi + + echo "Previously failed (valid): $(wc -l < /tmp/failed_prev_valid.txt)" else cp "${ALL}" "${REM}" fi @@ -948,8 +1012,6 @@ jobs: shell: micromamba-shell {0} run: | set -euo pipefail - which python3 - python3 --version PR_DIR="pr_${PR_ID}" CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" @@ -969,23 +1031,37 @@ jobs: exit 0 fi - tr -d '\r' < "${FAILED_PREV}" | sed '/^[[:space:]]*$/d' | sed 's|^\./||' | sort -u > /tmp/failed_prev_clean.txt + # Normalize previous failed paths to repo-relative + tr -d '\r' < "${FAILED_PREV}" \ + | sed '/^[[:space:]]*$/d' \ + | sed 's|^\./||' \ + | sed -E 's|^.*/(full_run|rerun_prev)/||' \ + | sort -u > /tmp/failed_prev_clean.txt + + # Validate against repo + ALL="${CURR_DIR}/all_tests.txt" + if [[ -f "${ALL}" ]]; then + sort -u "${ALL}" > /tmp/all_sorted.txt + comm -12 /tmp/all_sorted.txt /tmp/failed_prev_clean.txt > /tmp/failed_prev_valid.txt + else + cp /tmp/failed_prev_clean.txt /tmp/failed_prev_valid.txt + fi TMP_CFG="/tmp/macos_gunittest_remaining.cfg" cp .github/workflows/macos_gunittest.cfg "${TMP_CFG}" - # Add previous-failed files to exclude= so this run executes "remaining" + # Add valid previous-failed files to exclude= so this run executes "remaining" awk ' BEGIN { inserted=0 } { print $0 if (!inserted && $0 ~ /^exclude[[:space:]]*=/) { - while ((getline line < "/tmp/failed_prev_clean.txt") > 0) { + while ((getline line < "/tmp/failed_prev_valid.txt") > 0) { gsub(/\r/, "", line) if (line ~ /^[[:space:]]*$/) continue print " " line } - close("/tmp/failed_prev_clean.txt") + close("/tmp/failed_prev_valid.txt") inserted=1 } } @@ -1011,6 +1087,7 @@ jobs: : > "${FAILED}" : > "${PASSED}" + # Search BOTH full_run and rerun_prev directories for OUTDIR in "${CURR_DIR}/full_run" "${CURR_DIR}/rerun_prev"; do if [[ ! -d "${OUTDIR}" ]]; then echo "Directory not found: ${OUTDIR}, skipping." @@ -1027,7 +1104,6 @@ jobs: # Strip any artifact/output prefix to get repo-relative path if [[ -n "${file}" ]]; then - # Remove everything up to and including full_run/ or rerun_prev/ file="$(echo "${file}" | sed -E 's|^.*(full_run|rerun_prev)/||')" fi @@ -1049,7 +1125,9 @@ jobs: done if [[ -z "${file}" ]]; then - found="$(find . -type f \( -name "${test_name}.py" -o -name "${test_name}.sh" \) -path "*/testsuite/*" | head -n 1 | sed 's|^\./||' || true)" + found="$(find . -type f \( -name "${test_name}.py" -o -name "${test_name}.sh" \) \ + -path "*/testsuite/*" -not -path "./artifacts/*" \ + | head -n 1 | sed 's|^\./||' || true)" file="${found}" fi fi @@ -1061,7 +1139,7 @@ jobs: continue fi - # Skip top-level keyvalue files that aren't actual tests + # Skip top-level keyvalue files and non-testsuite files if [[ ! "${target}" == *"/testsuite/"* ]]; then echo "SKIP: not a testsuite file: ${target} (status=${status})" continue @@ -1080,6 +1158,7 @@ jobs: echo "Failed thorough count: $(wc -l < "${FAILED}" || echo 0)" echo "Passed thorough count: $(wc -l < "${PASSED}" || echo 0)" + echo "--- Failed files ---" head -n 30 "${FAILED}" || true - name: Upload macOS gunittest thorough artifacts @@ -1093,6 +1172,7 @@ jobs: artifacts/pr_${{ env.PR_ID }}/macos_gunittest_thorough/failed_tests.txt artifacts/pr_${{ env.PR_ID }}/macos_gunittest_thorough/passed_tests.txt artifacts/pr_${{ env.PR_ID }}/macos_gunittest_thorough/full_run + artifacts/pr_${{ env.PR_ID }}/macos_gunittest_thorough/rerun_prev retention-days: 7 - name: Make HTML test report available From f67225eaa58c3afc166f4807e9a214bc7e9668c1 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Mon, 9 Mar 2026 21:46:59 -0400 Subject: [PATCH 69/79] balance parantheses --- .github/workflows/macos.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index dae6008c292..b18e1e3e143 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -875,7 +875,7 @@ jobs: tr -d '\r' < "${FAILED_PREV}" \ | sed '/^[[:space:]]*$/d' \ | sed 's|^\./||' \ - | sed -E 's|^.*/(full_run|rerun_prev)/||' \ + | sed -E 's#^.*/(full_run|rerun_prev)/##' \ | sort -u > /tmp/failed_prev_clean.txt # Keep only entries that actually exist in the repo's test list @@ -985,7 +985,7 @@ jobs: tr -d '\r' < "${FAILED_PREV}" \ | sed '/^[[:space:]]*$/d' \ | sed 's|^\./||' \ - | sed -E 's|^.*/(full_run|rerun_prev)/||' \ + | sed -E 's#^.*/(full_run|rerun_prev)/##' \ | sort -u > /tmp/failed_prev_clean.txt # Only keep entries that exist in ALL @@ -1035,7 +1035,7 @@ jobs: tr -d '\r' < "${FAILED_PREV}" \ | sed '/^[[:space:]]*$/d' \ | sed 's|^\./||' \ - | sed -E 's|^.*/(full_run|rerun_prev)/||' \ + | sed -E 's#^.*/(full_run|rerun_prev)/##' \ | sort -u > /tmp/failed_prev_clean.txt # Validate against repo @@ -1104,7 +1104,7 @@ jobs: # Strip any artifact/output prefix to get repo-relative path if [[ -n "${file}" ]]; then - file="$(echo "${file}" | sed -E 's|^.*(full_run|rerun_prev)/||')" + file="$(echo "${file}" | sed -E 's#^.*(full_run|rerun_prev)/##')" fi # Fallback: derive from keyvalue file location From 51d19739a53bcfe10fe1b83846da0c2f39be1a20 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Mon, 9 Mar 2026 23:13:11 -0400 Subject: [PATCH 70/79] check failure --- imagery/i.albedo/testsuite/test_i_albedo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imagery/i.albedo/testsuite/test_i_albedo.py b/imagery/i.albedo/testsuite/test_i_albedo.py index 256945a4813..95cc1817a0a 100644 --- a/imagery/i.albedo/testsuite/test_i_albedo.py +++ b/imagery/i.albedo/testsuite/test_i_albedo.py @@ -11,8 +11,8 @@ class TestIAlbedo(TestCase): def test_intentional_failure_for_ci(self): """Intentional failure to validate CI failure.""" """self.fail("Intentional failure).")""" - self.assertTrue(True) - #self.fail("Intentional failure.") + #self.assertTrue(True) + self.fail("Intentional failure.") def setUp(self): """Initialize temporary region with 10x10 grid""" From 2980f61da0d47641ecf9b92dc3dd17af7987a0aa Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Tue, 10 Mar 2026 00:20:50 -0400 Subject: [PATCH 71/79] triggerfailagain From eac0bcdca8e75a60157900933b745ca8bfe10abc Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Tue, 10 Mar 2026 00:35:07 -0400 Subject: [PATCH 72/79] fix failed testcase --- imagery/i.albedo/testsuite/test_i_albedo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imagery/i.albedo/testsuite/test_i_albedo.py b/imagery/i.albedo/testsuite/test_i_albedo.py index 95cc1817a0a..256945a4813 100644 --- a/imagery/i.albedo/testsuite/test_i_albedo.py +++ b/imagery/i.albedo/testsuite/test_i_albedo.py @@ -11,8 +11,8 @@ class TestIAlbedo(TestCase): def test_intentional_failure_for_ci(self): """Intentional failure to validate CI failure.""" """self.fail("Intentional failure).")""" - #self.assertTrue(True) - self.fail("Intentional failure.") + self.assertTrue(True) + #self.fail("Intentional failure.") def setUp(self): """Initialize temporary region with 10x10 grid""" From 85fe2c931bede665bcfe1b1fdba34ecf46e62a15 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Wed, 18 Mar 2026 16:49:51 -0400 Subject: [PATCH 73/79] fix dataset issue --- .github/workflows/macos.yml | 2 ++ imagery/i.albedo/testsuite/test_i_albedo.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b18e1e3e143..795eb6edf08 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1025,6 +1025,7 @@ jobs: # If no previous failed list, just run base cfg (no dynamic exclude) if [[ ! -s "${FAILED_PREV}" ]]; then echo "No previous failed list; running full gunittest thorough suite." + rm -rf "${HOME}/nc_spm_full_v2alpha2" || true .github/workflows/test_thorough.sh \ --config .github/workflows/macos_gunittest.cfg \ --output "${OUTDIR}" @@ -1068,6 +1069,7 @@ jobs: ' "${TMP_CFG}" > "${TMP_CFG}.new" mv "${TMP_CFG}.new" "${TMP_CFG}" + rm -rf "${HOME}/nc_spm_full_v2alpha2" || true .github/workflows/test_thorough.sh \ --config "${TMP_CFG}" \ --output "${OUTDIR}" diff --git a/imagery/i.albedo/testsuite/test_i_albedo.py b/imagery/i.albedo/testsuite/test_i_albedo.py index 256945a4813..95cc1817a0a 100644 --- a/imagery/i.albedo/testsuite/test_i_albedo.py +++ b/imagery/i.albedo/testsuite/test_i_albedo.py @@ -11,8 +11,8 @@ class TestIAlbedo(TestCase): def test_intentional_failure_for_ci(self): """Intentional failure to validate CI failure.""" """self.fail("Intentional failure).")""" - self.assertTrue(True) - #self.fail("Intentional failure.") + #self.assertTrue(True) + self.fail("Intentional failure.") def setUp(self): """Initialize temporary region with 10x10 grid""" From f1be379d65e4e0c9b0899e24b95b1ec196d4fd50 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Wed, 18 Mar 2026 18:07:05 -0400 Subject: [PATCH 74/79] check fail From 87850a5c890cefc3a7ad1b8ce391ade60f28edef Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Wed, 18 Mar 2026 18:15:48 -0400 Subject: [PATCH 75/79] fix fail testcase --- imagery/i.albedo/testsuite/test_i_albedo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imagery/i.albedo/testsuite/test_i_albedo.py b/imagery/i.albedo/testsuite/test_i_albedo.py index 95cc1817a0a..256945a4813 100644 --- a/imagery/i.albedo/testsuite/test_i_albedo.py +++ b/imagery/i.albedo/testsuite/test_i_albedo.py @@ -11,8 +11,8 @@ class TestIAlbedo(TestCase): def test_intentional_failure_for_ci(self): """Intentional failure to validate CI failure.""" """self.fail("Intentional failure).")""" - #self.assertTrue(True) - self.fail("Intentional failure.") + self.assertTrue(True) + #self.fail("Intentional failure.") def setUp(self): """Initialize temporary region with 10x10 grid""" From 7aad275fc158b8483ca990a596e62bced846e97d Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sat, 11 Apr 2026 20:41:20 -0400 Subject: [PATCH 76/79] check logging --- .github/workflows/macos.yml | 82 +++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 795eb6edf08..7c76b171014 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1163,6 +1163,88 @@ jobs: echo "--- Failed files ---" head -n 30 "${FAILED}" || true + - name: Verify no duplicate executions between rerun and remaining + if: always() + shell: micromamba-shell {0} + run: | + PR_DIR="pr_${PR_ID}" + CURR_DIR="artifacts/${PR_DIR}/macos_gunittest_thorough" + + mkdir -p artifacts/verification + + echo "===== DUPLICATE CHECK: rerun vs remaining =====" | tee artifacts/verification/thorough_verification.txt + + # Collect tests executed in rerun_prev + RERUN_TESTS="/tmp/rerun_executed.txt" + : > "${RERUN_TESTS}" + if [[ -d "${CURR_DIR}/rerun_prev" ]]; then + while IFS= read -r kv; do + file="$(grep -E '^file=' "$kv" | head -n 1 | cut -d= -f2- || true)" + if [[ -n "${file}" ]]; then + echo "${file}" | sed -E 's#^.*(full_run|rerun_prev)/##' | sed 's|^\./||' + fi + done < <(find "${CURR_DIR}/rerun_prev" -type f -name "test_keyvalue_result.txt" 2>/dev/null) \ + | sort -u >> "${RERUN_TESTS}" + fi + + # Collect tests executed in full_run + REMAINING_TESTS="/tmp/remaining_executed.txt" + : > "${REMAINING_TESTS}" + if [[ -d "${CURR_DIR}/full_run" ]]; then + while IFS= read -r kv; do + file="$(grep -E '^file=' "$kv" | head -n 1 | cut -d= -f2- || true)" + if [[ -n "${file}" ]]; then + echo "${file}" | sed -E 's#^.*(full_run|rerun_prev)/##' | sed 's|^\./||' + fi + done < <(find "${CURR_DIR}/full_run" -type f -name "test_keyvalue_result.txt" 2>/dev/null) \ + | sort -u >> "${REMAINING_TESTS}" + fi + + cp "${RERUN_TESTS}" artifacts/verification/rerun_executed.txt + cp "${REMAINING_TESTS}" artifacts/verification/remaining_executed.txt + + echo "Tests in rerun: $(wc -l < "${RERUN_TESTS}")" | tee -a artifacts/verification/thorough_verification.txt + cat "${RERUN_TESTS}" | tee -a artifacts/verification/thorough_verification.txt + echo "" | tee -a artifacts/verification/thorough_verification.txt + echo "Tests in remaining: $(wc -l < "${REMAINING_TESTS}")" | tee -a artifacts/verification/thorough_verification.txt + echo "" | tee -a artifacts/verification/thorough_verification.txt + + # Find overlap + comm -12 "${RERUN_TESTS}" "${REMAINING_TESTS}" > artifacts/verification/duplicates.txt + + if [[ -s artifacts/verification/duplicates.txt ]]; then + echo "ERROR: These tests ran in BOTH rerun and remaining:" | tee -a artifacts/verification/thorough_verification.txt + cat artifacts/verification/duplicates.txt | tee -a artifacts/verification/thorough_verification.txt + else + echo "No duplicates. Rerun and remaining are disjoint." | tee -a artifacts/verification/thorough_verification.txt + fi + + # Total coverage check + ALL="${CURR_DIR}/all_tests.txt" + if [[ -f "${ALL}" ]]; then + cat "${RERUN_TESTS}" "${REMAINING_TESTS}" | sort -u > artifacts/verification/total_executed.txt + comm -23 <(sort -u "${ALL}") artifacts/verification/total_executed.txt > artifacts/verification/not_executed.txt + NOT_RUN=$(wc -l < artifacts/verification/not_executed.txt) + echo "" | tee -a artifacts/verification/thorough_verification.txt + echo "Total in repo: $(wc -l < "${ALL}")" | tee -a artifacts/verification/thorough_verification.txt + echo "Total executed: $(wc -l < artifacts/verification/total_executed.txt)" | tee -a artifacts/verification/thorough_verification.txt + echo "Not executed: ${NOT_RUN}" | tee -a artifacts/verification/thorough_verification.txt + if [[ "${NOT_RUN}" -gt 0 ]]; then + echo "Missing tests:" | tee -a artifacts/verification/thorough_verification.txt + head -n 20 artifacts/verification/not_executed.txt | tee -a artifacts/verification/thorough_verification.txt + fi + fi + + echo "================================================" | tee -a artifacts/verification/thorough_verification.txt + + - name: Upload verification results + if: always() + uses: actions/upload-artifact@v4 + with: + name: thorough_verification_results + path: artifacts/verification/ + retention-days: 7 + - name: Upload macOS gunittest thorough artifacts if: always() uses: actions/upload-artifact@v4 From 73ff41ebd4f4f08c88b775d014a6926cf07481f7 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 12 Apr 2026 16:52:04 -0400 Subject: [PATCH 77/79] fix regex for testsuite path --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 7c76b171014..1a718d83cf2 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1142,7 +1142,7 @@ jobs: fi # Skip top-level keyvalue files and non-testsuite files - if [[ ! "${target}" == *"/testsuite/"* ]]; then + if [[ ! "${target}" == *"testsuite/"* ]]; then echo "SKIP: not a testsuite file: ${target} (status=${status})" continue fi From 3ad37a190c95ac557ca57322dfcea92241a8e9d0 Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 12 Apr 2026 19:40:08 -0400 Subject: [PATCH 78/79] modify find command --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1a718d83cf2..e762959a02c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1128,7 +1128,7 @@ jobs: if [[ -z "${file}" ]]; then found="$(find . -type f \( -name "${test_name}.py" -o -name "${test_name}.sh" \) \ - -path "*/testsuite/*" -not -path "./artifacts/*" \ + \( -path "*/testsuite/*" -o -path "./testsuite/*" \) -not -path "./artifacts/*" \ | head -n 1 | sed 's|^\./||' || true)" file="${found}" fi From 03dca57335184602ad81c9086f65ac00953f35de Mon Sep 17 00:00:00 2001 From: Shubham Vasudeo Desai Date: Sun, 12 Apr 2026 20:48:44 -0400 Subject: [PATCH 79/79] debug key value for first --- .github/workflows/macos.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e762959a02c..6e87068bd63 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1104,6 +1104,9 @@ jobs: file="$(grep -E '^file=' "$kv" | head -n 1 | cut -d= -f2- || true)" + # DEBUG: log keyvalue processing + echo "DEBUG-KV: kv=$kv file='${file}' status='${status}'" + # Strip any artifact/output prefix to get repo-relative path if [[ -n "${file}" ]]; then file="$(echo "${file}" | sed -E 's#^.*(full_run|rerun_prev)/##')" @@ -1138,6 +1141,8 @@ jobs: if [[ -z "${target}" ]]; then echo "WARN: could not resolve path for keyvalue file: $kv (status=${status})" + echo "DEBUG-WARN: file='$(grep -E '^file=' "$kv" || true)' name='$(grep -E '^name=' "$kv" || true)'" + echo "DEBUG-WARN: kv_dir=$(dirname "$kv") test_name=$(basename "$(dirname "$kv")")" continue fi