feat: add DNSWATCHER_SEND_TEST_NOTIFICATION env var
All checks were successful
check / check (push) Successful in 4s
All checks were successful
check / check (push) Successful in 4s
When set to a truthy value, sends a startup status notification to all configured notification channels after the first full scan completes. The notification is clearly an all-ok/success message showing the number of monitored domains, hostnames, ports, and certificates. Closes #84
This commit is contained in:
@@ -55,6 +55,7 @@ func TestNew_DefaultValues(t *testing.T) {
|
||||
assert.Empty(t, cfg.SentryDSN)
|
||||
assert.Empty(t, cfg.MetricsUsername)
|
||||
assert.Empty(t, cfg.MetricsPassword)
|
||||
assert.False(t, cfg.SendTestNotification)
|
||||
}
|
||||
|
||||
func TestNew_EnvironmentOverrides(t *testing.T) {
|
||||
@@ -73,6 +74,7 @@ func TestNew_EnvironmentOverrides(t *testing.T) {
|
||||
t.Setenv("DNSWATCHER_MAINTENANCE_MODE", "true")
|
||||
t.Setenv("DNSWATCHER_METRICS_USERNAME", "admin")
|
||||
t.Setenv("DNSWATCHER_METRICS_PASSWORD", "secret")
|
||||
t.Setenv("DNSWATCHER_SEND_TEST_NOTIFICATION", "true")
|
||||
|
||||
cfg, err := config.New(nil, newTestParams(t))
|
||||
require.NoError(t, err)
|
||||
@@ -90,6 +92,7 @@ func TestNew_EnvironmentOverrides(t *testing.T) {
|
||||
assert.True(t, cfg.MaintenanceMode)
|
||||
assert.Equal(t, "admin", cfg.MetricsUsername)
|
||||
assert.Equal(t, "secret", cfg.MetricsPassword)
|
||||
assert.True(t, cfg.SendTestNotification)
|
||||
}
|
||||
|
||||
func TestNew_NoTargetsError(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user