Skip to content

Commit

Permalink
[chore]: enable whitespace linter for testbed (#36289)
Browse files Browse the repository at this point in the history
#### Description

[whitespace](https://golangci-lint.run/usage/linters/#whitespace) is a
linter that checks for unnecessary newlines at the start and end of
functions.

Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 authored Nov 11, 2024
1 parent 474eb71 commit 64bcbb3
Show file tree
Hide file tree
Showing 16 changed files with 0 additions and 21 deletions.
2 changes: 0 additions & 2 deletions testbed/correctnesstests/connectors/correctness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func TestGoldenData(t *testing.T) {
t.Run(sampleTest.TestName, func(t *testing.T) {
testWithGoldenDataset(t, sampleTest.DataSender, sampleTest.DataReceiver, sampleTest.ResourceSpec, sampleTest.DataConnector, processors)
})

}

func testWithGoldenDataset(
Expand Down Expand Up @@ -96,5 +95,4 @@ func testWithGoldenDataset(
3*time.Second, "all data items received")

tc.StopAgent()

}
1 change: 0 additions & 1 deletion testbed/correctnesstests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func CreateConfigYaml(
connector testbed.DataConnector,
processors []ProcessorNameAndConfigBody,
) string {

// Prepare extra processor config section and comma-separated list of extra processor
// names to use in corresponding "processors" settings.
processorsSections := ""
Expand Down
1 change: 0 additions & 1 deletion testbed/datasenders/jaeger.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func (s *protoGRPCSender) pushTraces(
ctx context.Context,
td ptrace.Traces,
) error {

batches := jaeger.ProtoFromTraces(td)

if s.metadata.Len() > 0 {
Expand Down
1 change: 0 additions & 1 deletion testbed/datasenders/syslog.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ func (f *SyslogWriter) SendCheck() error {
if err != nil {
return nil
}

}
return nil
}
Expand Down
1 change: 0 additions & 1 deletion testbed/datasenders/tcpudp.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func (f *TCPUDPWriter) SendCheck() error {
if err != nil {
return nil
}

}
return nil
}
Expand Down
2 changes: 0 additions & 2 deletions testbed/testbed/child_process_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ func expandExeFileName(exeName string) string {
// the process to.
// cmdArgs is the command line arguments to pass to the process.
func (cp *childProcessCollector) Start(params StartParams) error {

cp.name = params.Name
cp.doneSignal = make(chan struct{})
cp.resourceSpec = params.resourceSpec
Expand Down Expand Up @@ -249,7 +248,6 @@ func (cp *childProcessCollector) Stop() (stopped bool, err error) {
return false, nil
}
cp.stopOnce.Do(func() {

if !cp.isStarted {
// Process wasn't started, nothing to stop.
return
Expand Down
1 change: 0 additions & 1 deletion testbed/testbed/data_providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ func (dp *perfTestDataProvider) GenerateTraces() (ptrace.Traces, bool) {

traceID := dp.traceIDSequence.Add(1)
for i := 0; i < dp.options.ItemsPerBatch; i++ {

startTime := time.Now().Add(time.Duration(i+int(traceID)*1000) * time.Second)
endTime := startTime.Add(time.Millisecond)

Expand Down
1 change: 0 additions & 1 deletion testbed/testbed/mock_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ func (tc *MockTraceConsumer) ConsumeTraces(_ context.Context, td ptrace.Traces)
// Ignore the seqnums for now. We will use them later.
_ = spanSeqnum
_ = traceSeqnum

}
}
}
Expand Down
1 change: 0 additions & 1 deletion testbed/testbed/test_case.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,5 +345,4 @@ func (tc *TestCase) AgentLogsContains(text string) bool {

res, _ := grep.Output()
return string(res) != ""

}
2 changes: 0 additions & 2 deletions testbed/testbed/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func (v *LogPresentValidator) Validate(tc *TestCase) {
}

func (v *LogPresentValidator) RecordResults(tc *TestCase) {

var result string
if tc.t.Failed() {
result = "FAIL"
Expand Down Expand Up @@ -418,7 +417,6 @@ func (v *CorrectnessTestValidator) diffSpanLinks(sentSpan ptrace.Span, recdSpan
}
v.assertionFailures = append(v.assertionFailures, af)
}

}
}
if sentSpan.DroppedLinksCount() != recdSpan.DroppedLinksCount() {
Expand Down
1 change: 0 additions & 1 deletion testbed/tests/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
)

func TestIdleMode(t *testing.T) {

options := testbed.LoadOptions{DataItemsPerSecond: 10_000, ItemsPerBatch: 10}
dataProvider := testbed.NewPerfTestDataProvider(options)

Expand Down
1 change: 0 additions & 1 deletion testbed/tests/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ func TestLogOtlpSendingQueue(t *testing.T) {
nil,
nil)
})

}

func TestLogLargeFiles(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion testbed/tests/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ func TestMetric10kDPS(t *testing.T) {
)
})
}

}

func TestMetricsFromFile(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion testbed/tests/resource_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ type resourceProcessorTestCase struct {
}

func getResourceProcessorTestCases() []resourceProcessorTestCase {

tests := []resourceProcessorTestCase{
{
name: "update_and_rename_existing_attributes",
Expand Down
2 changes: 0 additions & 2 deletions testbed/tests/scenarios.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func createConfigYaml(
processors []ProcessorNameAndConfigBody,
extensions map[string]string,
) string {

// Create a config. Note that our DataSender is used to generate a config for Collector's
// receiver and our DataReceiver is used to generate a config for Collector's exporter.
// This is because our DataSender sends to Collector's receiver and our DataReceiver
Expand Down Expand Up @@ -271,7 +270,6 @@ func Scenario1kSPSWithAttrs(t *testing.T, args []string, tests []TestCase, proce
test := tests[i]

t.Run(fmt.Sprintf("%d*%dbytes", test.attrCount, test.attrSizeByte), func(t *testing.T) {

options := constructLoadOptions(test)

agentProc := testbed.NewChildProcessCollector(testbed.WithEnvVar("GOMAXPROCS", "2"))
Expand Down
2 changes: 0 additions & 2 deletions testbed/tests/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ func TestTrace10kSPSJaegerGRPC(t *testing.T) {
}

func TestTraceNoBackend10kSPS(t *testing.T) {

limitProcessors := []ProcessorNameAndConfigBody{
{
Name: "memory_limiter",
Expand Down Expand Up @@ -277,7 +276,6 @@ func verifySingleSpan(
spanName string,
verifyReceived func(span ptrace.Span),
) {

// Clear previously received traces.
tc.MockBackend.ClearReceivedItems()
startCounter := tc.MockBackend.DataItemsReceived()
Expand Down

0 comments on commit 64bcbb3

Please sign in to comment.