diff options
author | Valery Piashchynski <[email protected]> | 2021-03-15 13:43:45 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-15 13:43:45 +0300 |
commit | 102e473110b9be0924193aeecd4b946a7053737e (patch) | |
tree | b2b0db47390741ff15884ec81b06626e4020fdb5 /tests/plugins | |
parent | c07594a931bd322fd5e7310357f1ab3f4be9c0c5 (diff) | |
parent | bb6acdaf8cf55a4df746c9d03f2c677fa85ea6ee (diff) |
Merge pull request #592 from spiral/missed_logger_for_the_http_server
🆕 new(http plugin): HTTP/HTTPS/FCGI servers errors redirected to the RR logger under the Error log level
Diffstat (limited to 'tests/plugins')
-rw-r--r-- | tests/plugins/http/configs/.rr-h2c.yaml | 5 | ||||
-rw-r--r-- | tests/plugins/http/http_plugin_test.go | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/tests/plugins/http/configs/.rr-h2c.yaml b/tests/plugins/http/configs/.rr-h2c.yaml index 2061a76b..bd610bb0 100644 --- a/tests/plugins/http/configs/.rr-h2c.yaml +++ b/tests/plugins/http/configs/.rr-h2c.yaml @@ -24,5 +24,6 @@ http: h2c: true maxConcurrentStreams: 128 logs: - mode: development - level: error
\ No newline at end of file + mode: production + level: info + encoding: console
\ No newline at end of file diff --git a/tests/plugins/http/http_plugin_test.go b/tests/plugins/http/http_plugin_test.go index d55491ea..d136b437 100644 --- a/tests/plugins/http/http_plugin_test.go +++ b/tests/plugins/http/http_plugin_test.go @@ -705,11 +705,18 @@ func TestH2CUpgrade(t *testing.T) { Path: "configs/.rr-h2c.yaml", Prefix: "rr", } + controller := gomock.NewController(t) + mockLogger := mocks.NewMockLogger(controller) + + mockLogger.EXPECT().Error("server internal error", "message", 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("worker event received", "event", events.EventWorkerLog, "worker state", gomock.Any()).MinTimes(1) err = cont.RegisterAll( cfg, &rpcPlugin.Plugin{}, - &logger.ZapLogger{}, + mockLogger, &server.Plugin{}, &httpPlugin.Plugin{}, ) |