Skip to content

Commit

Permalink
vmtests: use a strict pattern for test execution
Browse files Browse the repository at this point in the history
It is possible that a test is a substring of another. Use a strict
pattern so that we execute only the specified test.

Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
  • Loading branch information
kkourt committed Jan 10, 2024
1 parent e5d133f commit b00a113
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/vmtests/vmtests.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ func Run(cnf *Conf) error {
prog := filepath.Join(testDir, name)
progArgs := []string{"-test.v"}
if test.Test != "" {
t := test.Test
name = fmt.Sprintf("%s.%s", name, t)
name = fmt.Sprintf("%s.%s", name, test.Test)
// It is possible that a test is a substring of another. Use a strict
// pattern so that we execute only the specified test.
t := fmt.Sprintf("^%s$", test.Test)
progArgs = append(progArgs, "-test.run", t)
}

Expand Down

0 comments on commit b00a113

Please sign in to comment.