feat(tests): add CTest labels for selective C++ test execution#1101
Closed
rgsl888prabhu wants to merge 2 commits intomainfrom
Closed
feat(tests): add CTest labels for selective C++ test execution#1101rgsl888prabhu wants to merge 2 commits intomainfrom
rgsl888prabhu wants to merge 2 commits intomainfrom
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
e3e7510 to
867c4c6
Compare
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughAdds CTest label metadata to many CMake test registrations and generates an installed Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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 docstrings
🧪 Generate unit tests (beta)
Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ConfigureTest()CMake macro with an optionalLABELSkeyword — backward compatible, existing calls work unchangedtest_labels.txtmanifest alongside test binariesci/run_ctests.shto supportCUOPT_TEST_LABELSenv var for filtering (e.g.CUOPT_TEST_LABELS=routingruns only routing tests)Label map
routingsolverlpmipqpparsersolver)grpccliUsage
Design decisions
solverumbrella label because they compile into a singlelibcuopt.sowith 31+ cross-includes — a change in one domain can break the otherslp,mip,qp,parser) are kept for finer local dev iterationTest plan
cmake --buildsucceeds andtest_labels.txtis generated in the build directoryctest -L routingand verify only routing tests executectest -L solverand verify LP+MIP+QP+parser tests executeCUOPT_TEST_LABELS=routing ./ci/run_ctests.shand verify filtering./ci/run_ctests.sh(no env var) and verify all tests run unchangedCUOPT_TEST_LABELSset)🤖 Generated with Claude Code