-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into vits
- Loading branch information
Showing
41 changed files
with
2,757 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,9 @@ on: | |
required: true | ||
type: string | ||
|
||
env: | ||
DD_APPSEC_WAF_TIMEOUT: 1m # Increase time WAF time budget to reduce CI flakiness | ||
|
||
jobs: | ||
copyright: | ||
runs-on: ubuntu-latest | ||
|
@@ -163,7 +166,7 @@ jobs: | |
ports: | ||
- 2181:2181 | ||
kafka: | ||
image: wurstmeister/kafka:2.13-2.8.1 | ||
image: darccio/kafka:2.13-2.8.1 | ||
env: | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 | ||
|
@@ -245,18 +248,26 @@ jobs: | |
- name: Testing outlier gRPC v1.2 | ||
run: | | ||
# This hacky approach is necessary because running the tests regularly | ||
# do not allow using [email protected] alongside [email protected] | ||
# do not allow using [email protected] alongside [email protected]. | ||
# [email protected] is no longer possible to test because internal/datastreams/propagator.go | ||
# expects sketches-go to have the package `github.com/DataDog/sketches-go/ddsketch/encoding` which | ||
# is only present from v1.1.0 onwards. | ||
go mod vendor | ||
# Checkout [email protected] | ||
cd vendor/google.golang.org && rm -rf grpc | ||
git clone https://github.com/grpc/grpc-go grpc && cd grpc | ||
git fetch origin && git checkout v1.2.0 && cd ../.. | ||
git fetch origin && git checkout v1.2.0 && cd ../../.. | ||
# Checkout sketches-go@v1.0.0 | ||
# Checkout sketches-go@v1.1.0 | ||
cd vendor/github.com/DataDog && rm -rf sketches-go | ||
git clone https://github.com/DataDog/sketches-go && cd sketches-go | ||
git fetch origin && git checkout v1.0.0 && cd ../.. | ||
git fetch origin && git checkout v1.1.0 && cd ../../../.. | ||
# Revert to old metadata functions as FromIncomingContext and NewOutgoingContext are not present in v1.2.0. | ||
# These functions were updated to current versions to avoid compilation errors in the development environments. | ||
sed -i 's/metadata\.FromIncomingContext/metadata.FromContext/g' ./contrib/google.golang.org/grpc.v12/* | ||
sed -i 's/metadata\.NewOutgoingContext/metadata.NewContext/g' ./contrib/google.golang.org/grpc.v12/* | ||
go test -mod=vendor -v ./contrib/google.golang.org/grpc.v12/... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016 Datadog, Inc. | ||
|
||
package sql | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig" | ||
) | ||
|
||
func (cfg *config) applyTags() { | ||
cfg.serviceName = "my-svc" | ||
cfg.tags = make(map[string]interface{}) | ||
cfg.tags["tag"] = "value" | ||
} | ||
|
||
func setGlobalCfgTags() { | ||
globalconfig.SetStatsTags([]string{"globaltag:globalvalue"}) | ||
} | ||
|
||
func resetGlobalConfig() { | ||
globalconfig.SetStatsTags([]string{}) | ||
} | ||
|
||
// Test that statsTags(*config) returns tags from the provided *config + whatever is on the globalconfig | ||
func TestStatsTags(t *testing.T) { | ||
t.Run("default none", func(t *testing.T) { | ||
resetGlobalConfig() | ||
cfg := new(config) | ||
tags := statsTags(cfg) | ||
assert.Len(t, tags, 0) | ||
}) | ||
t.Run("cfg only", func(t *testing.T) { | ||
resetGlobalConfig() | ||
cfg := new(config) | ||
cfg.applyTags() | ||
tags := statsTags(cfg) | ||
assert.Len(t, tags, 2) | ||
assert.Contains(t, tags, "service:my-svc") | ||
assert.Contains(t, tags, "tag:value") | ||
}) | ||
t.Run("inherit globalconfig", func(t *testing.T) { | ||
resetGlobalConfig() | ||
cfg := new(config) | ||
setGlobalCfgTags() | ||
tags := statsTags(cfg) | ||
assert.Len(t, tags, 1) | ||
assert.Contains(t, tags, "globaltag:globalvalue") | ||
}) | ||
t.Run("both", func(t *testing.T) { | ||
resetGlobalConfig() | ||
cfg := new(config) | ||
cfg.applyTags() | ||
setGlobalCfgTags() | ||
tags := statsTags(cfg) | ||
assert.Len(t, tags, 3) | ||
assert.Contains(t, tags, "globaltag:globalvalue") | ||
assert.Contains(t, tags, "service:my-svc") | ||
assert.Contains(t, tags, "tag:value") | ||
}) | ||
resetGlobalConfig() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.