Add CTest labels for selective C++ test execution#1102
Add CTest labels for selective C++ test execution#1102rgsl888prabhu wants to merge 6 commits intoNVIDIA:mainfrom
Conversation
…+ test execution
Add domain and tier labels to all 31 C++ test executables so that CI and
developers can run only the tests relevant to their changes.
Labels:
- Domain: routing, solver (LP+MIP+QP umbrella), lp, mip, qp, grpc, parser, cli
- Tier: tier1 (fast unit tests), tier2 (slow integration/benchmarks)
Changes:
- Extend ConfigureTest() CMake macro with optional LABELS keyword argument
- Add register_test_labels() helper and CUOPT_TEST_LABEL_ENTRIES global
property to generate an installed test_labels.txt manifest
- Add labels to every ConfigureTest call and manual add_test call
- Update ci/run_ctests.sh to support CUOPT_TEST_LABELS env var for
filtering (e.g. CUOPT_TEST_LABELS=routing runs only routing tests)
- Fully backward compatible: no labels set means all tests run
- Remove tier1/tier2 labels — keep only domain labels for simplicity - Add solver label to MPS_PARSER_TEST so CUOPT_TEST_LABELS=solver includes it alongside LP/MIP/QP tests - Update run_ctests.sh docs to reflect final label set
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughConfigureTest CMake function gained optional LABELS parsing; many test registrations were updated to set CTest LABELS (mostly "numopt" or "routing"). No build/link/install behavior or source code logic was changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ci/run_ctests.sh`:
- Around line 70-75: Token strings produced from CUOPT_TEST_LABELS and
test_labels (read into arrays requested/actual and iterated as req and act) may
contain leading/trailing whitespace, so trim both req and act before comparing
them to avoid false negatives; update the comparison in run_ctests.sh to
normalize (trim) whitespace from req and act (e.g., with bash parameter
expansion or a lightweight trim function) and then perform the equality check,
ensuring both sides are trimmed every loop.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 92d3fd29-a6cb-48f4-85d3-b5fb562102dd
📒 Files selected for processing (11)
ci/run_ctests.shcpp/libmps_parser/tests/CMakeLists.txtcpp/tests/CMakeLists.txtcpp/tests/distance_engine/CMakeLists.txtcpp/tests/dual_simplex/CMakeLists.txtcpp/tests/linear_programming/CMakeLists.txtcpp/tests/linear_programming/grpc/CMakeLists.txtcpp/tests/mip/CMakeLists.txtcpp/tests/qp/CMakeLists.txtcpp/tests/routing/CMakeLists.txtcpp/tests/utilities/CMakeLists.txt
solver was ambiguous since routing is also a solver. mathopt (mathematical optimization) clearly scopes the LP/MIP/QP/dual-simplex/parser family.
|
The label choices seem good to me. They will probably evolve a bit over time. I'm not sure I understand the need for the extra code to generate a |
I was thinking to use this for testing so if we are missing any label from testing so it can be raised, but this would be helpful as well. Will remove it for now. |
Collapse all sub-domain labels into just routing and numopt. Remove register_test_labels, global property, and test_labels.txt manifest generation — keep only CTest labels.
Summary
routingandnumopt— to all C++ test executablesConfigureTest()CMake macro with optionalLABELSkeyword (backward compatible)routingnumoptUsage
Test plan
cmake --buildsucceedsctest -L routingruns only routing testsctest -L numoptruns only numopt tests