summaryrefslogtreecommitdiff
path: root/tests/plugins/reload/reload_plugin_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-19 16:47:15 +0300
committerValery Piashchynski <[email protected]>2021-01-19 16:47:15 +0300
commit26f9d35e18ef79d79a5609c6c68f1b6ad38c7aed (patch)
treedd6224660ffd0dcefe2332807203ee1eaf6697b4 /tests/plugins/reload/reload_plugin_test.go
parent75ebbaac89ce8ebc3ab8de47b16e137844cfcd8a (diff)
Uniform all errors operations
Add new ExecTTL event Update tests Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests/plugins/reload/reload_plugin_test.go')
-rw-r--r--tests/plugins/reload/reload_plugin_test.go25
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/plugins/reload/reload_plugin_test.go b/tests/plugins/reload/reload_plugin_test.go
index c83d4787..81ac3c44 100644
--- a/tests/plugins/reload/reload_plugin_test.go
+++ b/tests/plugins/reload/reload_plugin_test.go
@@ -47,7 +47,8 @@ func TestReloadInit(t *testing.T) {
controller := gomock.NewController(t)
mockLogger := mocks.NewMockLogger(controller)
- mockLogger.EXPECT().Info("worker constructed", "pid", gomock.Any()).AnyTimes()
+ mockLogger.EXPECT().Debug("worker destructed", "pid", gomock.Any()).AnyTimes()
+ mockLogger.EXPECT().Debug("worker constructed", "pid", gomock.Any()).AnyTimes()
mockLogger.EXPECT().Debug("http handler response received", "elapsed", gomock.Any(), "remote address", "127.0.0.1").Times(1)
mockLogger.EXPECT().Debug("file was created", "path", gomock.Any(), "name", "file.txt", "size", gomock.Any()).Times(2)
mockLogger.EXPECT().Debug("file was added to watcher", "path", gomock.Any(), "name", "file.txt", "size", gomock.Any()).Times(2)
@@ -55,7 +56,7 @@ func TestReloadInit(t *testing.T) {
mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").Times(1)
mockLogger.EXPECT().Info("HTTP listeners successfully re-added").Times(1)
mockLogger.EXPECT().Info("HTTP plugin successfully restarted").Times(1)
- mockLogger.EXPECT().Info(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
+ mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
err = cont.RegisterAll(
cfg,
@@ -140,7 +141,8 @@ func TestReloadHugeNumberOfFiles(t *testing.T) {
controller := gomock.NewController(t)
mockLogger := mocks.NewMockLogger(controller)
- mockLogger.EXPECT().Info("worker constructed", "pid", gomock.Any()).AnyTimes()
+ mockLogger.EXPECT().Debug("worker destructed", "pid", gomock.Any()).MinTimes(1)
+ mockLogger.EXPECT().Debug("worker constructed", "pid", gomock.Any()).AnyTimes()
mockLogger.EXPECT().Debug("file added to the list of removed files", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).AnyTimes()
mockLogger.EXPECT().Debug("http handler response received", "elapsed", gomock.Any(), "remote address", "127.0.0.1").Times(1)
mockLogger.EXPECT().Debug("file was created", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(1)
@@ -150,7 +152,7 @@ func TestReloadHugeNumberOfFiles(t *testing.T) {
mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").MinTimes(1)
mockLogger.EXPECT().Info("HTTP listeners successfully re-added").MinTimes(1)
mockLogger.EXPECT().Info("HTTP plugin successfully restarted").MinTimes(1)
- mockLogger.EXPECT().Info(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
+ mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
err = cont.RegisterAll(
cfg,
@@ -249,7 +251,8 @@ func TestReloadFilterFileExt(t *testing.T) {
controller := gomock.NewController(t)
mockLogger := mocks.NewMockLogger(controller)
- mockLogger.EXPECT().Info("worker constructed", "pid", gomock.Any()).AnyTimes()
+ mockLogger.EXPECT().Debug("worker destructed", "pid", gomock.Any()).MinTimes(1)
+ mockLogger.EXPECT().Debug("worker constructed", "pid", gomock.Any()).AnyTimes()
mockLogger.EXPECT().Debug("http handler response received", "elapsed", gomock.Any(), "remote address", "127.0.0.1").Times(1)
mockLogger.EXPECT().Debug("file was created", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(100)
mockLogger.EXPECT().Debug("file was added to watcher", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(1)
@@ -258,7 +261,7 @@ func TestReloadFilterFileExt(t *testing.T) {
mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").Times(1)
mockLogger.EXPECT().Info("HTTP listeners successfully re-added").Times(1)
mockLogger.EXPECT().Info("HTTP plugin successfully restarted").Times(1)
- mockLogger.EXPECT().Info(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
+ mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
err = cont.RegisterAll(
cfg,
@@ -376,7 +379,8 @@ func TestReloadCopy500(t *testing.T) {
controller := gomock.NewController(t)
mockLogger := mocks.NewMockLogger(controller)
//
- mockLogger.EXPECT().Info("worker constructed", "pid", gomock.Any()).AnyTimes()
+ mockLogger.EXPECT().Debug("worker destructed", "pid", gomock.Any()).MinTimes(1)
+ mockLogger.EXPECT().Debug("worker constructed", "pid", gomock.Any()).AnyTimes()
mockLogger.EXPECT().Debug("http handler response received", "elapsed", gomock.Any(), "remote address", "127.0.0.1").Times(1)
mockLogger.EXPECT().Debug("file was created", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(50)
mockLogger.EXPECT().Debug("file was added to watcher", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(50)
@@ -387,7 +391,7 @@ func TestReloadCopy500(t *testing.T) {
mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").MinTimes(1)
mockLogger.EXPECT().Info("HTTP listeners successfully re-added").MinTimes(1)
mockLogger.EXPECT().Info("HTTP plugin successfully restarted").MinTimes(1)
- mockLogger.EXPECT().Info(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
+ mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
err = cont.RegisterAll(
cfg,
@@ -660,10 +664,11 @@ func TestReloadNoRecursion(t *testing.T) {
mockLogger := mocks.NewMockLogger(controller)
// http server should not be restarted. all event from wrong file extensions should be skipped
- mockLogger.EXPECT().Info("worker constructed", "pid", gomock.Any()).MinTimes(1)
+ mockLogger.EXPECT().Debug("worker destructed", "pid", gomock.Any()).MinTimes(1)
+ mockLogger.EXPECT().Debug("worker constructed", "pid", gomock.Any()).MinTimes(1)
mockLogger.EXPECT().Debug("http handler response received", "elapsed", gomock.Any(), "remote address", "127.0.0.1").Times(1)
mockLogger.EXPECT().Debug("file added to the list of removed files", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(1)
- mockLogger.EXPECT().Info(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
+ mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
err = cont.RegisterAll(
cfg,