Skip to content

Commit 22081e7

Browse files
CelianRchouetz
andauthored
Removed circle ci comments (#36424)
Co-authored-by: Nicolas Schweitzer <nicolas.schweitzer@datadoghq.com>
1 parent d91c1b4 commit 22081e7

File tree

5 files changed

+6
-40
lines changed

5 files changed

+6
-40
lines changed

comp/trace/config/config_test.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -585,20 +585,13 @@ func TestFullYamlConfig(t *testing.T) {
585585
assert.False(t, cfg.OTLPReceiver.IgnoreMissingDatadogFields)
586586
assert.Equal(t, map[string]string{"a": "b", "and:colons": "in:values", "c": "d", "with.dots": "in.side"}, cfg.OTLPReceiver.SpanNameRemappings)
587587

588-
noProxy := true
589-
if _, ok := os.LookupEnv("NO_PROXY"); ok {
590-
// Happens in CircleCI: if the environment variable is set,
591-
// it will overwrite our loaded configuration and will cause
592-
// this test to fail.
593-
noProxy = false
594-
}
595588
assert.ElementsMatch(t, []*traceconfig.Endpoint{
596589
{Host: "https://datadog.unittests", APIKey: "api_key_test"},
597590
{Host: "https://my1.endpoint.com", APIKey: "apikey1"},
598591
{Host: "https://my1.endpoint.com", APIKey: "apikey2"},
599-
{Host: "https://my2.endpoint.eu", APIKey: "apikey3", NoProxy: noProxy},
600-
{Host: "https://my2.endpoint.eu", APIKey: "apikey4", NoProxy: noProxy},
601-
{Host: "https://my2.endpoint.eu", APIKey: "apikey5", NoProxy: noProxy},
592+
{Host: "https://my2.endpoint.eu", APIKey: "apikey3", NoProxy: true},
593+
{Host: "https://my2.endpoint.eu", APIKey: "apikey4", NoProxy: true},
594+
{Host: "https://my2.endpoint.eu", APIKey: "apikey5", NoProxy: true},
602595
}, cfg.Endpoints)
603596

604597
assert.ElementsMatch(t, []*traceconfig.Tag{{K: "env", V: "prod"}, {K: "db", V: "mongodb"}}, cfg.RequireTags)

pkg/collector/corechecks/system/filehandles/file_handles_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func TestFhCheckLinux(t *testing.T) {
4242
defer os.Remove(tmpFile.Name()) // clean up
4343

4444
fileNrHandle = writeSampleFile(tmpFile, samplecontent1)
45-
t.Logf("Testing from file %s", fileNrHandle) // To pass circle ci tests
45+
t.Logf("Testing from file %s", fileNrHandle)
4646

4747
// we have to init the mocked sender here before fileHandleCheck.Configure(mock.GetSenderManager(), integration.FakeConfigHash, ...)
4848
// (and append it to the aggregator, which is automatically done in NewMockSender)
@@ -76,7 +76,7 @@ func TestFhCheckLinux(t *testing.T) {
7676
defer os.Remove(tmpFile.Name()) // clean up
7777

7878
fileNrHandle = writeSampleFile(tmpFile, samplecontent2)
79-
t.Logf("Testing from file %s", fileNrHandle) // To pass circle ci tests
79+
t.Logf("Testing from file %s", fileNrHandle)
8080

8181
mock.On("Gauge", "system.fs.file_handles.allocated", 800.0, "", []string(nil)).Return().Times(1)
8282
mock.On("Gauge", "system.fs.file_handles.allocated_unused", 453.0, "", []string(nil)).Return().Times(1)

pkg/config/setup/config_secret_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ func TestProxyWithSecret(t *testing.T) {
158158

159159
for _, c := range cases {
160160
t.Run(c.name, func(t *testing.T) {
161-
// CircleCI sets NO_PROXY, so unset it for this test
162-
unsetEnvForTest(t, "NO_PROXY")
163161

164162
config := newTestConf(t)
165163
config.SetWithoutSource("use_proxy_for_cloud_metadata", true)

pkg/config/setup/config_test.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,6 @@ import (
2929
"github.com/DataDog/datadog-agent/pkg/util/scrubber"
3030
)
3131

32-
func unsetEnvForTest(t *testing.T, env string) {
33-
oldValue, ok := os.LookupEnv(env)
34-
os.Unsetenv(env)
35-
36-
t.Cleanup(func() {
37-
if !ok {
38-
os.Unsetenv(env)
39-
} else {
40-
os.Setenv(env, oldValue)
41-
}
42-
})
43-
}
44-
4532
func confFromYAML(t *testing.T, yamlConfig string) pkgconfigmodel.Config {
4633
conf := newTestConf(t)
4734
conf.SetConfigType("yaml")
@@ -450,8 +437,6 @@ func TestProxy(t *testing.T) {
450437

451438
for _, c := range cases {
452439
t.Run(c.name, func(t *testing.T) {
453-
// CircleCI sets NO_PROXY, so unset it for this test
454-
unsetEnvForTest(t, "NO_PROXY")
455440

456441
config := newTestConf(t)
457442
config.SetWithoutSource("use_proxy_for_cloud_metadata", c.proxyForCloudMetadata)
@@ -1199,8 +1184,6 @@ process_config:
11991184
`)
12001185

12011186
func TestConfigAssignAtPath(t *testing.T) {
1202-
// CircleCI sets NO_PROXY, so unset it for this test
1203-
unsetEnvForTest(t, "NO_PROXY")
12041187

12051188
config := newTestConf(t)
12061189
config.SetWithoutSource("use_proxy_for_cloud_metadata", true)
@@ -1257,8 +1240,6 @@ use_proxy_for_cloud_metadata: true
12571240
}
12581241

12591242
func TestConfigAssignAtPathWorksWithGet(t *testing.T) {
1260-
// CircleCI sets NO_PROXY, so unset it for this test
1261-
unsetEnvForTest(t, "NO_PROXY")
12621243

12631244
config := newTestConf(t)
12641245
config.SetWithoutSource("use_proxy_for_cloud_metadata", true)
@@ -1301,8 +1282,6 @@ secret_backend_arguments:
13011282
`)
13021283

13031284
func TestConfigAssignAtPathSimple(t *testing.T) {
1304-
// CircleCI sets NO_PROXY, so unset it for this test
1305-
unsetEnvForTest(t, "NO_PROXY")
13061285

13071286
config := newTestConf(t)
13081287
config.SetWithoutSource("use_proxy_for_cloud_metadata", true)
@@ -1332,8 +1311,6 @@ use_proxy_for_cloud_metadata: true
13321311
}
13331312

13341313
func TestConfigMustMatchOrigin(t *testing.T) {
1335-
// CircleCI sets NO_PROXY, so unset it for this test
1336-
unsetEnvForTest(t, "NO_PROXY")
13371314

13381315
testMinimalConf := []byte(`apm_config:
13391316
apm_dd_url: ENC[some_url]
@@ -1409,8 +1386,6 @@ use_proxy_for_cloud_metadata: true
14091386
}
14101387

14111388
func TestConfigAssignAtPathForIntMapKeys(t *testing.T) {
1412-
// CircleCI sets NO_PROXY, so unset it for this test
1413-
unsetEnvForTest(t, "NO_PROXY")
14141389

14151390
// Even if a map is using keys that looks like stringified ints, calling
14161391
// configAssignAtPath will still work correctly

tasks/go.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def run_golangci_lint(
6767

6868
_, _, env = get_build_flags(ctx, rtloader_root=rtloader_root, headless_mode=headless_mode)
6969
verbosity = "-v" if verbose else ""
70-
# we split targets to avoid going over the memory limit from circleCI
70+
# we split targets to reduce memory usage
7171
results = []
7272
time_results = []
7373
for target in targets:

0 commit comments

Comments
 (0)