MM-13027: Don't have a diagnostics segment key in dev builds. (#9938)

* MM-13027: Don't have a diagnostics segment key in dev builds.

* Fix tests.
Этот коммит содержится в:
George Goldberg
2018-12-13 12:31:53 +00:00
коммит произвёл GitHub
родитель dbd3801271
Коммит 487f82f30e
2 изменённых файлов: 19 добавлений и 4 удалений

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

@@ -99,7 +99,7 @@ func TestDiagnostics(t *testing.T) {
})
t.Run("SendDailyDiagnostics", func(t *testing.T) {
th.App.SendDailyDiagnostics()
th.App.sendDailyDiagnostics(true)
info := ""
// Collect the info sent.
@@ -147,10 +147,21 @@ func TestDiagnostics(t *testing.T) {
}
})
t.Run("SendDailyDiagnosticsNoSegmentKey", func(t *testing.T) {
th.App.SendDailyDiagnostics()
select {
case <-data:
t.Fatal("Should not send diagnostics when the segment key is not set")
case <-time.After(time.Second * 1):
// Did not receive diagnostics
}
})
t.Run("SendDailyDiagnosticsDisabled", func(t *testing.T) {
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.LogSettings.EnableDiagnostics = false })
th.App.SendDailyDiagnostics()
th.App.sendDailyDiagnostics(true)
select {
case <-data: