summaryrefslogtreecommitdiff
path: root/tests/plugins
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-09-08 20:55:25 +0300
committerValery Piashchynski <[email protected]>2021-09-08 20:55:25 +0300
commitf855d878c281285bd8f468af0dba2521e4f211db (patch)
tree5d10640eb0f09718672819a30d39169589519e0d /tests/plugins
parentb72643e64e116e51a245bc9331e25c3f73175030 (diff)
Update protoc plugin,
Update serverOptions, Update codec. Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests/plugins')
-rw-r--r--tests/plugins/grpc/configs/.rr-grpc-init.yaml50
-rw-r--r--tests/plugins/grpc/plugin_test.go2
-rw-r--r--tests/plugins/logger/logger_test.go24
3 files changed, 63 insertions, 13 deletions
diff --git a/tests/plugins/grpc/configs/.rr-grpc-init.yaml b/tests/plugins/grpc/configs/.rr-grpc-init.yaml
index e69de29b..010e904e 100644
--- a/tests/plugins/grpc/configs/.rr-grpc-init.yaml
+++ b/tests/plugins/grpc/configs/.rr-grpc-init.yaml
@@ -0,0 +1,50 @@
+# GRPC service configuration
+grpc:
+ # socket to listen
+ listen: "tcp://localhost:9001"
+
+ # proto root file
+ proto: "test.proto"
+
+ # max send limit (MB)
+ max_send_msg_size: 50
+
+ # max receive limit (MB)
+ max_recv_msg_size: 50
+
+ # MaxConnectionIdle is a duration for the amount of time after which an
+ # idle connection would be closed by sending a GoAway. Idleness duration is
+ # defined since the most recent time the number of outstanding RPCs became
+ # zero or the connection establishment.
+ max_connection_idle: 0s
+
+ # MaxConnectionAge is a duration for the maximum amount of time a
+ # connection may exist before it will be closed by sending a GoAway. A
+ # random jitter of +/-10% will be added to MaxConnectionAge to spread out
+ # connection storms.
+ max_connection_age: 0s
+
+ # MaxConnectionAgeGrace is an additive period after MaxConnectionAge after
+ # which the connection will be forcibly closed.
+ max_connection_age_grace: 0s
+
+ # MaxConnectionAgeGrace is an additive period after MaxConnectionAge after
+ # which the connection will be forcibly closed.
+ max_concurrent_streams: 10
+
+ # After a duration of this time if the server doesn't see any activity it
+ # pings the client to see if the transport is still alive.
+ # If set below 1s, a minimum value of 1s will be used instead.
+ ping_time: 1s
+
+ # After having pinged for keepalive check, the server waits for a duration
+ # of Timeout and if no activity is seen even after that the connection is
+ # closed.
+ timeout: 200s
+
+ # Usual workers pool configuration
+ pool:
+ num_workers: 2
+ max_jobs: 0
+ allocate_timeout: 60s
+ destroy_timeout: 60
diff --git a/tests/plugins/grpc/plugin_test.go b/tests/plugins/grpc/plugin_test.go
index 74a71c62..cfbe0121 100644
--- a/tests/plugins/grpc/plugin_test.go
+++ b/tests/plugins/grpc/plugin_test.go
@@ -19,7 +19,7 @@ func init() {
}
func build() error {
- cmd := exec.Command("go", "build", "-o", "plugin", "../../../plugins/grpc/protoc-gen-php-grpc")
+ cmd := exec.Command("go", "build", "-o", "plugin", "../../../plugins/grpc/protoc_plugins/protoc-gen-php-grpc")
return cmd.Run()
}
diff --git a/tests/plugins/logger/logger_test.go b/tests/plugins/logger/logger_test.go
index 05ca2d53..e077f0bc 100644
--- a/tests/plugins/logger/logger_test.go
+++ b/tests/plugins/logger/logger_test.go
@@ -346,18 +346,6 @@ func TestFileLogger(t *testing.T) {
wg.Wait()
}
-func httpEcho(t *testing.T) {
- req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:54224?hello=world", nil)
- assert.NoError(t, err)
-
- r, err := http.DefaultClient.Do(req)
- assert.NoError(t, err)
- assert.Equal(t, http.StatusCreated, r.StatusCode)
-
- err = r.Body.Close()
- assert.NoError(t, err)
-}
-
func TestMarshalObjectLogging(t *testing.T) {
container, err := endure.NewContainer(nil, endure.RetryOnFail(true), endure.SetLogLevel(endure.ErrorLevel))
if err != nil {
@@ -428,3 +416,15 @@ func TestMarshalObjectLogging(t *testing.T) {
stopCh <- struct{}{}
wg.Wait()
}
+
+func httpEcho(t *testing.T) {
+ req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:54224?hello=world", nil)
+ assert.NoError(t, err)
+
+ r, err := http.DefaultClient.Do(req)
+ assert.NoError(t, err)
+ assert.Equal(t, http.StatusCreated, r.StatusCode)
+
+ err = r.Body.Close()
+ assert.NoError(t, err)
+}