Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[buildkite] Fix lint test in buildkite pipeline #4280

Merged
merged 16 commits into from
Jul 25, 2024
27 changes: 18 additions & 9 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,24 @@ steps:
- |-
make clean install-vendor-m3 services tools
<<: *common
# - name: "Lint"
# command: make clean lint
# env:
# CGO_ENABLED: 0
# plugins:
# docker-compose#v2.5.1:
# run: app
# workdir: /go/src/github.com/m3db/m3
# <<: *common
- name: "Lint"
env:
CGO_ENABLED: 0
GIMME_GO_VERSION: 1.18.x
plugins:
docker-compose#v2.5.1:
run: app
workdir: /go/src/github.com/m3db/m3
kubernetes:
<<: *kubernetes
podSpec:
<<: *podSpec
containers:
- <<: *commandContainer
command:
- |-
make clean lint
<<: *common
# - name: "Integration (:docker:)"
# command: make clean install-vendor-m3 docker-integration-test
# parallelism: 2
Expand Down
3 changes: 1 addition & 2 deletions src/aggregator/integration/integration_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"github.com/m3db/m3/src/metrics/metric/aggregated"
metricid "github.com/m3db/m3/src/metrics/metric/id"
"github.com/m3db/m3/src/metrics/metric/unaggregated"
"github.com/m3db/m3/src/metrics/pipeline"
mpipeline "github.com/m3db/m3/src/metrics/pipeline"
"github.com/m3db/m3/src/metrics/pipeline/applied"
"github.com/m3db/m3/src/metrics/policy"
Expand Down Expand Up @@ -137,7 +136,7 @@ var (
Operations: []applied.OpUnion{
{
Type: mpipeline.TransformationOpType,
Transformation: pipeline.TransformationOp{
Transformation: mpipeline.TransformationOp{
Type: transformation.Absolute,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/m3db/m3/src/metrics/metric/aggregated"
metricid "github.com/m3db/m3/src/metrics/metric/id"
"github.com/m3db/m3/src/metrics/metric/unaggregated"

"github.com/stretchr/testify/require"
"go.uber.org/zap"
)
Expand Down
7 changes: 4 additions & 3 deletions src/dbnode/x/encoding/shallow_cloner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ func TestCloneMultiReaderIterator(t *testing.T) {
f := newFixture(t)
defer f.ctrl.Finish()

f.shallowCloner.cloneBlockReaderFn = func(b xio.BlockReader, _ xtime.UnixNano, _ time.Duration) (xio.BlockReader, error) {
return b, nil
}
f.shallowCloner.cloneBlockReaderFn =
func(b xio.BlockReader, _ xtime.UnixNano, _ time.Duration) (xio.BlockReader, error) {
return b, nil
}

testBlockSize := time.Hour
now := time.Now()
Expand Down
8 changes: 5 additions & 3 deletions src/integration/resources/docker/dockerexternal/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
xerrors "github.com/m3db/m3/src/x/errors"
"github.com/m3db/m3/src/x/instrument"
"github.com/m3db/m3/src/x/retry"

"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
clientv3 "go.etcd.io/etcd/client/v3"
Expand Down Expand Up @@ -221,14 +222,15 @@ func (c *EtcdNode) containerClientHostPort() string {

var ipAddress string
_, err := net.ResolveIPAddr("ip4", "host.docker.internal")
if err == nil && runtime.GOOS == "darwin" {
switch {
case err == nil && runtime.GOOS == "darwin":
c.logger.Info("Running on Mac; using 127.0.0.1 to talk to etcd")
ipAddress = "127.0.0.1"
} else if err == nil {
case err == nil:
c.logger.Info("Running tests within a docker container (e.g. for buildkite. " +
"Using host.docker.internal to talk to etcd")
ipAddress = "host.docker.internal"
} else {
default:
c.logger.Info("Running tests in environment without host.docker.internal set. Using 127.0.0.1 to talk to etcd")
ipAddress = "127.0.0.1"
}
Expand Down
15 changes: 15 additions & 0 deletions src/metrics/rules/active_ruleset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ func TestActiveRuleSetForwardMatchWithAnyKeepOriginal(t *testing.T) {
}
}

//nolint:dupl
func TestActiveRuleSetForwardMatchWithRollupRules(t *testing.T) {
inputs := []testMatchInput{
{
Expand Down Expand Up @@ -1496,8 +1497,10 @@ func TestActiveRuleSetForwardMatchWithRollupRules(t *testing.T) {
}
}

//nolint:dupl
func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
inputs := []testMatchInput{
//nolint:lll
// Test case that has one include tag in the metric id
{
id: "rtagName1=rtagValue1,rtagName2=rtagValue2,rtagName3=rtagValue3,includeThisTag1=includeValue1",
Expand All @@ -1512,6 +1515,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
Metadata: metadata.Metadata{
Pipelines: []metadata.PipelineMetadata{
metadata.DefaultPipelineMetadata,
//nolint:dupl
{
AggregationID: aggregation.MustCompressTypes(aggregation.Sum),
StoragePolicies: policy.StoragePolicies{
Expand All @@ -1529,6 +1533,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
},
}),
},
//nolint:dupl
{
AggregationID: aggregation.MustCompressTypes(aggregation.Last),
StoragePolicies: policy.StoragePolicies{
Expand Down Expand Up @@ -1598,6 +1603,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
},
},
},
//nolint:lll
// Test case that has two include tags in the metric id
{
id: "rtagName1=rtagValue1,rtagName2=rtagValue2,rtagName3=rtagValue3,includeThisTag1=includeValue1,includeThisTag2=includeThisValue2",
Expand All @@ -1612,6 +1618,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
Metadata: metadata.Metadata{
Pipelines: []metadata.PipelineMetadata{
metadata.DefaultPipelineMetadata,
//nolint:dupl
{
AggregationID: aggregation.MustCompressTypes(aggregation.Sum),
StoragePolicies: policy.StoragePolicies{
Expand All @@ -1629,6 +1636,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
},
}),
},
//nolint:dupl
{
AggregationID: aggregation.MustCompressTypes(aggregation.Last),
StoragePolicies: policy.StoragePolicies{
Expand Down Expand Up @@ -1698,6 +1706,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
},
},
},
//nolint:lll
{
id: "rtagName1=rtagValue2,includeThisTag1=includeValue1,includeThisTag2=includeThisValue2",
matchFrom: 25000,
Expand Down Expand Up @@ -1760,6 +1769,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
keepOriginal: false,
forExistingIDResult: metadata.DefaultStagedMetadatas,
},
//nolint:lll
{
id: "rtagName1=rtagValue1,rtagName2=rtagValue2,rtagName3=rtagValue3,includeThisTag1=includeValue1,includeThisTag2=includeThisValue2",
matchFrom: 10000,
Expand All @@ -1783,6 +1793,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
Metadata: metadata.Metadata{
Pipelines: []metadata.PipelineMetadata{
metadata.DefaultPipelineMetadata,
//nolint:dupl
{
AggregationID: aggregation.MustCompressTypes(aggregation.Sum),
StoragePolicies: policy.StoragePolicies{
Expand All @@ -1809,6 +1820,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
Metadata: metadata.Metadata{
Pipelines: []metadata.PipelineMetadata{
metadata.DefaultPipelineMetadata,
//nolint:dupl
{
AggregationID: aggregation.MustCompressTypes(aggregation.Sum),
StoragePolicies: policy.StoragePolicies{
Expand All @@ -1826,6 +1838,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
},
}),
},
//nolint:dupl
{
AggregationID: aggregation.MustCompressTypes(aggregation.Last),
StoragePolicies: policy.StoragePolicies{
Expand Down Expand Up @@ -1857,6 +1870,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
Metadata: metadata.Metadata{
Pipelines: []metadata.PipelineMetadata{
metadata.DefaultPipelineMetadata,
//nolint:dupl
{
AggregationID: aggregation.MustCompressTypes(aggregation.Sum),
StoragePolicies: policy.StoragePolicies{
Expand Down Expand Up @@ -2351,6 +2365,7 @@ func TestActiveRuleSetForwardMatchWithRollupRulesWithIncludeTags(t *testing.T) {
},
},
},
//nolint:lll
//nolint:dupl
{
id: "rtagName1=rtagValue3,rtagName2=rtagValue2,rtagName3=rtagValue3,includeThisTag1=includeValue1,includeThisTag2=includeThisValue2",
Expand Down
4 changes: 2 additions & 2 deletions src/x/process/process_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ func TestNumFDs(t *testing.T) {

func() {
numExpectedFds := numFilesToCreate + stdProcessFiles
cleanupFn := createTempFiles(numFilesToCreate)
defer cleanupFn()
cleanupFnFromFiles := createTempFiles(numFilesToCreate)
defer cleanupFnFromFiles()

selfPID := os.Getpid()

Expand Down