Skip to content

Commit

Permalink
Merge pull request #243 from form3tech-oss/nvloff-test-log
Browse files Browse the repository at this point in the history
chore: cleanup test output
  • Loading branch information
nvloff-f3 authored May 27, 2024
2 parents 878e6db + 2b23741 commit 4057079
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions internal/chart/chart_cmd_stage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"
"time"

"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"

"github.com/form3tech-oss/f1/v2/internal/console"
Expand All @@ -22,6 +23,8 @@ type ChartTestStage struct {

func NewChartTestStage(t *testing.T) (*ChartTestStage, *ChartTestStage, *ChartTestStage) {
t.Helper()
logrus.SetLevel(logrus.WarnLevel)

stage := &ChartTestStage{
t: t,
assert: assert.New(t),
Expand Down
2 changes: 1 addition & 1 deletion internal/run/run_stage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (s *RunTestStage) the_command_should_have_run_for_approx(expectedDuration t
}

func (s *RunTestStage) the_number_of_started_iterations_should_be(expected uint32) *RunTestStage {
s.assert.Equal(expected, s.runCount.Load(), "number of started iterations")
s.assert.Equal(int(expected), int(s.runCount.Load()), "number of started iterations")
return s
}

Expand Down
2 changes: 2 additions & 0 deletions internal/trigger/file/file_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"
"time"

"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -414,6 +415,7 @@ stages:

func TestFileRate_FileErrors(t *testing.T) {
t.Parallel()
logrus.SetLevel(logrus.WarnLevel)

for _, test := range []struct {
fileContent, expectedError string
Expand Down
4 changes: 2 additions & 2 deletions internal/trigger/file/file_rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"time"

log "github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"

"github.com/form3tech-oss/f1/v2/internal/trace"
Expand Down Expand Up @@ -79,7 +79,7 @@ func readFile(filename string) (*[]byte, error) {
}
defer func() {
if err = file.Close(); err != nil {
log.WithError(err).Error("unable to close the config file")
logrus.WithError(err).Error("unable to close the config file")
}
}()

Expand Down
4 changes: 2 additions & 2 deletions internal/trigger/gaussian/gaussian_rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"time"

log "github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"github.com/spf13/pflag"

"github.com/form3tech-oss/f1/v2/internal/gaussian"
Expand Down Expand Up @@ -97,7 +97,7 @@ func Rate() api.Builder {
}
if peakRate != "" {
if volume != defaultVolume {
log.Warn("--peak-rate is provided, the value given for --volume will be ignored")
logrus.Warn("--peak-rate is provided, the value given for --volume will be ignored")
}
volume, err = calculateVolume(peakRate, peakDuration, stddevDuration)
if err != nil {
Expand Down

0 comments on commit 4057079

Please sign in to comment.