Skip to content

Commit

Permalink
utils/compose: change service command to []string
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatczuk committed Jul 16, 2024
1 parent c62dd11 commit cddae59
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions e2e/forwarder/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func HttpbinService() *Service {
return &Service{
Name: HttpbinServiceName,
Image: Image,
Command: "test httpbin",
Command: []string{"test", "httpbin"},
Environment: map[string]string{
"FORWARDER_API_ADDRESS": ":10000",
},
Expand All @@ -64,7 +64,7 @@ func GRPCTestService() *Service {
s := &Service{
Name: GRPCTestServiceName,
Image: Image,
Command: "test grpc",
Command: []string{"test", "grpc"},
Environment: map[string]string{
"FORWARDER_ADDRESS": ":1443",
},
Expand Down
13 changes: 7 additions & 6 deletions e2e/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package main

import (
"bytes"
"context"
"flag"
"fmt"
Expand Down Expand Up @@ -128,17 +127,19 @@ func testService(s *setup.Setup) *compose.Service {
run = s.Run
}

var cmd bytes.Buffer
var cmd []string
if *args.debug {
cmd.WriteString("-test.v ")
cmd = append(cmd, "-test.v")
}
fmt.Fprintf(&cmd, "-test.run %q -test.shuffle on -services %s",
run, strings.Join(maps.Keys(s.Compose.Services), ","))
cmd = append(cmd,
"-test.run", run,
"-test.shuffle", "on",
"-services", strings.Join(maps.Keys(s.Compose.Services), ","))

c := &compose.Service{
Name: setup.TestServiceName,
Image: "forwarder-e2e",
Command: cmd.String(),
Command: cmd,
Environment: map[string]string{
"GOMAXPROCS": "1",
},
Expand Down
2 changes: 1 addition & 1 deletion utils/compose/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type ServiceNetwork struct {
type Service struct {
Name string `yaml:"-"`
Image string `yaml:"image,omitempty"`
Command string `yaml:"command,omitempty"`
Command []string `yaml:"command,omitempty"`
Environment map[string]string `yaml:"environment,omitempty"`
Ports []string `yaml:"ports,omitempty"`
Volumes []string `yaml:"volumes,omitempty"`
Expand Down

0 comments on commit cddae59

Please sign in to comment.