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

Merge remote-tracking branch 'upstream/main' #45

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
53ad0a4
[chore]: enable bool-compare rule from testifylint (#34912)
mmorel-35 Aug 29, 2024
240ff76
[pkg/ottl] Remove tracing from OTTL (#34910)
TylerHelmuth Aug 29, 2024
29cd095
[chore]: enable len rule from testifylint (#34921)
mmorel-35 Aug 30, 2024
0ec84e6
[chore][receiver/nginx] Update README for consistency (#34923)
crobert-1 Aug 30, 2024
184e954
[processor/redaction] add support for redacting metrics and logs attr…
bacherfl Aug 30, 2024
499cfd8
[chore] Fix linter issues (#34937)
mx-psi Aug 30, 2024
903eec5
[receiver/gitproviderreceiver] rename to githubreceiver (#34731)
adrielp Aug 30, 2024
6b3237a
[chore][CODEOWNERS] Change account references to match new username (…
crobert-1 Aug 30, 2024
2d63c17
[chore] refactor filter processor test to use generated test harness …
codeboten Aug 30, 2024
ea521f7
[chore] use generated test harness for groupbyattrs processor (#34941)
codeboten Aug 30, 2024
0216163
[chore] update core to pull in telemetry settings changes (#34930)
codeboten Aug 30, 2024
90e75d3
[receiver/splunkhec] fix memory leak (#34911)
atoulme Aug 30, 2024
dbf8982
[chore] Updating @MovieStoreGuy affiliation (#34947)
MovieStoreGuy Sep 1, 2024
fd0e9ef
[chore]: Update README.md (#34725)
CharlieTLe Sep 2, 2024
33362ee
[connector/servicegraph]Fix incorrectly reversed latency settings(res…
Frapschen Sep 2, 2024
9f0cac0
[chore]: enable error-nil and nil-compare rules from testifylint (#34…
mmorel-35 Sep 2, 2024
13f0d14
[connector/count] fix typo in metric.datapoint.count (#34961)
lhns Sep 2, 2024
255020c
[chore] Upgrade arvo package (#34962)
MovieStoreGuy Sep 3, 2024
439e41e
Update module github.com/shirou/gopsutil/v4 to v4.24.8 (#34970)
renovate[bot] Sep 3, 2024
4558429
Update module github.com/ClickHouse/clickhouse-go/v2 to v2.28.2 (#34968)
renovate[bot] Sep 3, 2024
1c9e54e
Update All github.com/datadog packages to v0.56.2 (#34965)
renovate[bot] Sep 3, 2024
ad02711
Update module github.com/snowflakedb/gosnowflake to v1.11.1 (#34971)
renovate[bot] Sep 3, 2024
a967d83
[exporter/loki] Document the migration from the Loki Exporter to the …
cyrille-leclerc Sep 3, 2024
9545957
[connector/spanmetrics] Improve consistency between metrics generated…
iblancasa Sep 3, 2024
5822332
Update module google.golang.org/grpc to v1.66.0 (#34978)
renovate[bot] Sep 3, 2024
d25990b
[vcenterreceiver] Updated units on several metrics (#34946)
BominRahmani Sep 3, 2024
c6cda87
Update module github.com/SAP/go-hdb to v1.12.0 (#34973)
renovate[bot] Sep 3, 2024
b128c46
[chore][pkg/stanza] Speed up file deduplication in finder (#34888)
BinaryFissionGames Sep 3, 2024
510a413
[receiver/mysql] client, convert NULL to int64 (#34411)
knarfli Sep 3, 2024
bfdee42
[testbed] - Add scenarios to handle large files (#34417)
VihasMakwana Sep 3, 2024
640adad
Avoid rendering the whole event to get only the provider name (#34914)
pjanotti Sep 3, 2024
119ad9b
[chore] add Tyler to CODEOWNERS for githubreceiver (#34963)
adrielp Sep 3, 2024
58b5bb9
Update README.md (#34990)
gjtorikian Sep 3, 2024
f6156a9
[extension/opamp] Add support for polling interval in HTTP client (#3…
matej-g Sep 3, 2024
a77faff
[receiver/apache] Invalid endpoint should not cause panic (#34992)
pjanotti Sep 3, 2024
1ec7cfe
[chore]: enable compares and empty rules from testifylint (#34976)
mmorel-35 Sep 3, 2024
dabacbd
[receiver/githubreceiver] promote githubreceiver to alpha status (#34…
adrielp Sep 3, 2024
902756e
[connector/datadog] Improve performance in cases with many peer tags …
songy23 Sep 3, 2024
ec049ab
[chore] upgrading pulsar client v0.13.1 (#34951)
MovieStoreGuy Sep 3, 2024
a4aa4e8
[processor/interval] Update config structure for interval processor (…
ArthurSens Sep 3, 2024
d0e5eec
[extension/solarwindsapmsettingsextension] Added remaining implementa…
jerrytfleung Sep 3, 2024
5258d98
feat: Support Prometheus Created Timestamps (#34596)
ArthurSens Sep 4, 2024
3afb802
[receiver/sqlquery] support attributes for logs (#34599)
Grandys Sep 4, 2024
9be1f80
[receiver/kafkareceiver]: allow tunable fetch sizes (#34431)
cxdy Sep 4, 2024
2de5752
[exporter/splunkhec] drop empty log events (#34871)
atoulme Sep 4, 2024
a088f60
[exporter/signalfx] Fix goroutine leaks (#32781)
crobert-1 Sep 4, 2024
1ba4179
[chore] make update-otel to 48b11ba (#34956)
mx-psi Sep 4, 2024
33687ee
[chore][receiver/filelog] Change plaintext name: filelog -> file log …
crobert-1 Sep 4, 2024
9e3a845
[chore] Fix flaky test by ignoring metrics order (#35002)
djaglowski Sep 4, 2024
255aebe
fix: handle OTLPJSON unmarshal error (#34784)
rogercoll Sep 4, 2024
548d95f
[chore] Fix flaky test in filelog receiver (#35012)
djaglowski Sep 4, 2024
e393e02
Bump github.com/opencontainers/runc from 1.1.13 to 1.1.14 in /cmd/ote…
dependabot[bot] Sep 4, 2024
a0ea89c
Clarify google managed prometheus troubleshooting guide (#34986)
dashpole Sep 4, 2024
fa4cac5
Update module github.com/lestrrat-go/strftime to v1.1.0 (#34974)
renovate[bot] Sep 4, 2024
93ba625
[chore] Upgrading msgpack v4 to v5 (#35019)
MovieStoreGuy Sep 5, 2024
cb71224
[exporter/elasticsearch] Fix dynamic mapping for double values storin…
carsonip Sep 5, 2024
4c490fe
[exporter/elasticsearch] Add exponential histogram support (#34818)
carsonip Sep 5, 2024
53152f0
[processor/deltatocumulative]: drop bad samples (#34979)
sh0rez Sep 5, 2024
fa75b6e
fix: avoid using internal empty attribute.Set pointer (#34903)
rogercoll Sep 5, 2024
ceeb395
Update example in readme for convert_sum_to_gauge and convert_gauge_t…
wildum Sep 5, 2024
9a31997
[exporter/elasticsearch] Add span event to traces OTel mapping mode (…
carsonip Sep 5, 2024
a4393cb
[opampsupervisor] Add HealthCheckPort configuration parameter (#34704)
dpaasman00 Sep 5, 2024
e0e6489
[pkg/ottl]: Add Sort converter (#34283)
kaisecheng Sep 5, 2024
6e5fd62
[chore] update module github.com/google/go-github/v63 to v64 (#35016)
adrielp Sep 5, 2024
2bc5b37
Update All github.com/aws packages (#34964)
renovate[bot] Sep 5, 2024
0055e6e
[chore]: enable error-is-as rule from testifylint (#34995)
mmorel-35 Sep 5, 2024
85a2f4f
fix(deps): update module github.com/rs/cors to v1.11.1 (#34969)
renovate[bot] Sep 5, 2024
eb329f4
Update module google.golang.org/api to v0.195.0 (#34977)
renovate[bot] Sep 5, 2024
0bcac4b
[extension/healthcheckv2] Update readme to reflect current status (#3…
mwear Sep 5, 2024
562c01d
[connector/servicegraph] Fix histogram metrics miss unit (#34511)
Frapschen Sep 5, 2024
6eaf284
OTel-Arrow exporter timeout propagation (#34733)
jmacd Sep 5, 2024
9ad4ae3
[receiver/skywalking] add receiver supports version (#34916)
JaredTan95 Sep 5, 2024
52b6807
[exporter/prometheusremotewriteexporter]chore: log warning about remo…
ArthurSens Sep 5, 2024
145145c
[chore]: enable expected-actual rule from testifylint (#34998)
mmorel-35 Sep 5, 2024
a733b01
[pkg/ottl] Add `Decode` function (#33942)
bacherfl Sep 5, 2024
97533e6
[chore] Fix Supervisor test on Windows (#35035)
evan-bradley Sep 5, 2024
93a6bd9
[chore] Share encoding overrides (#35029)
TylerHelmuth Sep 5, 2024
55482cb
[chore] update logging to debug exporter (#35030)
codeboten Sep 5, 2024
7ec6396
[receiver/googlecloudmonitoringreceiver] Transform GCP Timeseries Dat…
abhishek-at-cloudwerx Sep 5, 2024
e9b835f
[receiver/sqlserver] Emit correct database name resource attribute (#…
crobert-1 Sep 6, 2024
abb7604
[exporter/elasticsearch] Workaround TSDB array dimension limitation f…
carsonip Sep 6, 2024
d5595bb
[connector/servicegraph] Extract the `getDimensionValue` function as …
JaredTan95 Sep 6, 2024
f970421
Operators with silent errors will log errors as debug and won't retur…
SamerJ Sep 6, 2024
af21ce7
[internal/otelarrow] Fix test flake (for 34719) (#34889)
jmacd Sep 6, 2024
642cc35
[pkg/ottl] Change grammar to support expressing statements context vi…
edmocosta Sep 6, 2024
25cb194
[pkg/ottl] Add support for localized time parsing into the timeutils …
edmocosta Sep 6, 2024
95ff5f2
[processor/transform] introduce aggregate_on_attribute_value function…
odubajDT Sep 6, 2024
14aa57a
[chore] go version 1.22.6 -> 1.22.7 (#35059)
crobert-1 Sep 6, 2024
8c08765
Use OTel-Arrow v0.26.0 (#35057)
jmacd Sep 6, 2024
0e2bea5
fix(deps): update module github.com/tencentcloud/tencentcloud-sdk-go/…
renovate[bot] Sep 6, 2024
237a96b
Add admission_blocked span to otel-arrow admission controller (#35031)
jmacd Sep 9, 2024
be7ddc3
[chore] Bump github.com/opencontainers/runc from 1.1.13 to 1.1.14 in …
crobert-1 Sep 9, 2024
cc5889d
[receiver/kafkareceiver] Add encoding extensions support (#33888)
thmshmm Sep 9, 2024
45ffc03
[chore] [receiver/datadog] Add support for Service Checks (#34474)
alexgreenbank Sep 9, 2024
5e26464
[receiver/datadog] Add support for sketches (#34662)
carrieedwards Sep 9, 2024
f81fd7a
Marking instanaexporter module as deprecated (#35052)
Frapschen Sep 9, 2024
248b8ec
[chore] Fix flakiness of tests on Windows requiring ports in the dyna…
pjanotti Sep 9, 2024
0ceefaa
[exporter/datadog] Use correct hostname for logs in logs agent pipeli…
liustanley Sep 9, 2024
b3e952f
[exporter/datadogexporter] Add support for custom log source (#35051)
mackjmr Sep 9, 2024
bd66ceb
[chore] Update test expectation to include processorhelper metrics (#…
djaglowski Sep 9, 2024
71ce97e
[chore] Fixing Prom Compliance tests (#35071)
MovieStoreGuy Sep 10, 2024
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
Prev Previous commit
Next Next commit
[chore]: enable error-nil and nil-compare rules from testifylint (ope…
…n-telemetry#34936)

#### Description

Testifylint is a linter that provides best practices with the use of
testify.

This PR enables
[error-nil](https://github.com/Antonboom/testifylint?tab=readme-ov-file#error-nil)
and
[nil-compare](https://github.com/Antonboom/testifylint?tab=readme-ov-file#nil-compare)
rules from [testifylint](https://github.com/Antonboom/testifylint)


It also adds testifylint as tool to use with a make command
  • Loading branch information
mmorel-35 committed Sep 2, 2024
commit 9f0cac0cc2d164baf7d8858ddf1473c8ba7d8c1f
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ linters-settings:
- compares
- empty
- error-is-as
- error-nil
- expected-actual
- float-compare
- formatter
- go-require
- negative-positive
- nil-compare
- require-error
- suite-dont-use-pkg
- suite-subtest-run
- useless-assert
enable-all: true

Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ golint:
gogovulncheck:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="govulncheck"

.PHONY: gotestifylint
gotestifylint:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="testifylint"

.PHONY: gotestifylint-fix
gotestifylint-fix:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="testifylint-fix"

.PHONY: goporto
goporto: $(PORTO)
$(PORTO) -w --include-internal --skip-dirs "^cmd$$" ./
Expand Down
11 changes: 11 additions & 0 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ BUILDER := $(TOOLS_BIN_DIR)/builder
GOVULNCHECK := $(TOOLS_BIN_DIR)/govulncheck
GCI := $(TOOLS_BIN_DIR)/gci
GOTESTSUM := $(TOOLS_BIN_DIR)/gotestsum
TESTIFYLINT := $(TOOLS_BIN_DIR)/testifylint

GOTESTSUM_OPT?= --rerun-fails=1
TESTIFYLINT_OPT?= --enable-all --disable=compares,empty,error-is-as,expected-actual,float-compare,formatter,go-require,negative-positive,require-error,suite-dont-use-pkg,suite-subtest-run,useless-assert

# BUILD_TYPE should be one of (dev, release).
BUILD_TYPE?=release
Expand Down Expand Up @@ -220,6 +222,15 @@ misspell-correction: $(TOOLS_BIN_DIR)/misspell
moddownload:
$(GOCMD) mod download

.PHONY: testifylint
testifylint: $(TESTIFYLINT)
@echo "running $(TESTIFYLINT)"
$(TESTIFYLINT) $(TESTIFYLINT_OPT) ./...

.PHONY: testifylint-fix
testifylint-fix:
@$(MAKE) testifylint TESTIFYLINT_OPT="${TESTIFYLINT_OPT} --fix"

.PHONY: gci
gci: $(TOOLS_BIN_DIR)/gci
@echo "running $(GCI)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestNewTracesExporter(t *testing.T) {
// This will put trace data to send buffer and return success.
err = got.ConsumeTraces(context.Background(), traces)
assert.NoError(t, err)
assert.Nil(t, got.Shutdown(context.Background()))
assert.NoError(t, got.Shutdown(context.Background()))
}

func TestNewFailsWithEmptyTracesExporterName(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions exporter/awsemfexporter/emf_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ func TestPushMetricsDataWithErr(t *testing.T) {
metricNames: []string{"metric_1", "metric_2"},
metricValues: [][]float64{{100}, {4}},
})
assert.NotNil(t, exp.pushMetricsData(ctx, md))
assert.NotNil(t, exp.pushMetricsData(ctx, md))
assert.Nil(t, exp.pushMetricsData(ctx, md))
assert.Nil(t, exp.shutdown(ctx))
assert.Error(t, exp.pushMetricsData(ctx, md))
assert.Error(t, exp.pushMetricsData(ctx, md))
assert.NoError(t, exp.pushMetricsData(ctx, md))
assert.NoError(t, exp.shutdown(ctx))
}

func TestNewExporterWithoutConfig(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsemfexporter/grouped_metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ func BenchmarkAddToGroupedMetric(b *testing.B) {
for i := 0; i < numMetrics; i++ {
metadata := generateTestMetricMetadata("namespace", int64(1596151098037), "log-group", "log-stream", "cloudwatch-otel", metrics.At(i).Type())
err := addToGroupedMetric(metrics.At(i), groupedMetrics, metadata, true, nil, testCfg, emfCalcs)
assert.Nil(b, err)
assert.NoError(b, err)
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions exporter/awsemfexporter/metric_translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1984,7 +1984,7 @@ func BenchmarkTranslateOtToGroupedMetricWithInstrLibrary(b *testing.B) {
for n := 0; n < b.N; n++ {
groupedMetric := make(map[any]*groupedMetric)
err := translator.translateOTelToGroupedMetric(rm, groupedMetric, config)
assert.Nil(b, err)
assert.NoError(b, err)
}
}

Expand All @@ -2007,7 +2007,7 @@ func BenchmarkTranslateOtToGroupedMetricWithoutConfigReplacePattern(b *testing.B
for n := 0; n < b.N; n++ {
groupedMetrics := make(map[any]*groupedMetric)
err := translator.translateOTelToGroupedMetric(rm, groupedMetrics, config)
assert.Nil(b, err)
assert.NoError(b, err)
}
}

Expand All @@ -2030,7 +2030,7 @@ func BenchmarkTranslateOtToGroupedMetricWithConfigReplaceWithResource(b *testing
for n := 0; n < b.N; n++ {
groupedMetrics := make(map[any]*groupedMetric)
err := translator.translateOTelToGroupedMetric(rm, groupedMetrics, config)
assert.Nil(b, err)
assert.NoError(b, err)
}
}

Expand All @@ -2053,7 +2053,7 @@ func BenchmarkTranslateOtToGroupedMetricWithConfigReplaceWithLabel(b *testing.B)
for n := 0; n < b.N; n++ {
groupedMetrics := make(map[any]*groupedMetric)
err := translator.translateOTelToGroupedMetric(rm, groupedMetrics, config)
assert.Nil(b, err)
assert.NoError(b, err)
}
}

Expand All @@ -2071,7 +2071,7 @@ func BenchmarkTranslateOtToGroupedMetricWithoutInstrLibrary(b *testing.B) {
for n := 0; n < b.N; n++ {
groupedMetrics := make(map[any]*groupedMetric)
err := translator.translateOTelToGroupedMetric(rm, groupedMetrics, config)
assert.Nil(b, err)
assert.NoError(b, err)
}
}

Expand Down Expand Up @@ -2140,7 +2140,7 @@ func BenchmarkTranslateGroupedMetricToCWMetricWithFiltering(b *testing.B) {
}
logger := zap.NewNop()
err := m.init(logger)
assert.Nil(b, err)
assert.NoError(b, err)
config := &Config{
MetricDeclarations: []*MetricDeclaration{m},
DimensionRollupOption: zeroAndSingleDimensionRollup,
Expand Down
52 changes: 26 additions & 26 deletions exporter/awsxrayexporter/internal/translator/segment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ func TestFixSegmentName(t *testing.T) {

func TestFixAnnotationKey(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", false)
assert.Nil(t, err)
assert.NoError(t, err)

validKey := "Key_1"
fixedKey := fixAnnotationKey(validKey)
Expand All @@ -424,7 +424,7 @@ func TestFixAnnotationKey(t *testing.T) {

func TestFixAnnotationKeyWithAllowDot(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", true)
assert.Nil(t, err)
assert.NoError(t, err)

validKey := "Key_1"
fixedKey := fixAnnotationKey(validKey)
Expand Down Expand Up @@ -585,7 +585,7 @@ func TestSpanWithAttributesSegmentMetadata(t *testing.T) {

func TestResourceAttributesCanBeIndexed(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", false)
assert.Nil(t, err)
assert.NoError(t, err)

spanName := "/api/locations"
parentSpanID := newSegmentID()
Expand Down Expand Up @@ -618,7 +618,7 @@ func TestResourceAttributesCanBeIndexed(t *testing.T) {

func TestResourceAttributesCanBeIndexedWithAllowDot(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", true)
assert.Nil(t, err)
assert.NoError(t, err)

spanName := "/api/locations"
parentSpanID := newSegmentID()
Expand Down Expand Up @@ -672,7 +672,7 @@ func TestResourceAttributesNotIndexedIfSubsegment(t *testing.T) {

func TestSpanWithSpecialAttributesAsListed(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", false)
assert.Nil(t, err)
assert.NoError(t, err)

spanName := "/api/locations"
parentSpanID := newSegmentID()
Expand All @@ -692,7 +692,7 @@ func TestSpanWithSpecialAttributesAsListed(t *testing.T) {

func TestSpanWithSpecialAttributesAsListedWithAllowDot(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", true)
assert.Nil(t, err)
assert.NoError(t, err)

spanName := "/api/locations"
parentSpanID := newSegmentID()
Expand All @@ -712,7 +712,7 @@ func TestSpanWithSpecialAttributesAsListedWithAllowDot(t *testing.T) {

func TestSpanWithSpecialAttributesAsListedAndIndexAll(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", false)
assert.Nil(t, err)
assert.NoError(t, err)

spanName := "/api/locations"
parentSpanID := newSegmentID()
Expand All @@ -731,7 +731,7 @@ func TestSpanWithSpecialAttributesAsListedAndIndexAll(t *testing.T) {

func TestSpanWithSpecialAttributesAsListedAndIndexAllWithAllowDot(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", true)
assert.Nil(t, err)
assert.NoError(t, err)

spanName := "/api/locations"
parentSpanID := newSegmentID()
Expand Down Expand Up @@ -1142,7 +1142,7 @@ func TestAwsSdkSpanWithAwsRemoteServiceName(t *testing.T) {
jsonStr, err := MakeSegmentDocumentString(span, resource, nil, false, nil, false)

assert.NotNil(t, jsonStr)
assert.Nil(t, err)
assert.NoError(t, err)
assert.True(t, strings.Contains(jsonStr, "DynamoDb"))
assert.False(t, strings.Contains(jsonStr, "DynamoDb.PutItem"))
assert.False(t, strings.Contains(jsonStr, user))
Expand Down Expand Up @@ -1336,7 +1336,7 @@ func addSpanLink(span ptrace.Span) {

func TestLocalRootConsumer(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", false)
assert.Nil(t, err)
assert.NoError(t, err)

spanName := "destination operation"
resource := getBasicResource()
Expand All @@ -1352,7 +1352,7 @@ func TestLocalRootConsumer(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 2)
assert.Nil(t, err)
assert.NoError(t, err)

validateLocalRootDependencySubsegment(t, segments[0], span, *segments[1].ID)
assert.Nil(t, segments[0].Links)
Expand Down Expand Up @@ -1383,7 +1383,7 @@ func TestNonLocalRootConsumerProcess(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 1)
assert.Nil(t, err)
assert.NoError(t, err)

tempTraceID := span.TraceID()
expectedTraceID := "1-" + fmt.Sprintf("%x", tempTraceID[0:4]) + "-" + fmt.Sprintf("%x", tempTraceID[4:16])
Expand Down Expand Up @@ -1429,15 +1429,15 @@ func TestLocalRootConsumerAWSNamespace(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 2)
assert.Nil(t, err)
assert.NoError(t, err)

// Ensure that AWS namespace is not overwritten to remote
assert.Equal(t, "aws", *segments[0].Namespace)
}

func TestLocalRootClient(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", false)
assert.Nil(t, err)
assert.NoError(t, err)

spanName := "SQS Get"
resource := getBasicResource()
Expand All @@ -1455,7 +1455,7 @@ func TestLocalRootClient(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 2)
assert.Nil(t, err)
assert.NoError(t, err)

validateLocalRootDependencySubsegment(t, segments[0], span, *segments[1].ID)
assert.Len(t, segments[0].Links, 1)
Expand Down Expand Up @@ -1492,7 +1492,7 @@ func TestLocalRootClientAwsServiceMetrics(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 2)
assert.Nil(t, err)
assert.NoError(t, err)

subsegment := segments[0]

Expand All @@ -1516,7 +1516,7 @@ func TestLocalRootProducer(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 2)
assert.Nil(t, err)
assert.NoError(t, err)

validateLocalRootDependencySubsegment(t, segments[0], span, *segments[1].ID)
assert.Len(t, segments[0].Links, 1)
Expand Down Expand Up @@ -1577,7 +1577,7 @@ func validateLocalRootWithoutDependency(t *testing.T, segment *awsxray.Segment,

func TestLocalRootServer(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", false)
assert.Nil(t, err)
assert.NoError(t, err)

spanName := "MyService"
resource := getBasicResource()
Expand All @@ -1593,14 +1593,14 @@ func TestLocalRootServer(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 1)
assert.Nil(t, err)
assert.NoError(t, err)

validateLocalRootWithoutDependency(t, segments[0], span)
}

func TestLocalRootInternal(t *testing.T) {
err := featuregate.GlobalRegistry().Set("exporter.xray.allowDot", false)
assert.Nil(t, err)
assert.NoError(t, err)

spanName := "MyInternalService"
resource := getBasicResource()
Expand All @@ -1616,7 +1616,7 @@ func TestLocalRootInternal(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 1)
assert.Nil(t, err)
assert.NoError(t, err)

validateLocalRootWithoutDependency(t, segments[0], span)
}
Expand All @@ -1637,7 +1637,7 @@ func TestNotLocalRootInternal(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 1)
assert.Nil(t, err)
assert.NoError(t, err)

// Validate segment
assert.Equal(t, "subsegment", *segments[0].Type)
Expand All @@ -1661,7 +1661,7 @@ func TestNotLocalRootConsumer(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 1)
assert.Nil(t, err)
assert.NoError(t, err)

// Validate segment
assert.Equal(t, "subsegment", *segments[0].Type)
Expand All @@ -1685,7 +1685,7 @@ func TestNotLocalRootClient(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 1)
assert.Nil(t, err)
assert.NoError(t, err)

// Validate segment
assert.Equal(t, "subsegment", *segments[0].Type)
Expand All @@ -1709,7 +1709,7 @@ func TestNotLocalRootProducer(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 1)
assert.Nil(t, err)
assert.NoError(t, err)

// Validate segment
assert.Equal(t, "subsegment", *segments[0].Type)
Expand All @@ -1735,7 +1735,7 @@ func TestNotLocalRootServer(t *testing.T) {

assert.NotNil(t, segments)
assert.Len(t, segments, 1)
assert.Nil(t, err)
assert.NoError(t, err)

// Validate segment
assert.Nil(t, segments[0].Type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ func TestOldSpanLinkError(t *testing.T) {

_, error1 := MakeSegment(span, resource, nil, false, nil, false)

assert.NotNil(t, error1)
assert.Error(t, error1)

_, error2 := MakeSegmentDocumentString(span, resource, nil, false, nil, false)

assert.NotNil(t, error2)
assert.Error(t, error2)
}

func TestTwoSpanLinks(t *testing.T) {
Expand Down
Loading