Skip to content

Commit

Permalink
Fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasv committed May 28, 2019
1 parent 561a647 commit 70bf239
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions test/e2e/spinup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (c *cmdExec) Start(stdout io.Writer, stderr io.Writer) error {

func (c *cmdExec) Kill() error { return c.Process.Signal(syscall.SIGKILL) }

func (c *cmdExec) String() string { return fmt.Sprintf("%s %s", c.Path, c.Args[1]) }
func (c *cmdExec) String() string { return fmt.Sprintf("%s %v", c.Path, c.Args[1:]) }

type cmdScheduleFunc func(workDir string) ([]Exec, error)

Expand Down Expand Up @@ -151,16 +151,6 @@ func receiver(i int, config string) cmdScheduleFunc {
}
}

func querier(i int, replicaLabel string, staticStores ...string) cmdScheduleFunc {
return func(_ string) ([]Exec, error) {
args := defaultQuerierFlags(i, replicaLabel)
for _, s := range staticStores {
args = append(args, "--store", s)
}
return []Exec{newCmdExec(exec.Command("thanos", args...))}, nil
}
}

func querierWithStoreFlags(i int, replicaLabel string, storesAddresses ...string) cmdScheduleFunc {
return func(_ string) ([]Exec, error) {
args := defaultQuerierFlags(i, replicaLabel)
Expand Down Expand Up @@ -343,7 +333,6 @@ func (c *sameProcessGRPCServiceExec) Start(stdout io.Writer, stderr io.Writer) e
srvChan <- err
_, _ = c.stderr.Write([]byte(fmt.Sprintf("server failed: %s", err)))
}

}()
c.srvChan = srvChan
return nil
Expand All @@ -356,6 +345,7 @@ func (c *sameProcessGRPCServiceExec) Wait() error {
}
return err
}

func (c *sameProcessGRPCServiceExec) Kill() error {
c.cancel()
c.srv.Stop()
Expand Down Expand Up @@ -557,7 +547,8 @@ func defaultQuerierFlags(i int, replicaLabel string) []string {
}

func defaultRulerFlags(i int, dbDir string, ruleDir string) []string {
return []string{"rule",
return []string{
"rule",
"--debug.name", fmt.Sprintf("rule-%d", i),
"--label", fmt.Sprintf(`replica="%d"`, i),
"--data-dir", dbDir,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/store_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestStoreGatewayQuery(t *testing.T) {
exit, err := newSpinupSuite().
WithPreStartedMinio(s3Config).
Add(storeGateway(1, config)).
Add(querier(1, "replica", storeGatewayGRPC(1))).
Add(querierWithStoreFlags(1, "replica", storeGatewayGRPC(1))).
Exec(t, ctx, "test_store_gateway_query")
if err != nil {
t.Errorf("spinup failed: %v", err)
Expand Down

0 comments on commit 70bf239

Please sign in to comment.