Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ resource.syso
.gocache
test-results.json
.metrics/
.mockery.log
15 changes: 7 additions & 8 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,28 @@ packages:
SpanProcessor:
github.com/jaegertracing/jaeger/crossdock/services:
interfaces:
AgentService:
CollectorService:
QueryService:
github.com/jaegertracing/jaeger/pkg/cassandra:
github.com/jaegertracing/jaeger/internal/storage/cassandra:
config:
unroll-variadic: false
interfaces:
Iterator:
Query:
Session:
github.com/jaegertracing/jaeger/pkg/distributedlock:
github.com/jaegertracing/jaeger/internal/distributedlock:
config:
all: true
github.com/jaegertracing/jaeger/pkg/es:
github.com/jaegertracing/jaeger/internal/storage/elasticsearch:
config:
all: true
github.com/jaegertracing/jaeger/pkg/es/client:
github.com/jaegertracing/jaeger/internal/storage/elasticsearch/client:
config:
all: true
github.com/jaegertracing/jaeger/pkg/kafka/consumer:
github.com/jaegertracing/jaeger/internal/storage/kafka/consumer:
interfaces:
Consumer:
github.com/jaegertracing/jaeger/plugin/sampling/leaderelection:
github.com/jaegertracing/jaeger/internal/leaderelection:
config:
all: true
github.com/jaegertracing/jaeger/internal/storage/v1/grpc/shared:
Expand Down Expand Up @@ -83,4 +83,3 @@ packages:
interfaces:
CoreSpanReader:
CoreSpanWriter:

3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ init-submodules:
MOCKERY_FLAGS := --all --disable-version-string
.PHONY: generate-mocks
generate-mocks: $(MOCKERY)
$(MOCKERY)
find . -path '*/mocks/*' -name '*.go' -type f -delete
$(MOCKERY) | tee .mockery.log

.PHONY: certs
certs:
Expand Down
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
// Copyright (c) 2017 Uber Technologies, Inc.
// SPDX-License-Identifier: Apache-2.0

package mocks
package services

import (
"github.com/crossdock/crossdock-go"
"github.com/stretchr/testify/mock"
)

// T is an autogenerated mock type for the T type
type T struct {
// TMock is an autogenerated mock type for the crossdock.T type.
// Correction: it used to be auto-generated, but now is't fixed.
type TMock struct {
mock.Mock
}

// Behavior provides a mock function with given fields:
func (_m *T) Behavior() string {
func (_m *TMock) Behavior() string {
ret := _m.Called()

var r0 string
Expand All @@ -29,7 +30,7 @@ func (_m *T) Behavior() string {
}

// Param provides a mock function with given fields: key
func (_m *T) Param(key string) string {
func (_m *TMock) Param(key string) string {
ret := _m.Called(key)

var r0 string
Expand All @@ -43,36 +44,36 @@ func (_m *T) Param(key string) string {
}

// Tag provides a mock function with given fields: key, value
func (_m *T) Tag(key string, value string) {
func (_m *TMock) Tag(key string, value string) {
_m.Called(key, value)
}

// Errorf provides a mock function with given fields: format, args
func (_m *T) Errorf(format string, args ...interface{}) {
func (_m *TMock) Errorf(format string, args ...any) {
_m.Called(format, args)
}

// Skipf provides a mock function with given fields: format, args
func (_m *T) Skipf(format string, args ...interface{}) {
func (_m *TMock) Skipf(format string, args ...any) {
_m.Called(format, args)
}

// Successf provides a mock function with given fields: format, args
func (_m *T) Successf(format string, args ...interface{}) {
func (_m *TMock) Successf(format string, args ...any) {
_m.Called(format, args)
}

// Fatalf provides a mock function with given fields: format, args
func (_m *T) Fatalf(format string, args ...interface{}) {
func (_m *TMock) Fatalf(format string, args ...any) {
_m.Called(format, args)
}

// FailNow provides a mock function with given fields:
func (_m *T) FailNow() {
func (_m *TMock) FailNow() {
_m.Called()
}

// Put provides a mock function with given fields: status, output
func (_m *T) Put(status crossdock.Status, output string) {
func (_m *TMock) Put(status crossdock.Status, output string) {
_m.Called(status, output)
}
12 changes: 6 additions & 6 deletions crossdock/services/tracehandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ func TestAdaptiveSamplingTestInternal(t *testing.T) {
for i, test := range tests {
t.Run(strconv.Itoa(i), func(t *testing.T) {
query := &mocks.QueryService{}
agent := &mocks.AgentService{}
agent := &mocks.CollectorService{}

handler := &TraceHandler{
agent: agent,
Expand Down Expand Up @@ -450,8 +450,8 @@ func TestAdaptiveSamplingTestInternal(t *testing.T) {

func TestEndToEndTest(t *testing.T) {
query := &mocks.QueryService{}
agent := &mocks.AgentService{}
cT := &mocks.T{}
agent := &mocks.CollectorService{}
cT := &TMock{}
handler := NewTraceHandler(query, agent, zap.NewNop())
handler.getTracesSleepDuration = time.Millisecond

Expand Down Expand Up @@ -489,8 +489,8 @@ func TestAdaptiveSamplingTest(t *testing.T) {
defer server.Close()

query := &mocks.QueryService{}
agent := &mocks.AgentService{}
cT := &mocks.T{}
agent := &mocks.CollectorService{}
cT := &TMock{}
handler := &TraceHandler{
agent: agent,
query: query,
Expand Down Expand Up @@ -528,7 +528,7 @@ func TestAdaptiveSamplingTest(t *testing.T) {
},
}

agent = &mocks.AgentService{}
agent = &mocks.CollectorService{}
handler.agent = agent
agent.On("GetSamplingRate", "go", mock.AnythingOfType("string")).Return(0.222, nil)
// The query service returns an adaptive sampled trace
Expand Down
2 changes: 1 addition & 1 deletion internal/storage/cassandra/mocks/Query.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/storage/cassandra/mocks/Session.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading