Revert "feat: Support multiple configuration files" (#395)

Revert "feat: Support multiple configuration files (#389)"

This reverts commit 8e14302765.
This commit is contained in:
TwiN
2023-01-07 03:45:43 -05:00
committed by GitHub
parent 8e14302765
commit 87740e74a6
8 changed files with 54 additions and 178 deletions

View File

@ -29,40 +29,19 @@ import (
)
func TestLoadFileThatDoesNotExist(t *testing.T) {
_, err := LoadConfiguration("file-that-does-not-exist.yaml")
_, err := Load("file-that-does-not-exist.yaml")
if err == nil {
t.Error("Should've returned an error, because the file specified doesn't exist")
}
}
func TestLoadDefaultConfigurationFile(t *testing.T) {
_, err := LoadConfiguration("")
_, err := LoadDefaultConfiguration()
if err == nil {
t.Error("Should've returned an error, because there's no configuration files at the default path nor the default fallback path")
}
}
func TestLoadConfigurationFile(t *testing.T) {
_, err := LoadConfiguration("../test-conf/config.yaml")
if nil != err {
t.Error("Should not have returned an error, because the configuration file exists at the provided path")
}
}
func TestLoadDistributedConfiguration(t *testing.T) {
_, err := LoadConfiguration("../test-conf/conf.d/")
if nil != err {
t.Error("Should not have returned an error, because configuration files exist at the provided path for distributed files")
}
}
func TestLoadCombinedConfiguration(t *testing.T) {
_, err := LoadConfiguration("../test-conf/empty-conf.d/")
if nil == err {
t.Error("Should have returned an error, because the configuration directory does not contain any configuration files")
}
}
func TestParseAndValidateConfigBytes(t *testing.T) {
file := t.TempDir() + "/test.db"
config, err := parseAndValidateConfigBytes([]byte(fmt.Sprintf(`