summaryrefslogtreecommitdiff
path: root/tests/plugins/reload
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-09 02:31:33 +0300
committerValery Piashchynski <[email protected]>2021-06-09 02:31:33 +0300
commit6103228ee951c7c8bf5d425471b7c440980c6044 (patch)
tree698c28d3af1814f49958455a6c518ed62032830f /tests/plugins/reload
parent4f3e16892479db4bd8280a46987f3105e46e5c96 (diff)
- Update CI (add new tests)
- Add path scan with regex (find .php/.ph/.sh scripts). When found, try to stat path for potential fix for the [file not exists problem] Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests/plugins/reload')
-rw-r--r--tests/plugins/reload/reload_plugin_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/plugins/reload/reload_plugin_test.go b/tests/plugins/reload/reload_plugin_test.go
index 6db7b6d0..04c9849f 100644
--- a/tests/plugins/reload/reload_plugin_test.go
+++ b/tests/plugins/reload/reload_plugin_test.go
@@ -53,6 +53,7 @@ func TestReloadInit(t *testing.T) {
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)
mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").Times(1)
+ mockLogger.EXPECT().Info("scan command", gomock.Any()).Times(1)
mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").Times(1)
mockLogger.EXPECT().Info("HTTP handler listeners successfully re-added").Times(1)
mockLogger.EXPECT().Info("HTTP plugin successfully restarted").Times(1)
@@ -150,6 +151,7 @@ func TestReloadHugeNumberOfFiles(t *testing.T) {
mockLogger.EXPECT().Debug("file was added to watcher", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(1)
mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").MinTimes(1)
mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").MinTimes(1)
+ mockLogger.EXPECT().Info("scan command", gomock.Any()).Times(1)
mockLogger.EXPECT().Info("HTTP handler listeners successfully re-added").MinTimes(1)
mockLogger.EXPECT().Info("HTTP plugin successfully restarted").MinTimes(1)
mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
@@ -259,6 +261,7 @@ func TestReloadFilterFileExt(t *testing.T) {
mockLogger.EXPECT().Debug("file added to the list of removed files", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).AnyTimes()
mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").Times(1)
mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").Times(1)
+ mockLogger.EXPECT().Info("scan command", gomock.Any()).AnyTimes()
mockLogger.EXPECT().Info("HTTP handler listeners successfully re-added").MinTimes(1)
mockLogger.EXPECT().Info("HTTP plugin successfully restarted").Times(1)
mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
@@ -387,7 +390,8 @@ func TestReloadCopy100(t *testing.T) {
mockLogger.EXPECT().Debug("file added to the list of removed files", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(50)
mockLogger.EXPECT().Debug("file was removed from watcher", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(50)
mockLogger.EXPECT().Debug("file was updated", "path", gomock.Any(), "name", gomock.Any(), "size", gomock.Any()).MinTimes(50)
- mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").MinTimes(1)
+ mockLogger.EXPECT().Info("HTTP plugin got restart request. Restarting...").AnyTimes()
+ mockLogger.EXPECT().Info("scan command", gomock.Any()).Times(1)
mockLogger.EXPECT().Info("HTTP workers Pool successfully restarted").MinTimes(1)
mockLogger.EXPECT().Info("HTTP handler listeners successfully re-added").MinTimes(1)
mockLogger.EXPECT().Info("HTTP plugin successfully restarted").MinTimes(1)
@@ -668,6 +672,7 @@ func TestReloadNoRecursion(t *testing.T) {
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("scan command", gomock.Any()).Times(1)
mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
err = cont.RegisterAll(