Skip to content

Commit 0e7c89e

Browse files
committed
fix some linter warnings
1 parent dd2d3f7 commit 0e7c89e

File tree

7 files changed

+8
-15
lines changed

7 files changed

+8
-15
lines changed

cmd/benchi/main.go

-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ func (m testModel) doneCmd() tea.Cmd {
498498

499499
func (m testModel) Update(msg tea.Msg) (testModel, tea.Cmd) {
500500
switch msg := msg.(type) {
501-
502501
case testModelMsgDone:
503502
return m, nil
504503

dockerutil/config_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515
package dockerutil
1616

1717
import (
18-
"context"
1918
"reflect"
2019
"testing"
2120
)
2221

2322
func TestComposeConfigCmd(t *testing.T) {
24-
ctx := context.Background()
23+
ctx := t.Context()
2524

2625
tests := []struct {
2726
name string

dockerutil/down_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515
package dockerutil
1616

1717
import (
18-
"context"
1918
"reflect"
2019
"testing"
2120
)
2221

2322
func TestComposeDownCmd(t *testing.T) {
24-
ctx := context.Background()
23+
ctx := t.Context()
2524

2625
tests := []struct {
2726
name string

dockerutil/ps_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515
package dockerutil
1616

1717
import (
18-
"context"
1918
"reflect"
2019
"testing"
2120
)
2221

2322
func TestComposePsCmd(t *testing.T) {
24-
ctx := context.Background()
23+
ctx := t.Context()
2524

2625
tests := []struct {
2726
name string

dockerutil/pull_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515
package dockerutil
1616

1717
import (
18-
"context"
1918
"reflect"
2019
"testing"
2120
)
2221

2322
func TestComposePullCmd(t *testing.T) {
24-
ctx := context.Background()
23+
ctx := t.Context()
2524

2625
tests := []struct {
2726
name string

dockerutil/up_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515
package dockerutil
1616

1717
import (
18-
"context"
1918
"reflect"
2019
"testing"
2120
)
2221

2322
func TestComposeUpCmd(t *testing.T) {
24-
ctx := context.Background()
23+
ctx := t.Context()
2524

2625
tests := []struct {
2726
name string

runner.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ import (
3232
"github.com/conduitio/benchi/config"
3333
"github.com/conduitio/benchi/dockerutil"
3434
"github.com/conduitio/benchi/metrics"
35-
"github.com/docker/docker/client"
36-
"github.com/sourcegraph/conc/pool"
37-
3835
_ "github.com/conduitio/benchi/metrics/conduit"
3936
_ "github.com/conduitio/benchi/metrics/prometheus"
37+
"github.com/docker/docker/client"
38+
"github.com/sourcegraph/conc/pool"
4039
)
4140

4241
const (
@@ -384,7 +383,7 @@ func (r *TestRunner) runTest(ctx context.Context) (err error) {
384383
defer logTicker.Stop()
385384

386385
for {
387-
logger.Info("Test in progress", "time-left", endTestAt.Sub(time.Now()).Truncate(time.Second))
386+
logger.Info("Test in progress", "time-left", time.Until(endTestAt).Truncate(time.Second))
388387
select {
389388
case <-ctx.Done():
390389
if !errors.Is(ctx.Err(), context.DeadlineExceeded) {

0 commit comments

Comments
 (0)