Moving diagnostics into a service (#14832)

* Moving diagnostics into a service

* Fixing golint checks

* Fixing tests

* Renaming from diagnostics to telemetry

* Adding missing files

* Initializing telemetry earlier in the server startup

* Fixing tests

* Adding a log for the telemetryID initialization error

* Addressing PR review comments

* Fixing merge problem

* Removing some extra Diagnostics mentions

* Making tests pass
Этот коммит содержится в:
Jesús Espino
2020-09-08 20:30:54 +02:00
коммит произвёл GitHub
родитель f0eb67fa0d
Коммит 44079785eb
28 изменённых файлов: 1019 добавлений и 688 удалений

Просмотреть файл

@@ -18,7 +18,7 @@ func TestGetClientConfig(t *testing.T) {
testCases := []struct {
description string
config *model.Config
diagnosticID string
telemetryID string
license *model.License
expectedFields map[string]string
}{
@@ -190,7 +190,7 @@ func TestGetClientConfig(t *testing.T) {
testCase.license.Features.SetDefaults()
}
configMap := config.GenerateClientConfig(testCase.config, testCase.diagnosticID, testCase.license)
configMap := config.GenerateClientConfig(testCase.config, testCase.telemetryID, testCase.license)
for expectedField, expectedValue := range testCase.expectedFields {
actualValue, ok := configMap[expectedField]
if assert.True(t, ok, fmt.Sprintf("config does not contain %v", expectedField)) {
@@ -206,7 +206,7 @@ func TestGetLimitedClientConfig(t *testing.T) {
testCases := []struct {
description string
config *model.Config
diagnosticID string
telemetryID string
license *model.License
expectedFields map[string]string
}{
@@ -269,7 +269,7 @@ func TestGetLimitedClientConfig(t *testing.T) {
testCase.license.Features.SetDefaults()
}
configMap := config.GenerateLimitedClientConfig(testCase.config, testCase.diagnosticID, testCase.license)
configMap := config.GenerateLimitedClientConfig(testCase.config, testCase.telemetryID, testCase.license)
for expectedField, expectedValue := range testCase.expectedFields {
actualValue, ok := configMap[expectedField]
if assert.True(t, ok, fmt.Sprintf("config does not contain %v", expectedField)) {