4c1e56ccce
* correct config issues #271 #272 * rename type tags * replace env lib * move to config module * read flags * show e2e logs on error * extract env * replace deprecated env var * increment index * check replica numbers do not start with 0 * remove test suite * error handling * refactor flags * flags test * file test * file test * config tests * extend tests * test mixed mode * simplify * simplify * test mask * correct uniqe replicas * Update types_test.go * e2e test with file mode
26 lines
593 B
Go
26 lines
593 B
Go
package config
|
|
|
|
import (
|
|
"os"
|
|
|
|
. "github.com/onsi/ginkgo/v2"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("Config", func() {
|
|
Context("env", func() {
|
|
Context("enrichReplicasFromEnv", func() {
|
|
It("should have the origin URL from the config env var", func() {
|
|
_ = os.Setenv("REPLICA0_URL", "https://origin-env:443")
|
|
defer func() {
|
|
_ = os.Unsetenv("REPLICA0_URL")
|
|
}()
|
|
_, err := enrichReplicasFromEnv(nil)
|
|
|
|
Ω(err).Should(HaveOccurred())
|
|
Ω(err.Error()).Should(ContainSubstring("numbered replica env variables must have a number id >= 1"))
|
|
})
|
|
})
|
|
})
|
|
})
|