diff options
-rw-r--r-- | CHANGELOG.md | 7 | ||||
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | composer.json | 5 | ||||
-rw-r--r-- | service/health/service_test.go | 3 | ||||
-rw-r--r-- | tests/http/slow-client.php | 46 |
5 files changed, 59 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 44dc58be..df3f25fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ========= +v1.5.0 (12.10.2019) +------------------- +- initial code style fixes by @ScullWM +- added health service for better integration with Kubernetes by @awprice +- added support for payloads in GET methods by @moeinpaki +- added automatic CS fixer (spiral/code-style) + v1.4.8 (06.09.2019) ------------------- - bugfix in proxy IP resolution by @spudro228 @@ -20,6 +20,7 @@ test: go test -v -race -cover ./service/limit go test -v -race -cover ./service/headers go test -v -race -cover ./service/metrics + go test -v -race -cover ./service/health lint: go fmt ./... golint ./...
\ No newline at end of file diff --git a/composer.json b/composer.json index fd50fa16..47ad6a04 100644 --- a/composer.json +++ b/composer.json @@ -28,5 +28,8 @@ }, "bin": [ "bin/rr" - ] + ], + "require-dev": { + "spiral/code-style": "^1.0" + } } diff --git a/service/health/service_test.go b/service/health/service_test.go index 3e86b0bd..7a3b8186 100644 --- a/service/health/service_test.go +++ b/service/health/service_test.go @@ -73,7 +73,6 @@ func TestService_Serve(t *testing.T) { _, res, err := get("http://localhost:2116/") assert.NoError(t, err) assert.Equal(t, http.StatusOK, res.StatusCode) - } func TestService_Serve_DeadWorker(t *testing.T) { @@ -91,7 +90,7 @@ func TestService_Serve_DeadWorker(t *testing.T) { httpCfg: `{ "address": "localhost:2115", "workers":{ - "command": "php ../../tests/http/client.php echo pipes", + "command": "php ../../tests/http/slow-client.php echo pipes 1000", "pool": {"numWorkers": 1} } }`, diff --git a/tests/http/slow-client.php b/tests/http/slow-client.php new file mode 100644 index 00000000..58250dfb --- /dev/null +++ b/tests/http/slow-client.php @@ -0,0 +1,46 @@ +<?php + +use Spiral\Goridge; +use Spiral\RoadRunner; + +ini_set('display_errors', 'stderr'); +require dirname(__DIR__) . "/../vendor/autoload.php"; + +if (count($argv) < 3) { + die("need 2 arguments"); +} + +list($test, $goridge, $bootDelay) = [$argv[1], $argv[2], $argv[3]]; +usleep($bootDelay * 1000); + +switch ($goridge) { + case "pipes": + $relay = new Goridge\StreamRelay(STDIN, STDOUT); + break; + + case "tcp": + $relay = new Goridge\SocketRelay("localhost", 9007); + break; + + case "unix": + $relay = new Goridge\SocketRelay( + "sock.unix", + null, + Goridge\SocketRelay::SOCK_UNIX + ); + break; + + default: + die("invalid protocol selection"); +} + +$psr7 = new RoadRunner\PSR7Client(new RoadRunner\Worker($relay)); +require_once sprintf("%s/%s.php", __DIR__, $test); + +while ($req = $psr7->acceptRequest()) { + try { + $psr7->respond(handleRequest($req, new \Zend\Diactoros\Response())); + } catch (\Throwable $e) { + $psr7->getWorker()->error((string)$e); + } +} |