go: Fix regression by restoring regex to match tests (#17645)
This fixes a regression that snuck in with #17108. When running a single test with `go test` the regex wouldn't be used anymore. This restores the old behavior. Release Notes: - Fixed a regression when running Go tests. A recent change dropped the regex used to match single test names when using `go test` in tasks to run tests. That could lead to more or the wrong tests being run. This restores the old behavior.
This commit is contained in:
parent
929eff815c
commit
bf64c0899f
1 changed files with 7 additions and 1 deletions
|
@ -518,7 +518,13 @@ impl ContextProvider for GoContextProvider {
|
||||||
GO_PACKAGE_TASK_VARIABLE.template_value(),
|
GO_PACKAGE_TASK_VARIABLE.template_value(),
|
||||||
VariableName::Symbol.template_value(),
|
VariableName::Symbol.template_value(),
|
||||||
),
|
),
|
||||||
command: format!("go test -run {}", VariableName::Symbol.template_value(),),
|
command: "go".into(),
|
||||||
|
args: vec![
|
||||||
|
"test".into(),
|
||||||
|
GO_PACKAGE_TASK_VARIABLE.template_value(),
|
||||||
|
"-run".into(),
|
||||||
|
format!("^{}\\$", VariableName::Symbol.template_value(),),
|
||||||
|
],
|
||||||
tags: vec!["go-test".to_owned()],
|
tags: vec!["go-test".to_owned()],
|
||||||
cwd: package_cwd.clone(),
|
cwd: package_cwd.clone(),
|
||||||
..TaskTemplate::default()
|
..TaskTemplate::default()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue