summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2023-01-23 21:17:56 +0100
committerValery Piashchynski <[email protected]>2023-01-23 21:18:14 +0100
commit36e6fd3b8bf879ccdf66221dda150024768554e1 (patch)
treea270490db6229631b0614327a2dd6a9bd7b175d1 /lib
parent5c99331459f0f4a617bab89e06cfbfe4183ad1ad (diff)
fix: update `boltdb` section
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/roadrunner_test.go27
1 files changed, 23 insertions, 4 deletions
diff --git a/lib/roadrunner_test.go b/lib/roadrunner_test.go
index 42d0964d..4c603c23 100644
--- a/lib/roadrunner_test.go
+++ b/lib/roadrunner_test.go
@@ -16,6 +16,16 @@ func TestNewFailsOnMissingConfig(t *testing.T) {
assert.NotNil(t, err)
}
+const testConfigWithVersion = `
+version: "2.7"
+server:
+ command: "php src/index.php"
+ relay: "pipes"
+
+endure:
+ grace_period: 1s
+`
+
const testConfig = `
server:
command: "php src/index.php"
@@ -33,12 +43,21 @@ func makeConfig(t *testing.T, configYaml string) string {
return cfgFile
}
-func TestNewWithConfig(t *testing.T) {
+func TestNewWithOldConfig(t *testing.T) {
cfgFile := makeConfig(t, testConfig)
+ _, err := lib.NewRR(cfgFile, []string{}, lib.DefaultPluginsList())
+ assert.Error(t, err)
+
+ t.Cleanup(func() {
+ _ = os.Remove(cfgFile)
+ })
+}
+
+func TestNewWithConfig(t *testing.T) {
+ cfgFile := makeConfig(t, testConfigWithVersion)
rr, err := lib.NewRR(cfgFile, []string{}, lib.DefaultPluginsList())
assert.NoError(t, err)
-
- assert.Equal(t, "2", string(rr.Version[0]))
+ assert.Equal(t, 0, len(rr.Version))
t.Cleanup(func() {
_ = os.Remove(cfgFile)
@@ -46,7 +65,7 @@ func TestNewWithConfig(t *testing.T) {
}
func TestServeStop(t *testing.T) {
- cfgFile := makeConfig(t, testConfig)
+ cfgFile := makeConfig(t, testConfigWithVersion)
plugins := []any{
&informer.Plugin{},
&resetter.Plugin{},