feat(channels): add auto-disable-only channel test mode (#6728)

This commit is contained in:
Seefs
2026-08-10 12:47:44 +08:00
committed by GitHub
parent 823e26304a
commit 5d3423bec1
13 changed files with 146 additions and 11 deletions
@@ -41,3 +41,17 @@ func TestGetMonitorSetting_ChannelTestEnabledEnvCanEnableDisabledConfig(t *testi
assert.True(t, setting.AutoTestChannelEnabled)
assert.Equal(t, float64(12), setting.AutoTestChannelMinutes)
}
func TestGetMonitorSettingPreservesAutoBanOnlyMode(t *testing.T) {
orig := monitorSetting
t.Cleanup(func() { monitorSetting = orig })
t.Setenv("CHANNEL_TEST_ENABLED", "")
t.Setenv("CHANNEL_TEST_FREQUENCY", "")
monitorSetting = MonitorSetting{ChannelTestMode: ChannelTestModeAutoBanOnly}
setting := GetMonitorSetting()
require.NotNil(t, setting)
assert.Equal(t, ChannelTestModeAutoBanOnly, setting.ChannelTestMode)
}