Skip to content

Commit cddae59

Browse files
committed
utils/compose: change service command to []string
1 parent c62dd11 commit cddae59

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

e2e/forwarder/service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func HttpbinService() *Service {
5353
return &Service{
5454
Name: HttpbinServiceName,
5555
Image: Image,
56-
Command: "test httpbin",
56+
Command: []string{"test", "httpbin"},
5757
Environment: map[string]string{
5858
"FORWARDER_API_ADDRESS": ":10000",
5959
},
@@ -64,7 +64,7 @@ func GRPCTestService() *Service {
6464
s := &Service{
6565
Name: GRPCTestServiceName,
6666
Image: Image,
67-
Command: "test grpc",
67+
Command: []string{"test", "grpc"},
6868
Environment: map[string]string{
6969
"FORWARDER_ADDRESS": ":1443",
7070
},

e2e/run.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
package main
88

99
import (
10-
"bytes"
1110
"context"
1211
"flag"
1312
"fmt"
@@ -128,17 +127,19 @@ func testService(s *setup.Setup) *compose.Service {
128127
run = s.Run
129128
}
130129

131-
var cmd bytes.Buffer
130+
var cmd []string
132131
if *args.debug {
133-
cmd.WriteString("-test.v ")
132+
cmd = append(cmd, "-test.v")
134133
}
135-
fmt.Fprintf(&cmd, "-test.run %q -test.shuffle on -services %s",
136-
run, strings.Join(maps.Keys(s.Compose.Services), ","))
134+
cmd = append(cmd,
135+
"-test.run", run,
136+
"-test.shuffle", "on",
137+
"-services", strings.Join(maps.Keys(s.Compose.Services), ","))
137138

138139
c := &compose.Service{
139140
Name: setup.TestServiceName,
140141
Image: "forwarder-e2e",
141-
Command: cmd.String(),
142+
Command: cmd,
142143
Environment: map[string]string{
143144
"GOMAXPROCS": "1",
144145
},

utils/compose/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type ServiceNetwork struct {
1818
type Service struct {
1919
Name string `yaml:"-"`
2020
Image string `yaml:"image,omitempty"`
21-
Command string `yaml:"command,omitempty"`
21+
Command []string `yaml:"command,omitempty"`
2222
Environment map[string]string `yaml:"environment,omitempty"`
2323
Ports []string `yaml:"ports,omitempty"`
2424
Volumes []string `yaml:"volumes,omitempty"`

0 commit comments

Comments
 (0)