diff options
author | Valery Piashchynski <[email protected]> | 2023-01-23 21:17:56 +0100 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2023-01-23 21:18:14 +0100 |
commit | 36e6fd3b8bf879ccdf66221dda150024768554e1 (patch) | |
tree | a270490db6229631b0614327a2dd6a9bd7b175d1 /lib | |
parent | 5c99331459f0f4a617bab89e06cfbfe4183ad1ad (diff) |
fix: update `boltdb` section
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/roadrunner_test.go | 27 |
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{}, |