summaryrefslogtreecommitdiff
path: root/tests/plugins/http
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-08-13 02:38:15 +0300
committerValery Piashchynski <[email protected]>2021-08-13 02:38:15 +0300
commit8cdac2daf2fc4a1a95ddebca585f4ec38beff210 (patch)
tree843b5e5f5dd9a1bca68a420e283642fc27fbb5c8 /tests/plugins/http
parentde378e7698db896b8fd16f628c7d89689c8371d0 (diff)
Update go.mod dependencies to the most recent version.
Fix tests according to the new mocks. Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests/plugins/http')
-rw-r--r--tests/plugins/http/http_plugin_test.go16
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/plugins/http/http_plugin_test.go b/tests/plugins/http/http_plugin_test.go
index db62781f..bd804264 100644
--- a/tests/plugins/http/http_plugin_test.go
+++ b/tests/plugins/http/http_plugin_test.go
@@ -22,7 +22,6 @@ import (
"github.com/golang/mock/gomock"
endure "github.com/spiral/endure/pkg/container"
goridgeRpc "github.com/spiral/goridge/v3/pkg/rpc"
- "github.com/spiral/roadrunner/v2/pkg/events"
"github.com/spiral/roadrunner/v2/pkg/process"
"github.com/spiral/roadrunner/v2/plugins/config"
"github.com/spiral/roadrunner/v2/plugins/gzip"
@@ -32,6 +31,7 @@ import (
"github.com/spiral/roadrunner/v2/plugins/server"
"github.com/spiral/roadrunner/v2/plugins/static"
"github.com/spiral/roadrunner/v2/tests/mocks"
+ "github.com/stretchr/testify/require"
"github.com/yookoala/gofast"
httpPlugin "github.com/spiral/roadrunner/v2/plugins/http"
@@ -800,9 +800,7 @@ func TestH2CUpgrade(t *testing.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,
@@ -1088,10 +1086,6 @@ rpc:
server:
command: "php ../../http/client.php echoerr pipes"
- user: ""
- group: ""
- env:
- "RR_HTTP": "true"
relay: "pipes"
relay_timeout: "20s"
@@ -1111,7 +1105,7 @@ http:
logs:
mode: development
- level: error
+ level: debug
`
cfg := &config.Viper{
@@ -1125,11 +1119,9 @@ logs:
mockLogger := mocks.NewMockLogger(controller)
mockLogger.EXPECT().Debug(gomock.Any()).AnyTimes()
- mockLogger.EXPECT().Debug("worker destructed", "pid", gomock.Any()).MinTimes(1)
mockLogger.EXPECT().Debug("worker constructed", "pid", gomock.Any()).MinTimes(1)
mockLogger.EXPECT().Debug("201 GET http://127.0.0.1:34999/?hello=world", "remote", "127.0.0.1", "elapsed", gomock.Any()).MinTimes(1)
mockLogger.EXPECT().Info("WORLD").MinTimes(1)
- mockLogger.EXPECT().Debug("worker event received", "event", events.EventWorkerLog, "worker state", gomock.Any()).MinTimes(1)
mockLogger.EXPECT().Error(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() // placeholder for the workerlogerror
err = cont.RegisterAll(
@@ -1185,7 +1177,8 @@ logs:
}
}()
- time.Sleep(time.Second * 1)
+ time.Sleep(time.Second * 3)
+
t.Run("HttpEchoError", echoError)
stopCh <- struct{}{}
@@ -1198,6 +1191,7 @@ func echoError(t *testing.T) {
r, err := http.DefaultClient.Do(req)
assert.NoError(t, err)
+ require.NotNil(t, r)
b, err := ioutil.ReadAll(r.Body)
assert.NoError(t, err)