diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 52dfa3b60e..ac79f296c3 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -277,6 +277,18 @@ jobs: - '!.cursor-plugin/**' - '!.claude-plugin/**' - '!gemini-extension.json' + has_non_lp_mip_changes: + - '**' + - '!cpp/src/math_optimization/**' + - '!cpp/src/pdlp/**' + - '!cpp/src/dual_simplex/**' + - '!cpp/src/cuts/**' + - '!cpp/src/barrier/**' + - '!cpp/src/mip_heuristics/**' + - '!cpp/src/branch_and_bound/**' + - '!cpp/tests/dual_simplex/**' + - '!cpp/tests/linear_programming/**' + - '!cpp/tests/mip/**' checks: secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@main @@ -305,6 +317,8 @@ jobs: script-env-secret-2-value: ${{ secrets.CUOPT_AWS_ACCESS_KEY_ID }} script-env-secret-3-key: CUOPT_AWS_SECRET_ACCESS_KEY script-env-secret-3-value: ${{ secrets.CUOPT_AWS_SECRET_ACCESS_KEY }} + script-env-secret-4-key: SKIP_ROUTING_TESTS + script-env-secret-4-value: ${{ (!fromJSON(needs.changed-files.outputs.changed_file_groups).has_non_lp_mip_changes) && 'true' || 'false' }} conda-python-build: needs: [conda-cpp-build, compute-matrix-filters] secrets: inherit @@ -329,6 +343,8 @@ jobs: script-env-secret-2-value: ${{ secrets.CUOPT_AWS_ACCESS_KEY_ID }} script-env-secret-3-key: CUOPT_AWS_SECRET_ACCESS_KEY script-env-secret-3-value: ${{ secrets.CUOPT_AWS_SECRET_ACCESS_KEY }} + script-env-secret-4-key: SKIP_ROUTING_TESTS + script-env-secret-4-value: ${{ (!fromJSON(needs.changed-files.outputs.changed_file_groups).has_non_lp_mip_changes) && 'true' || 'false' }} docs-build: needs: [conda-python-build, changed-files] secrets: inherit @@ -390,6 +406,8 @@ jobs: script-env-secret-2-value: ${{ secrets.CUOPT_AWS_ACCESS_KEY_ID }} script-env-secret-3-key: CUOPT_AWS_SECRET_ACCESS_KEY script-env-secret-3-value: ${{ secrets.CUOPT_AWS_SECRET_ACCESS_KEY }} + script-env-secret-4-key: SKIP_ROUTING_TESTS + script-env-secret-4-value: ${{ (!fromJSON(needs.changed-files.outputs.changed_file_groups).has_non_lp_mip_changes) && 'true' || 'false' }} wheel-build-cuopt-server: needs: [checks, compute-matrix-filters] secrets: inherit @@ -430,11 +448,13 @@ jobs: script-env-secret-2-value: ${{ secrets.CUOPT_AWS_ACCESS_KEY_ID }} script-env-secret-3-key: CUOPT_AWS_SECRET_ACCESS_KEY script-env-secret-3-value: ${{ secrets.CUOPT_AWS_SECRET_ACCESS_KEY }} + script-env-secret-4-key: SKIP_ROUTING_TESTS + script-env-secret-4-value: ${{ (!fromJSON(needs.changed-files.outputs.changed_file_groups).has_non_lp_mip_changes) && 'true' || 'false' }} test-self-hosted-server: needs: [wheel-build-cuopt, wheel-build-cuopt-server, changed-files] secrets: inherit uses: ./.github/workflows/self_hosted_service_test.yaml - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheels + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheels && fromJSON(needs.changed-files.outputs.changed_file_groups).has_non_lp_mip_changes with: build_type: pull-request script: ci/test_self_hosted_service.sh diff --git a/ci/run_ctests.sh b/ci/run_ctests.sh index fc1de8e1b4..35ce8082ea 100755 --- a/ci/run_ctests.sh +++ b/ci/run_ctests.sh @@ -21,8 +21,29 @@ else exit 1 fi +# Routing test binaries to skip when SKIP_ROUTING_TESTS is set +ROUTING_TESTS=( + ROUTING_TEST + ROUTING_GES_TEST + VEHICLE_ORDER_TEST + VEHICLE_TYPES_TEST + OBJECTIVE_FUNCTION_TEST + RETAIL_L1TEST + ROUTING_L1TEST + ROUTING_UNIT_TEST + WAYPOINT_MATRIXTEST +) + for gt in "${GTEST_DIR}"/*_TEST; do test_name=$(basename "${gt}") + if [[ "${SKIP_ROUTING_TESTS:-}" == "true" ]]; then + for routing_test in "${ROUTING_TESTS[@]}"; do + if [[ "${test_name}" == "${routing_test}" ]]; then + echo "Skipping routing gtest ${test_name} (SKIP_ROUTING_TESTS=true)" + continue 2 + fi + done + fi echo "Running gtest ${test_name}" "${gt}" "$@" done diff --git a/ci/run_cuopt_pytests.sh b/ci/run_cuopt_pytests.sh index 66e996715a..67face399a 100755 --- a/ci/run_cuopt_pytests.sh +++ b/ci/run_cuopt_pytests.sh @@ -9,4 +9,10 @@ set -euo pipefail # Support invoking run_cuopt_pytests.sh outside the script directory cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cuopt/cuopt/ -pytest -s --cache-clear "$@" tests +PYTEST_ARGS=("$@") +if [[ "${SKIP_ROUTING_TESTS:-}" == "true" ]]; then + echo "Skipping routing tests (SKIP_ROUTING_TESTS=true)" + PYTEST_ARGS+=("--ignore=tests/routing") +fi + +pytest -s --cache-clear "${PYTEST_ARGS[@]}" tests diff --git a/ci/run_cuopt_server_pytests.sh b/ci/run_cuopt_server_pytests.sh index 4cb361a473..7d5da45442 100755 --- a/ci/run_cuopt_server_pytests.sh +++ b/ci/run_cuopt_server_pytests.sh @@ -9,4 +9,19 @@ set -euo pipefail # Support invoking run_cuopt_server_pytests.sh outside the script directory cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cuopt_server/cuopt_server/ -pytest -s --cache-clear "$@" tests +PYTEST_ARGS=("$@") +if [[ "${SKIP_ROUTING_TESTS:-}" == "true" ]]; then + echo "Skipping routing tests (SKIP_ROUTING_TESTS=true)" + PYTEST_ARGS+=( + "--ignore=tests/test_server.py" + "--ignore=tests/test_set_cost_matrix.py" + "--ignore=tests/test_set_cost_waypoint_graph.py" + "--ignore=tests/test_set_fleet_data.py" + "--ignore=tests/test_set_task_data.py" + "--ignore=tests/test_set_travel_time_waypoint_graph.py" + "--ignore=tests/test_initial_solutions.py" + "--ignore=tests/test_multi_cost.py" + ) +fi + +pytest -s --cache-clear "${PYTEST_ARGS[@]}" tests diff --git a/ci/test_cpp.sh b/ci/test_cpp.sh index 653c44133a..761162e175 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -40,9 +40,11 @@ rapids-logger "Download datasets" RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" export RAPIDS_DATASET_ROOT_DIR -pushd "${RAPIDS_DATASET_ROOT_DIR}" -./get_test_data.sh -popd +if [[ "${SKIP_ROUTING_TESTS:-}" != "true" ]]; then + pushd "${RAPIDS_DATASET_ROOT_DIR}" + ./get_test_data.sh + popd +fi EXITCODE=0 trap "EXITCODE=1" ERR diff --git a/ci/test_python.sh b/ci/test_python.sh index 4f91c83334..8a9be1b03d 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -40,9 +40,11 @@ RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" export RAPIDS_DATASET_ROOT_DIR ./datasets/linear_programming/download_pdlp_test_dataset.sh ./datasets/mip/download_miplib_test_dataset.sh -pushd "${RAPIDS_DATASET_ROOT_DIR}" -./get_test_data.sh -popd +if [[ "${SKIP_ROUTING_TESTS:-}" != "true" ]]; then + pushd "${RAPIDS_DATASET_ROOT_DIR}" + ./get_test_data.sh + popd +fi rapids-logger "Check GPU usage" nvidia-smi diff --git a/ci/test_wheel_cuopt.sh b/ci/test_wheel_cuopt.sh index d761b27214..51e7bb91c7 100755 --- a/ci/test_wheel_cuopt.sh +++ b/ci/test_wheel_cuopt.sh @@ -45,10 +45,12 @@ fi ./datasets/linear_programming/download_pdlp_test_dataset.sh ./datasets/mip/download_miplib_test_dataset.sh -cd ./datasets -./get_test_data.sh --solomon -./get_test_data.sh --tsp -cd - +if [[ "${SKIP_ROUTING_TESTS:-}" != "true" ]]; then + cd ./datasets + ./get_test_data.sh --solomon + ./get_test_data.sh --tsp + cd - +fi RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" export RAPIDS_DATASET_ROOT_DIR