Update cargo.rs to allow debugging of integration test annotated with the ignore attribute (#42574)

Address #40429

If an integration test is annotated with the ignore attribute, allow the
"debug: Test" option of the debug scenario or Code Action to run with
"--include-ignored"

Closes #40429

Release Notes:

- N/A
This commit is contained in:
mikeHag
2025-11-13 12:31:23 +01:00
committed by GitHub
parent 99016e3a85
commit 34a7cfb2e5
@@ -148,6 +148,8 @@ impl DapLocator for CargoLocator {
.first()
.is_some_and(|arg| arg == "test" || arg == "t");
let is_ignored = build_config.args.contains(&"--include-ignored".to_owned());
let executables = output
.lines()
.filter(|line| !line.trim().is_empty())
@@ -205,6 +207,9 @@ impl DapLocator for CargoLocator {
let mut args: Vec<_> = test_name.into_iter().collect();
if is_test {
args.push("--nocapture".to_owned());
if is_ignored {
args.push("--include-ignored".to_owned());
}
}
Ok(DebugRequest::Launch(task::LaunchRequest {