summaryrefslogtreecommitdiff
path: root/plugins/reload/tests/watcher_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-16 10:40:22 +0300
committerValery Piashchynski <[email protected]>2020-12-16 10:40:22 +0300
commit9e692dd9996f4d100ff3d9c5a358aa6894a748a3 (patch)
tree2f4c51144a7b54ee41db8ca1e9771a64100c3cc1 /plugins/reload/tests/watcher_test.go
parent089a202aa716f3510402ff8baf47a3b9bfaefcb8 (diff)
Add reload tests to the Makefile and CI. Update tests
Diffstat (limited to 'plugins/reload/tests/watcher_test.go')
-rw-r--r--plugins/reload/tests/watcher_test.go37
1 files changed, 30 insertions, 7 deletions
diff --git a/plugins/reload/tests/watcher_test.go b/plugins/reload/tests/watcher_test.go
index 6a4521a4..f1e0d737 100644
--- a/plugins/reload/tests/watcher_test.go
+++ b/plugins/reload/tests/watcher_test.go
@@ -12,7 +12,9 @@ import (
"time"
"github.com/spiral/errors"
+ logPlugin "github.com/spiral/roadrunner/v2/plugins/logger"
"github.com/spiral/roadrunner/v2/plugins/reload"
+ "go.uber.org/zap"
)
var testServiceName = "test"
@@ -46,7 +48,10 @@ func Test_Correct_Watcher_Init(t *testing.T) {
FilePatterns: nil,
}
- w, err := reload.NewWatcher([]reload.WatcherConfig{wc})
+ logger, _ := zap.NewDevelopment()
+ lg := logPlugin.NewZapAdapter(logger)
+
+ w, err := reload.NewWatcher([]reload.WatcherConfig{wc}, lg)
if err != nil {
t.Fatal(err)
}
@@ -103,7 +108,10 @@ func Test_Get_FileEvent(t *testing.T) {
FilePatterns: []string{"aaa", "txt"},
}
- w, err := reload.NewWatcher([]reload.WatcherConfig{wc})
+ logger, _ := zap.NewDevelopment()
+ lg := logPlugin.NewZapAdapter(logger)
+
+ w, err := reload.NewWatcher([]reload.WatcherConfig{wc}, lg)
if err != nil {
t.Fatal(err)
}
@@ -195,7 +203,10 @@ func Test_FileExtensionFilter(t *testing.T) {
FilePatterns: []string{"aaa", "bbb"},
}
- w, err := reload.NewWatcher([]reload.WatcherConfig{wc})
+ logger, _ := zap.NewDevelopment()
+ lg := logPlugin.NewZapAdapter(logger)
+
+ w, err := reload.NewWatcher([]reload.WatcherConfig{wc}, lg)
if err != nil {
t.Fatal(err)
}
@@ -294,7 +305,10 @@ func Test_Recursive_Support(t *testing.T) {
FilePatterns: []string{"aaa", "bbb"},
}
- w, err := reload.NewWatcher([]reload.WatcherConfig{wc})
+ logger, _ := zap.NewDevelopment()
+ lg := logPlugin.NewZapAdapter(logger)
+
+ w, err := reload.NewWatcher([]reload.WatcherConfig{wc}, lg)
if err != nil {
t.Fatal(err)
}
@@ -351,7 +365,10 @@ func Test_Wrong_Dir(t *testing.T) {
FilePatterns: []string{"aaa", "bbb"},
}
- _, err := reload.NewWatcher([]reload.WatcherConfig{wc})
+ logger, _ := zap.NewDevelopment()
+ lg := logPlugin.NewZapAdapter(logger)
+
+ _, err := reload.NewWatcher([]reload.WatcherConfig{wc}, lg)
if err == nil {
t.Fatal(err)
}
@@ -420,7 +437,10 @@ func Test_Filter_Directory(t *testing.T) {
FilePatterns: []string{"aaa", "bbb", "txt"},
}
- w, err := reload.NewWatcher([]reload.WatcherConfig{wc})
+ logger, _ := zap.NewDevelopment()
+ lg := logPlugin.NewZapAdapter(logger)
+
+ w, err := reload.NewWatcher([]reload.WatcherConfig{wc}, lg)
if err != nil {
t.Fatal(err)
}
@@ -522,7 +542,10 @@ func Test_Copy_Directory(t *testing.T) {
FilePatterns: []string{"aaa", "bbb", "txt"},
}
- w, err := reload.NewWatcher([]reload.WatcherConfig{wc})
+ logger, _ := zap.NewDevelopment()
+ lg := logPlugin.NewZapAdapter(logger)
+
+ w, err := reload.NewWatcher([]reload.WatcherConfig{wc}, lg)
if err != nil {
t.Fatal(err)
}