@@ -117,7 +117,7 @@ func (b *builder) integrationTest() error {
117
117
runFlag := flagSet .String ("run" , "" , "Passed to go test as -run" )
118
118
devServerFlag := flagSet .Bool ("dev-server" , false , "Use an embedded dev server" )
119
119
coverageFileFlag := flagSet .String ("coverage-file" , "" , "If set, enables coverage output to this filename" )
120
- junitFileFlag := flagSet .String ("junitfile" , "" , "If set, a path prefix to which junit-style xml files should be written" )
120
+ junitFileFlag := flagSet .String ("junitfile" , "junit-xml " , "If set, a path prefix to which junit-style xml files should be written" )
121
121
if err := flagSet .Parse (os .Args [2 :]); err != nil {
122
122
return fmt .Errorf ("failed parsing flags: %w" , err )
123
123
}
@@ -172,10 +172,7 @@ func (b *builder) integrationTest() error {
172
172
}
173
173
174
174
// Run integration test
175
- args := []string {"gotestsum" , "-tags" , "protolegacy" , "-count" , "1" , "-race" , "-v" , "-timeout" , "10m" }
176
- if * junitFileFlag != "" {
177
- args = append (args , "--junitfile" , * junitFileFlag + "-integration-test.xml" )
178
- }
175
+ args := []string {"gotestsum" , "--junitfile" , * junitFileFlag + "-integration-test.xml" , "--" , "-tags" , "protolegacy" , "-count" , "1" , "-race" , "-v" , "-timeout" , "10m" }
179
176
if * runFlag != "" {
180
177
args = append (args , "-run" , * runFlag )
181
178
}
@@ -238,7 +235,7 @@ func (b *builder) unitTest() error {
238
235
flagSet := flag .NewFlagSet ("unit-test" , flag .ContinueOnError )
239
236
runFlag := flagSet .String ("run" , "" , "Passed to go test as -run" )
240
237
coverageFlag := flagSet .Bool ("coverage" , false , "If set, enables coverage output" )
241
- junitFileFlag := flagSet .String ("junitfile" , "" , "If set, a path prefix to which junit-style xml files should be written" )
238
+ junitFileFlag := flagSet .String ("junitfile" , "junit-xml " , "If set, a path prefix to which junit-style xml files should be written" )
242
239
if err := flagSet .Parse (os .Args [2 :]); err != nil {
243
240
return fmt .Errorf ("failed parsing flags: %w" , err )
244
241
}
@@ -272,9 +269,10 @@ func (b *builder) unitTest() error {
272
269
log .Printf ("Running unit tests in dirs: %v" , testDirs )
273
270
for _ , testDir := range testDirs {
274
271
// Run unit test
275
- args := []string {"gotestsum" , "-tags" , "protolegacy" , "-count" , "1" , "-race" , "-v" , "-timeout" , "15m" }
276
- if * junitFileFlag != "" {
277
- args = append (args , "--junitfile" , * junitFileFlag + strings .ReplaceAll (testDir , "/" , "-" )+ "unit-test.xml" )
272
+ args := []string {
273
+ "gotestsum" ,
274
+ "--junitfile" , * junitFileFlag + strings .ReplaceAll (testDir , "/" , "-" ) + "unit-test.xml" , "--" ,
275
+ "-tags" , "protolegacy" , "-count" , "1" , "-race" , "-v" , "-timeout" , "15m" ,
278
276
}
279
277
if * runFlag != "" {
280
278
args = append (args , "-run" , * runFlag )
0 commit comments