-
Notifications
You must be signed in to change notification settings - Fork 161
[FEA] Add selective test execution for PR builds #931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bala-bhargav
wants to merge
16
commits into
NVIDIA:main
Choose a base branch
from
bala-bhargav:feat/ci-selective-test-execution-861
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b93bd54
feat(ci): add selective test execution for PR builds (#861)
bala-bhargav 09489bf
refactor(ci): use changed-files action and extract shared component l…
bala-bhargav 60af7c6
Merge branch 'main' into feat/ci-selective-test-execution-861
rgsl888prabhu 1e33a30
fix(ci): address review comments - MIP→LP cascade and narrow include …
bala-bhargav 675eac2
Merge branch 'release/26.04' into feat/ci-selective-test-execution-861
rgsl888prabhu a39469c
fix tests
rgsl888prabhu 616ab1b
add changes
rgsl888prabhu 88eb4cc
Merge branch 'release/26.04' into feat/ci-selective-test-execution-861
rgsl888prabhu 620ec72
Address review changes
rgsl888prabhu 11d3454
Merge branch 'feat/ci-selective-test-execution-861' of github.com:bal…
rgsl888prabhu 808ff45
update
rgsl888prabhu b59a15b
fix style
rgsl888prabhu 47bc15e
move files
rgsl888prabhu c0eeb44
updates
rgsl888prabhu cf79254
Merge branch 'main' into feat/ci-selective-test-execution-861
rgsl888prabhu 52a11a4
Merge branch 'main' into feat/ci-selective-test-execution-861
rgsl888prabhu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Derives CUOPT_TEST_COMPONENTS from changed-files env vars | ||
| # (CUOPT_ROUTING_CHANGED, CUOPT_LP_CHANGED, CUOPT_MIP_CHANGED). | ||
| # | ||
| # When none of these env vars are set (e.g. nightly / non-PR builds), | ||
| # defaults to "all" so every test runs. | ||
| # | ||
| # Usage: source ./ci/utils/derive_test_components.sh | ||
|
|
||
| if [[ -z "${CUOPT_ROUTING_CHANGED:-}" && -z "${CUOPT_LP_CHANGED:-}" && -z "${CUOPT_MIP_CHANGED:-}" ]]; then | ||
| export CUOPT_TEST_COMPONENTS="all" | ||
| else | ||
| components="" | ||
| [[ "${CUOPT_ROUTING_CHANGED:-}" == "true" ]] && components="${components:+${components},}routing" | ||
| [[ "${CUOPT_LP_CHANGED:-}" == "true" ]] && components="${components:+${components},}lp" | ||
| [[ "${CUOPT_MIP_CHANGED:-}" == "true" ]] && components="${components:+${components},}mip" | ||
| # MIP is validated through LP tests (no separate MIP Python tests), | ||
| # so always include LP when MIP changes. | ||
| if [[ "${CUOPT_MIP_CHANGED:-}" == "true" && "${components}" != *"lp"* ]]; then | ||
| components="${components:+${components},}lp" | ||
| fi | ||
| # Fallback to "all" if all components are false (defensive — the job-level | ||
| # 'if' gate in pr.yaml would normally skip the job entirely in this case). | ||
| export CUOPT_TEST_COMPONENTS="${components:-all}" | ||
| fi | ||
| echo "CUOPT_TEST_COMPONENTS=${CUOPT_TEST_COMPONENTS}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Downloads test datasets based on CUOPT_TEST_COMPONENTS. | ||
| # Sources derive_test_components.sh to set CUOPT_TEST_COMPONENTS if not already set. | ||
| # | ||
| # Usage: source ./ci/utils/download_test_datasets.sh | ||
| # | ||
| # Optional env vars: | ||
| # CUOPT_ROUTING_DATASET_ARGS — extra args for routing get_test_data.sh (e.g. "--solomon --tsp") | ||
| # Defaults to no args (downloads all routing data). | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" | ||
|
|
||
| # Derive CUOPT_TEST_COMPONENTS from changed-files env vars (no-op if already set) | ||
| if [[ -z "${CUOPT_TEST_COMPONENTS:-}" ]]; then | ||
| source "${SCRIPT_DIR}/derive_test_components.sh" | ||
| fi | ||
|
|
||
| RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" | ||
| export RAPIDS_DATASET_ROOT_DIR | ||
|
|
||
| if [[ "${CUOPT_TEST_COMPONENTS}" == "all" || "${CUOPT_TEST_COMPONENTS}" == *"lp"* ]]; then | ||
| ./datasets/linear_programming/download_pdlp_test_dataset.sh | ||
| else | ||
| echo "Skipping LP dataset download (not needed for components: ${CUOPT_TEST_COMPONENTS})" | ||
| fi | ||
|
|
||
| if [[ "${CUOPT_TEST_COMPONENTS}" == "all" || "${CUOPT_TEST_COMPONENTS}" == *"mip"* ]]; then | ||
| ./datasets/mip/download_miplib_test_dataset.sh | ||
| else | ||
| echo "Skipping MIP dataset download (not needed for components: ${CUOPT_TEST_COMPONENTS})" | ||
| fi | ||
|
|
||
| if [[ "${CUOPT_TEST_COMPONENTS}" == "all" || "${CUOPT_TEST_COMPONENTS}" == *"routing"* ]]; then | ||
| pushd "${RAPIDS_DATASET_ROOT_DIR}" | ||
| # shellcheck disable=SC2086 | ||
| ./get_test_data.sh ${CUOPT_ROUTING_DATASET_ARGS:-} | ||
| popd | ||
| else | ||
| echo "Skipping routing dataset downloads (not needed for components: ${CUOPT_TEST_COMPONENTS})" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/bin/bash | ||
|
|
||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Export changed-file group flags from pr.yaml, then run a test script from the repo root. | ||
| # | ||
| # RAPIDS reusable workflows (conda-*-tests, wheels-test) run the job `script` as unquoted | ||
| # $INPUTS_SCRIPT, so multiline shell is word-split and breaks. In pr.yaml use a folded | ||
| # block scalar (>-) so this invocation is one physical line to Actions but readable: | ||
| # | ||
| # script: >- | ||
| # ci/utils/run_with_pr_changed_components.sh | ||
| # ${{ fromJSON(needs.changed-files.outputs.changed_file_groups).test_routing || fromJSON(needs.changed-files.outputs.changed_file_groups).test_shared }} | ||
| # ${{ fromJSON(needs.changed-files.outputs.changed_file_groups).test_lp || fromJSON(needs.changed-files.outputs.changed_file_groups).test_shared }} | ||
| # ${{ fromJSON(needs.changed-files.outputs.changed_file_groups).test_mip || fromJSON(needs.changed-files.outputs.changed_file_groups).test_shared }} | ||
| # ci/test_example.sh | ||
| # | ||
| # Optional extra args are forwarded to the test script. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| export CUOPT_ROUTING_CHANGED="${1}" | ||
| export CUOPT_LP_CHANGED="${2}" | ||
| export CUOPT_MIP_CHANGED="${3}" | ||
| shift 3 | ||
|
|
||
| cd "$(dirname "${BASH_SOURCE[0]}")/../.." | ||
| exec bash "$@" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.