DEVOPS-2496 add max history setting (#12)

* add history_max setting

* update docs

* use suite for env test
This commit is contained in:
Colin Hoglund
2021-05-19 13:16:43 -04:00
committed by Colin Hoglund
parent a566ea0cf7
commit 8d450bbf7d
6 changed files with 98 additions and 55 deletions

View File

@@ -217,6 +217,15 @@ func (suite *ConfigTestSuite) TestValuesSecretsWithDebugLogging() {
suite.Contains(stderr.String(), `$SECRET_WATER not present in environment, replaced with ""`)
}
func (suite *ConfigTestSuite) TestHistoryMax() {
conf := NewTestConfig(suite.T())
suite.Assert().Equal(10, conf.HistoryMax)
suite.setenv("PLUGIN_HISTORY_MAX", "0")
conf = NewTestConfig(suite.T())
suite.Assert().Equal(0, conf.HistoryMax)
}
func (suite *ConfigTestSuite) setenv(key, val string) {
orig, ok := os.LookupEnv(key)
if ok {