diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | composer.json | 2 | ||||
-rw-r--r-- | php-src/Exceptions/RoadRunnerException.php | 13 | ||||
-rw-r--r-- | pipe_factory_test.go | 20 | ||||
-rw-r--r-- | server_config_test.go | 8 | ||||
-rw-r--r-- | server_test.go | 24 | ||||
-rw-r--r-- | service/http/config_test.go | 10 | ||||
-rw-r--r-- | service/http/handler_test.go | 36 | ||||
-rw-r--r-- | service/http/rpc_test.go | 6 | ||||
-rw-r--r-- | service/http/service_test.go | 22 | ||||
-rw-r--r-- | service/http/uploads_test.go | 8 | ||||
-rw-r--r-- | service/static/service_test.go | 30 | ||||
-rw-r--r-- | socket_factory_test.go | 36 | ||||
-rw-r--r-- | src/Exception/RoadRunnerException.php | 13 | ||||
-rw-r--r-- | src/Exceptions/RoadRunnerException.php | 17 | ||||
-rw-r--r-- | src/PSR7Client.php (renamed from php-src/PSR7Client.php) | 0 | ||||
-rw-r--r-- | src/Worker.php (renamed from php-src/Worker.php) | 2 | ||||
-rw-r--r-- | static_pool_test.go | 32 | ||||
-rw-r--r-- | tests/broken.php (renamed from php-src/tests/broken.php) | 0 | ||||
-rw-r--r-- | tests/client.php (renamed from php-src/tests/client.php) | 2 | ||||
-rw-r--r-- | tests/delay.php (renamed from php-src/tests/delay.php) | 0 | ||||
-rw-r--r-- | tests/echo.php (renamed from php-src/tests/echo.php) | 0 | ||||
-rw-r--r-- | tests/error.php (renamed from php-src/tests/error.php) | 0 | ||||
-rw-r--r-- | tests/failboot.php (renamed from php-src/tests/failboot.php) | 0 | ||||
-rw-r--r-- | tests/head.php (renamed from php-src/tests/head.php) | 0 | ||||
-rw-r--r-- | tests/http/client.php (renamed from php-src/tests/http/client.php) | 2 | ||||
-rw-r--r-- | tests/http/cookie.php (renamed from php-src/tests/http/cookie.php) | 0 | ||||
-rw-r--r-- | tests/http/data.php (renamed from php-src/tests/http/data.php) | 0 | ||||
-rw-r--r-- | tests/http/echo.php (renamed from php-src/tests/http/echo.php) | 0 | ||||
-rw-r--r-- | tests/http/echoerr.php (renamed from php-src/tests/http/echoerr.php) | 0 | ||||
-rw-r--r-- | tests/http/env.php (renamed from php-src/tests/http/env.php) | 0 | ||||
-rw-r--r-- | tests/http/error.php (renamed from php-src/tests/http/error.php) | 0 | ||||
-rw-r--r-- | tests/http/error2.php (renamed from php-src/tests/http/error2.php) | 0 | ||||
-rw-r--r-- | tests/http/header.php (renamed from php-src/tests/http/header.php) | 0 | ||||
-rw-r--r-- | tests/http/payload.php (renamed from php-src/tests/http/payload.php) | 0 | ||||
-rw-r--r-- | tests/http/pid.php (renamed from php-src/tests/http/pid.php) | 0 | ||||
-rw-r--r-- | tests/http/upload.php (renamed from php-src/tests/http/upload.php) | 0 | ||||
-rw-r--r-- | tests/pid.php (renamed from php-src/tests/pid.php) | 0 | ||||
-rw-r--r-- | tests/sample.txt (renamed from php-src/tests/sample.txt) | 0 | ||||
-rw-r--r-- | tests/slow-client.php (renamed from php-src/tests/slow-client.php) | 0 | ||||
-rw-r--r-- | tests/stop.php (renamed from php-src/tests/stop.php) | 0 | ||||
-rw-r--r-- | worker_test.go | 28 |
42 files changed, 166 insertions, 148 deletions
@@ -1,4 +1,5 @@ .idea/* composer.lock vendor/ -builds/
\ No newline at end of file +builds/ +tests/vendor/
\ No newline at end of file diff --git a/composer.json b/composer.json index 5d946f49..7be3ecfe 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "autoload": { "psr-4": { - "Spiral\\RoadRunner\\": "php-src/" + "Spiral\\RoadRunner\\": "src/" } } } diff --git a/php-src/Exceptions/RoadRunnerException.php b/php-src/Exceptions/RoadRunnerException.php deleted file mode 100644 index fa7b8da3..00000000 --- a/php-src/Exceptions/RoadRunnerException.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * High-performance PHP process supervisor and load balancer written in Go - * - * @author Wolfy-J - */ - -namespace Spiral\RoadRunner\Exceptions; - -class RoadRunnerException extends \RuntimeException -{ - -}
\ No newline at end of file diff --git a/pipe_factory_test.go b/pipe_factory_test.go index ae276ab6..9d50e47f 100644 --- a/pipe_factory_test.go +++ b/pipe_factory_test.go @@ -7,7 +7,7 @@ import ( ) func Test_Pipe_Start(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, err := NewPipeFactory().SpawnWorker(cmd) assert.NoError(t, err) @@ -21,7 +21,7 @@ func Test_Pipe_Start(t *testing.T) { } func Test_Pipe_StartError(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") cmd.Start() w, err := NewPipeFactory().SpawnWorker(cmd) @@ -30,7 +30,7 @@ func Test_Pipe_StartError(t *testing.T) { } func Test_Pipe_PipeError(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") cmd.StdinPipe() w, err := NewPipeFactory().SpawnWorker(cmd) @@ -39,7 +39,7 @@ func Test_Pipe_PipeError(t *testing.T) { } func Test_Pipe_PipeError2(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") cmd.StdoutPipe() w, err := NewPipeFactory().SpawnWorker(cmd) @@ -48,7 +48,7 @@ func Test_Pipe_PipeError2(t *testing.T) { } func Test_Pipe_Failboot(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/failboot.php") + cmd := exec.Command("php", "tests/failboot.php") w, err := NewPipeFactory().SpawnWorker(cmd) assert.Nil(t, w) @@ -57,7 +57,7 @@ func Test_Pipe_Failboot(t *testing.T) { } func Test_Pipe_Invalid(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/invalid.php") + cmd := exec.Command("php", "tests/invalid.php") w, err := NewPipeFactory().SpawnWorker(cmd) assert.Error(t, err) @@ -65,7 +65,7 @@ func Test_Pipe_Invalid(t *testing.T) { } func Test_Pipe_Echo(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, _ := NewPipeFactory().SpawnWorker(cmd) go func() { @@ -84,7 +84,7 @@ func Test_Pipe_Echo(t *testing.T) { } func Test_Pipe_Broken(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "broken", "pipes") + cmd := exec.Command("php", "tests/client.php", "broken", "pipes") w, _ := NewPipeFactory().SpawnWorker(cmd) go func() { @@ -104,7 +104,7 @@ func Test_Pipe_Broken(t *testing.T) { func Benchmark_Pipe_SpawnWorker_Stop(b *testing.B) { f := NewPipeFactory() for n := 0; n < b.N; n++ { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, _ := f.SpawnWorker(cmd) go func() { if w.Wait() != nil { @@ -117,7 +117,7 @@ func Benchmark_Pipe_SpawnWorker_Stop(b *testing.B) { } func Benchmark_Pipe_Worker_ExecEcho(b *testing.B) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, _ := NewPipeFactory().SpawnWorker(cmd) go func() { diff --git a/server_config_test.go b/server_config_test.go index e116323d..5e874649 100644 --- a/server_config_test.go +++ b/server_config_test.go @@ -85,7 +85,7 @@ func Test_ServerConfig_ErrorMethod(t *testing.T) { func Test_ServerConfig_Cmd(t *testing.T) { cfg := &ServerConfig{ - Command: "php php-src/tests/client.php pipes", + Command: "php tests/client.php pipes", } cmd := cfg.makeCommand() @@ -94,7 +94,7 @@ func Test_ServerConfig_Cmd(t *testing.T) { func Test_ServerConfig_SetEnv(t *testing.T) { cfg := &ServerConfig{ - Command: "php php-src/tests/client.php pipes", + Command: "php tests/client.php pipes", } cfg.SetEnv("key", "value") @@ -109,7 +109,7 @@ func Test_ServerConfig_SetEnv(t *testing.T) { func Test_ServerConfigDefaults(t *testing.T) { cfg := &ServerConfig{ - Command: "php php-src/tests/client.php pipes", + Command: "php tests/client.php pipes", } cfg.SetDefaults() @@ -121,7 +121,7 @@ func Test_ServerConfigDefaults(t *testing.T) { func Test_Config_Upscale(t *testing.T) { cfg := &ServerConfig{ - Command: "php php-src/tests/client.php pipes", + Command: "php tests/client.php pipes", RelayTimeout: 1, Pool: &Config{ AllocateTimeout: 1, diff --git a/server_test.go b/server_test.go index 846b1040..4646ebc9 100644 --- a/server_test.go +++ b/server_test.go @@ -11,7 +11,7 @@ import ( func TestServer_PipesEcho(t *testing.T) { srv := NewServer( &ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &Config{ NumWorkers: int64(runtime.NumCPU()), @@ -36,7 +36,7 @@ func TestServer_PipesEcho(t *testing.T) { func TestServer_SocketEcho(t *testing.T) { srv := NewServer( &ServerConfig{ - Command: "php php-src/tests/client.php echo tcp", + Command: "php tests/client.php echo tcp", Relay: "tcp://:9007", RelayTimeout: 10 * time.Second, Pool: &Config{ @@ -62,7 +62,7 @@ func TestServer_SocketEcho(t *testing.T) { func TestServer_Configure_BeforeStart(t *testing.T) { srv := NewServer( &ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &Config{ NumWorkers: int64(runtime.NumCPU()), @@ -73,7 +73,7 @@ func TestServer_Configure_BeforeStart(t *testing.T) { defer srv.Stop() err := srv.Reconfigure(&ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &Config{ NumWorkers: 2, @@ -99,7 +99,7 @@ func TestServer_Configure_BeforeStart(t *testing.T) { func TestServer_Stop_NotStarted(t *testing.T) { srv := NewServer( &ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &Config{ NumWorkers: int64(runtime.NumCPU()), @@ -115,7 +115,7 @@ func TestServer_Stop_NotStarted(t *testing.T) { func TestServer_Reconfigure(t *testing.T) { srv := NewServer( &ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &Config{ NumWorkers: 1, @@ -129,7 +129,7 @@ func TestServer_Reconfigure(t *testing.T) { assert.Len(t, srv.Workers(), 1) err := srv.Reconfigure(&ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &Config{ NumWorkers: 2, @@ -145,7 +145,7 @@ func TestServer_Reconfigure(t *testing.T) { func TestServer_Reset(t *testing.T) { srv := NewServer( &ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &Config{ NumWorkers: 1, @@ -167,7 +167,7 @@ func TestServer_Reset(t *testing.T) { func TestServer_ReplacePool(t *testing.T) { srv := NewServer( &ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &Config{ NumWorkers: 1, @@ -196,7 +196,7 @@ func TestServer_ReplacePool(t *testing.T) { func TestServer_ServerFailure(t *testing.T) { srv := NewServer(&ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &Config{ NumWorkers: 1, @@ -216,9 +216,9 @@ func TestServer_ServerFailure(t *testing.T) { }) // emulating potential server failure - srv.cfg.Command = "php php-src/tests/client.php echo broken-connection" + srv.cfg.Command = "php tests/client.php echo broken-connection" srv.pool.(*StaticPool).cmd = func() *exec.Cmd { - return exec.Command("php", "php-src/tests/client.php", "echo", "broken-connection") + return exec.Command("php", "tests/client.php", "echo", "broken-connection") } // killing random worker and expecting pool to replace it diff --git a/service/http/config_test.go b/service/http/config_test.go index 2e3fe731..662939f3 100644 --- a/service/http/config_test.go +++ b/service/http/config_test.go @@ -39,7 +39,7 @@ func Test_Config_Valid(t *testing.T) { Forbid: []string{".go"}, }, Workers: &roadrunner.ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -58,7 +58,7 @@ func Test_Config_NoUploads(t *testing.T) { Address: ":8080", MaxRequest: 1024, Workers: &roadrunner.ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -95,7 +95,7 @@ func Test_Config_NoPool(t *testing.T) { Forbid: []string{".go"}, }, Workers: &roadrunner.ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 0, @@ -118,7 +118,7 @@ func Test_Config_DeadPool(t *testing.T) { Forbid: []string{".go"}, }, Workers: &roadrunner.ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", }, } @@ -136,7 +136,7 @@ func Test_Config_InvalidAddress(t *testing.T) { Forbid: []string{".go"}, }, Workers: &roadrunner.ServerConfig{ - Command: "php php-src/tests/client.php echo pipes", + Command: "php tests/client.php echo pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, diff --git a/service/http/handler_test.go b/service/http/handler_test.go index 3b51c873..e864b86e 100644 --- a/service/http/handler_test.go +++ b/service/http/handler_test.go @@ -39,7 +39,7 @@ func TestServer_Echo(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php echo pipes", + Command: "php ../../tests/http/client.php echo pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -74,7 +74,7 @@ func Test_HandlerErrors(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php echo pipes", + Command: "php ../../tests/http/client.php echo pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -101,7 +101,7 @@ func Test_Handler_JSON_error(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php echo pipes", + Command: "php ../../tests/http/client.php echo pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -130,7 +130,7 @@ func TestServer_Headers(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php header pipes", + Command: "php ../../tests/http/client.php header pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -177,7 +177,7 @@ func TestServer_Cookies(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php cookie pipes", + Command: "php ../../tests/http/client.php cookie pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -228,7 +228,7 @@ func TestServer_JsonPayload_POST(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php payload pipes", + Command: "php ../../tests/http/client.php payload pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -278,7 +278,7 @@ func TestServer_JsonPayload_PUT(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php payload pipes", + Command: "php ../../tests/http/client.php payload pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -324,7 +324,7 @@ func TestServer_JsonPayload_PATCH(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php payload pipes", + Command: "php ../../tests/http/client.php payload pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -370,7 +370,7 @@ func TestServer_FormData_POST(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php data pipes", + Command: "php ../../tests/http/client.php data pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -428,7 +428,7 @@ func TestServer_FormData_PUT(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php data pipes", + Command: "php ../../tests/http/client.php data pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -486,7 +486,7 @@ func TestServer_FormData_PATCH(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php data pipes", + Command: "php ../../tests/http/client.php data pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -544,7 +544,7 @@ func TestServer_Multipart_POST(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php data pipes", + Command: "php ../../tests/http/client.php data pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -606,7 +606,7 @@ func TestServer_Multipart_PUT(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php data pipes", + Command: "php ../../tests/http/client.php data pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -668,7 +668,7 @@ func TestServer_Multipart_PATCH(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php data pipes", + Command: "php ../../tests/http/client.php data pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -730,7 +730,7 @@ func TestServer_Error(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php error pipes", + Command: "php ../../tests/http/client.php error pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -764,7 +764,7 @@ func TestServer_Error2(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php error2 pipes", + Command: "php ../../tests/http/client.php error2 pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -798,7 +798,7 @@ func TestServer_Error3(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php pid pipes", + Command: "php ../../tests/http/client.php pid pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -843,7 +843,7 @@ func BenchmarkHandler_Listen_Echo(b *testing.B) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php echo pipes", + Command: "php ../../tests/http/client.php echo pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: int64(runtime.NumCPU()), diff --git a/service/http/rpc_test.go b/service/http/rpc_test.go index 32bb776c..ba3efd2e 100644 --- a/service/http/rpc_test.go +++ b/service/http/rpc_test.go @@ -33,7 +33,7 @@ func Test_RPC(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php pid pipes", + "command": "php ../../tests/http/client.php pid pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -94,7 +94,7 @@ func Test_RPC_Unix(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php pid pipes", + "command": "php ../../tests/http/client.php pid pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -148,7 +148,7 @@ func Test_Workers(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php pid pipes", + "command": "php ../../tests/http/client.php pid pipes", "relay": "pipes", "pool": { "numWorkers": 1, diff --git a/service/http/service_test.go b/service/http/service_test.go index 8dab7cd4..03a2b9a5 100644 --- a/service/http/service_test.go +++ b/service/http/service_test.go @@ -72,7 +72,7 @@ func Test_Service_Configure_Disable(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -103,7 +103,7 @@ func Test_Service_Configure_Enable(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -134,7 +134,7 @@ func Test_Service_Echo(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -187,7 +187,7 @@ func Test_Service_Env(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php env pipes", + "command": "php ../../tests/http/client.php env pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -239,7 +239,7 @@ func Test_Service_ErrorEcho(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echoerr pipes", + "command": "php ../../tests/http/client.php echoerr pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -299,7 +299,7 @@ func Test_Service_Middleware(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -373,7 +373,7 @@ func Test_Service_Listener(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -417,7 +417,7 @@ func Test_Service_Error(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "---", "pool": { "numWorkers": 1, @@ -446,7 +446,7 @@ func Test_Service_Error2(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php broken pipes", + "command": "php ../../tests/http/client.php broken pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -475,7 +475,7 @@ func Test_Service_Error3(t *testing.T) { "forbid": [] }, "workers" - "command": "php ../../php-src/tests/http/client.php broken pipes", + "command": "php ../../tests/http/client.php broken pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -502,7 +502,7 @@ func Test_Service_Error4(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php broken pipes", + "command": "php ../../tests/http/client.php broken pipes", "relay": "pipes", "pool": { "numWorkers": 1, diff --git a/service/http/uploads_test.go b/service/http/uploads_test.go index b2662bf7..96e95733 100644 --- a/service/http/uploads_test.go +++ b/service/http/uploads_test.go @@ -27,7 +27,7 @@ func TestServer_Upload_File(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php upload pipes", + Command: "php ../../tests/http/client.php upload pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -88,7 +88,7 @@ func TestServer_Upload_NestedFile(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php upload pipes", + Command: "php ../../tests/http/client.php upload pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -149,7 +149,7 @@ func TestServer_Upload_File_NoTmpDir(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php upload pipes", + Command: "php ../../tests/http/client.php upload pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, @@ -210,7 +210,7 @@ func TestServer_Upload_File_Forbids(t *testing.T) { }, }, rr: roadrunner.NewServer(&roadrunner.ServerConfig{ - Command: "php ../../php-src/tests/http/client.php upload pipes", + Command: "php ../../tests/http/client.php upload pipes", Relay: "pipes", Pool: &roadrunner.Config{ NumWorkers: 1, diff --git a/service/static/service_test.go b/service/static/service_test.go index 842e5e0b..7b40b8ad 100644 --- a/service/static/service_test.go +++ b/service/static/service_test.go @@ -56,7 +56,7 @@ func Test_Files(t *testing.T) { c.Register(ID, &Service{}) assert.NoError(t, c.Init(&testCfg{ - static: `{"enable":true, "dir":"../../php-src/tests", "forbid":[]}`, + static: `{"enable":true, "dir":"../../tests", "forbid":[]}`, httpCfg: `{ "enable": true, "address": ":6029", @@ -66,7 +66,7 @@ func Test_Files(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php pid pipes", + "command": "php ../../tests/http/client.php pid pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -93,7 +93,7 @@ func Test_Files_Disable(t *testing.T) { c.Register(ID, &Service{}) assert.NoError(t, c.Init(&testCfg{ - static: `{"enable":false, "dir":"../../php-src/tests", "forbid":[".php"]}`, + static: `{"enable":false, "dir":"../../tests", "forbid":[".php"]}`, httpCfg: `{ "enable": true, "address": ":6029", @@ -103,7 +103,7 @@ func Test_Files_Disable(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -140,7 +140,7 @@ func Test_Files_Error(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -170,7 +170,7 @@ func Test_Files_Error2(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -190,7 +190,7 @@ func Test_Files_Forbid(t *testing.T) { c.Register(ID, &Service{}) assert.NoError(t, c.Init(&testCfg{ - static: `{"enable":true, "dir":"../../php-src/tests", "forbid":[".php"]}`, + static: `{"enable":true, "dir":"../../tests", "forbid":[".php"]}`, httpCfg: `{ "enable": true, "address": ":6029", @@ -200,7 +200,7 @@ func Test_Files_Forbid(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -227,7 +227,7 @@ func Test_Files_NotFound(t *testing.T) { c.Register(ID, &Service{}) assert.NoError(t, c.Init(&testCfg{ - static: `{"enable":true, "dir":"../../php-src/tests", "forbid":[".php"]}`, + static: `{"enable":true, "dir":"../../tests", "forbid":[".php"]}`, httpCfg: `{ "enable": true, "address": ":6029", @@ -237,7 +237,7 @@ func Test_Files_NotFound(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -264,7 +264,7 @@ func Test_Files_Dir(t *testing.T) { c.Register(ID, &Service{}) assert.NoError(t, c.Init(&testCfg{ - static: `{"enable":true, "dir":"../../php-src/tests", "forbid":[".php"]}`, + static: `{"enable":true, "dir":"../../tests", "forbid":[".php"]}`, httpCfg: `{ "enable": true, "address": ":6029", @@ -274,7 +274,7 @@ func Test_Files_Dir(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php echo pipes", + "command": "php ../../tests/http/client.php echo pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -301,7 +301,7 @@ func Test_Files_NotForbid(t *testing.T) { c.Register(ID, &Service{}) assert.NoError(t, c.Init(&testCfg{ - static: `{"enable":true, "dir":"../../php-src/tests", "forbid":[]}`, + static: `{"enable":true, "dir":"../../tests", "forbid":[]}`, httpCfg: `{ "enable": true, "address": ":6029", @@ -311,7 +311,7 @@ func Test_Files_NotForbid(t *testing.T) { "forbid": [] }, "workers":{ - "command": "php ../../php-src/tests/http/client.php pid pipes", + "command": "php ../../tests/http/client.php pid pipes", "relay": "pipes", "pool": { "numWorkers": 1, @@ -326,7 +326,7 @@ func Test_Files_NotForbid(t *testing.T) { defer c.Stop() b, _, _ := get("http://localhost:6029/client.php") - assert.Equal(t, all("../../php-src/tests/client.php"), b) + assert.Equal(t, all("../../tests/client.php"), b) } func tmpDir() string { diff --git a/socket_factory_test.go b/socket_factory_test.go index 214a4851..00d0e93c 100644 --- a/socket_factory_test.go +++ b/socket_factory_test.go @@ -19,7 +19,7 @@ func Test_Tcp_Start(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "tcp") + cmd := exec.Command("php", "tests/client.php", "echo", "tcp") w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) assert.NoError(t, err) @@ -41,7 +41,7 @@ func Test_Tcp_StartCloseFactory(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "tcp") + cmd := exec.Command("php", "tests/client.php", "echo", "tcp") f := NewSocketFactory(ls, time.Minute) defer f.Close() @@ -67,7 +67,7 @@ func Test_Tcp_StartError(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") cmd.Start() w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) @@ -85,7 +85,7 @@ func Test_Tcp_Failboot(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/failboot.php") + cmd := exec.Command("php", "tests/failboot.php") w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) assert.Nil(t, w) @@ -103,7 +103,7 @@ func Test_Tcp_Timeout(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/slow-client.php", "echo", "tcp", "200", "0") + cmd := exec.Command("php", "tests/slow-client.php", "echo", "tcp", "200", "0") w, err := NewSocketFactory(ls, time.Millisecond*100).SpawnWorker(cmd) assert.Nil(t, w) @@ -121,7 +121,7 @@ func Test_Tcp_Invalid(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/invalid.php") + cmd := exec.Command("php", "tests/invalid.php") w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) assert.Error(t, err) @@ -138,7 +138,7 @@ func Test_Tcp_Broken(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/client.php", "broken", "tcp") + cmd := exec.Command("php", "tests/client.php", "broken", "tcp") w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) go func() { @@ -165,7 +165,7 @@ func Test_Tcp_Echo(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "tcp") + cmd := exec.Command("php", "tests/client.php", "echo", "tcp") w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) go func() { @@ -195,7 +195,7 @@ func Test_Unix_Start(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "unix") + cmd := exec.Command("php", "tests/client.php", "echo", "unix") w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) assert.NoError(t, err) @@ -220,7 +220,7 @@ func Test_Unix_Failboot(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/failboot.php") + cmd := exec.Command("php", "tests/failboot.php") w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) assert.Nil(t, w) @@ -240,7 +240,7 @@ func Test_Unix_Timeout(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/slow-client.php", "echo", "unix", "200", "0") + cmd := exec.Command("php", "tests/slow-client.php", "echo", "unix", "200", "0") w, err := NewSocketFactory(ls, time.Millisecond*100).SpawnWorker(cmd) assert.Nil(t, w) @@ -260,7 +260,7 @@ func Test_Unix_Invalid(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/invalid.php") + cmd := exec.Command("php", "tests/invalid.php") w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) assert.Error(t, err) @@ -279,7 +279,7 @@ func Test_Unix_Broken(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/client.php", "broken", "unix") + cmd := exec.Command("php", "tests/client.php", "broken", "unix") w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) go func() { @@ -308,7 +308,7 @@ func Test_Unix_Echo(t *testing.T) { t.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "unix") + cmd := exec.Command("php", "tests/client.php", "echo", "unix") w, err := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) go func() { @@ -336,7 +336,7 @@ func Benchmark_Tcp_SpawnWorker_Stop(b *testing.B) { f := NewSocketFactory(ls, time.Minute) for n := 0; n < b.N; n++ { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "tcp") + cmd := exec.Command("php", "tests/client.php", "echo", "tcp") w, _ := f.SpawnWorker(cmd) go func() { @@ -357,7 +357,7 @@ func Benchmark_Tcp_Worker_ExecEcho(b *testing.B) { b.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "tcp") + cmd := exec.Command("php", "tests/client.php", "echo", "tcp") w, _ := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) go func() { @@ -386,7 +386,7 @@ func Benchmark_Unix_SpawnWorker_Stop(b *testing.B) { f := NewSocketFactory(ls, time.Minute) for n := 0; n < b.N; n++ { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "unix") + cmd := exec.Command("php", "tests/client.php", "echo", "unix") w, _ := f.SpawnWorker(cmd) go func() { @@ -411,7 +411,7 @@ func Benchmark_Unix_Worker_ExecEcho(b *testing.B) { b.Skip("socket is busy") } - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "unix") + cmd := exec.Command("php", "tests/client.php", "echo", "unix") w, _ := NewSocketFactory(ls, time.Minute).SpawnWorker(cmd) go func() { diff --git a/src/Exception/RoadRunnerException.php b/src/Exception/RoadRunnerException.php new file mode 100644 index 00000000..ee99bb2b --- /dev/null +++ b/src/Exception/RoadRunnerException.php @@ -0,0 +1,13 @@ +<?php +/** + * High-performance PHP process supervisor and load balancer written in Go + * + * @author Wolfy-J + */ + +namespace Spiral\RoadRunner\Exception; + +class RoadRunnerException extends \Spiral\RoadRunner\Exceptions\RoadRunnerException +{ + +}
\ No newline at end of file diff --git a/src/Exceptions/RoadRunnerException.php b/src/Exceptions/RoadRunnerException.php new file mode 100644 index 00000000..1a5da18c --- /dev/null +++ b/src/Exceptions/RoadRunnerException.php @@ -0,0 +1,17 @@ +<?php +/** + * Spiral Framework. + * + * @license MIT + * @author Anton Titov (Wolfy-J) + */ + +namespace Spiral\RoadRunner\Exceptions; + +/** + * @deprecated use \Spiral\RoadRunner\Exception\RoadRunnerException instead + */ +class RoadRunnerException extends \RuntimeException +{ + +}
\ No newline at end of file diff --git a/php-src/PSR7Client.php b/src/PSR7Client.php index e8d93fe8..e8d93fe8 100644 --- a/php-src/PSR7Client.php +++ b/src/PSR7Client.php diff --git a/php-src/Worker.php b/src/Worker.php index 3e013090..4405cd70 100644 --- a/php-src/Worker.php +++ b/src/Worker.php @@ -9,7 +9,7 @@ namespace Spiral\RoadRunner; use Spiral\Goridge\Exceptions\GoridgeException; use Spiral\Goridge\RelayInterface as Relay; -use Spiral\RoadRunner\Exceptions\RoadRunnerException; +use Spiral\RoadRunner\Exception\RoadRunnerException; /** * Accepts connection from RoadRunner server over given Goridge relay. diff --git a/static_pool_test.go b/static_pool_test.go index 13c96d09..ab8d89e4 100644 --- a/static_pool_test.go +++ b/static_pool_test.go @@ -19,7 +19,7 @@ var cfg = Config{ func Test_NewPool(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") }, NewPipeFactory(), cfg, ) @@ -33,7 +33,7 @@ func Test_NewPool(t *testing.T) { func Test_StaticPool_Invalid(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/invalid.php") }, + func() *exec.Cmd { return exec.Command("php", "tests/invalid.php") }, NewPipeFactory(), cfg, ) @@ -44,7 +44,7 @@ func Test_StaticPool_Invalid(t *testing.T) { func Test_ConfigError(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") }, NewPipeFactory(), Config{ AllocateTimeout: time.Second, @@ -58,7 +58,7 @@ func Test_ConfigError(t *testing.T) { func Test_StaticPool_Echo(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") }, NewPipeFactory(), cfg, ) @@ -79,7 +79,7 @@ func Test_StaticPool_Echo(t *testing.T) { func Test_StaticPool_Echo_NilContext(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") }, NewPipeFactory(), cfg, ) @@ -100,7 +100,7 @@ func Test_StaticPool_Echo_NilContext(t *testing.T) { func Test_StaticPool_Echo_Context(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "head", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "head", "pipes") }, NewPipeFactory(), cfg, ) @@ -121,7 +121,7 @@ func Test_StaticPool_Echo_Context(t *testing.T) { func Test_StaticPool_JobError(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "error", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "error", "pipes") }, NewPipeFactory(), cfg, ) @@ -141,7 +141,7 @@ func Test_StaticPool_JobError(t *testing.T) { func Test_StaticPool_Broken_Replace(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "broken", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "broken", "pipes") }, NewPipeFactory(), cfg, ) @@ -164,7 +164,7 @@ func Test_StaticPool_Broken_Replace(t *testing.T) { func Test_StaticPool_Broken_FromOutside(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") }, NewPipeFactory(), cfg, ) @@ -203,7 +203,7 @@ func Test_StaticPool_Broken_FromOutside(t *testing.T) { func Test_StaticPool_AllocateTimeout(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "delay", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "delay", "pipes") }, NewPipeFactory(), Config{ NumWorkers: 1, @@ -235,7 +235,7 @@ func Test_StaticPool_AllocateTimeout(t *testing.T) { func Test_StaticPool_Replace_Worker(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "pid", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "pid", "pipes") }, NewPipeFactory(), Config{ NumWorkers: 1, @@ -271,7 +271,7 @@ func Test_StaticPool_Replace_Worker(t *testing.T) { // identical to replace but controlled on worker side func Test_StaticPool_Stop_Worker(t *testing.T) { p, err := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "stop", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "stop", "pipes") }, NewPipeFactory(), Config{ NumWorkers: 1, @@ -305,7 +305,7 @@ func Test_StaticPool_Stop_Worker(t *testing.T) { func Benchmark_Pool_Allocate(b *testing.B) { p, _ := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") }, NewPipeFactory(), cfg, ) @@ -324,7 +324,7 @@ func Benchmark_Pool_Allocate(b *testing.B) { func Benchmark_Pool_Echo(b *testing.B) { p, _ := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") }, NewPipeFactory(), cfg, ) @@ -339,7 +339,7 @@ func Benchmark_Pool_Echo(b *testing.B) { func Benchmark_Pool_Echo_Batched(b *testing.B) { p, _ := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") }, NewPipeFactory(), cfg, ) @@ -362,7 +362,7 @@ func Benchmark_Pool_Echo_Batched(b *testing.B) { func Benchmark_Pool_Echo_Replaced(b *testing.B) { p, _ := NewPool( - func() *exec.Cmd { return exec.Command("php", "php-src/tests/client.php", "echo", "pipes") }, + func() *exec.Cmd { return exec.Command("php", "tests/client.php", "echo", "pipes") }, NewPipeFactory(), Config{ NumWorkers: 1, diff --git a/php-src/tests/broken.php b/tests/broken.php index b1a3839e..b1a3839e 100644 --- a/php-src/tests/broken.php +++ b/tests/broken.php diff --git a/php-src/tests/client.php b/tests/client.php index fd5d60be..31caa410 100644 --- a/php-src/tests/client.php +++ b/tests/client.php @@ -3,7 +3,7 @@ use Spiral\Goridge; ini_set('display_errors', 'stderr'); -require dirname(__DIR__) . "/../vendor/autoload.php"; +require dirname(__DIR__) . "/vendor/autoload.php"; if (count($argv) < 3) { die("need 2 arguments"); diff --git a/php-src/tests/delay.php b/tests/delay.php index bfde2fc4..bfde2fc4 100644 --- a/php-src/tests/delay.php +++ b/tests/delay.php diff --git a/php-src/tests/echo.php b/tests/echo.php index ba58ff30..ba58ff30 100644 --- a/php-src/tests/echo.php +++ b/tests/echo.php diff --git a/php-src/tests/error.php b/tests/error.php index ebd3418b..ebd3418b 100644 --- a/php-src/tests/error.php +++ b/tests/error.php diff --git a/php-src/tests/failboot.php b/tests/failboot.php index fa8b96f6..fa8b96f6 100644 --- a/php-src/tests/failboot.php +++ b/tests/failboot.php diff --git a/php-src/tests/head.php b/tests/head.php index 4f4e4061..4f4e4061 100644 --- a/php-src/tests/head.php +++ b/tests/head.php diff --git a/php-src/tests/http/client.php b/tests/http/client.php index 3b6b5dc6..166acfb6 100644 --- a/php-src/tests/http/client.php +++ b/tests/http/client.php @@ -4,7 +4,7 @@ use Spiral\Goridge; use Spiral\RoadRunner; ini_set('display_errors', 'stderr'); -require dirname(__DIR__) . "/../../vendor/autoload.php"; +require dirname(__DIR__) . "/../vendor/autoload.php"; if (count($argv) < 3) { die("need 2 arguments"); diff --git a/php-src/tests/http/cookie.php b/tests/http/cookie.php index 196ceee2..196ceee2 100644 --- a/php-src/tests/http/cookie.php +++ b/tests/http/cookie.php diff --git a/php-src/tests/http/data.php b/tests/http/data.php index c5e0bab0..c5e0bab0 100644 --- a/php-src/tests/http/data.php +++ b/tests/http/data.php diff --git a/php-src/tests/http/echo.php b/tests/http/echo.php index 7004ada0..7004ada0 100644 --- a/php-src/tests/http/echo.php +++ b/tests/http/echo.php diff --git a/php-src/tests/http/echoerr.php b/tests/http/echoerr.php index da2ff4d8..da2ff4d8 100644 --- a/php-src/tests/http/echoerr.php +++ b/tests/http/echoerr.php diff --git a/php-src/tests/http/env.php b/tests/http/env.php index 1e29926f..1e29926f 100644 --- a/php-src/tests/http/env.php +++ b/tests/http/env.php diff --git a/php-src/tests/http/error.php b/tests/http/error.php index 6df0d4b5..6df0d4b5 100644 --- a/php-src/tests/http/error.php +++ b/tests/http/error.php diff --git a/php-src/tests/http/error2.php b/tests/http/error2.php index 617b5a3f..617b5a3f 100644 --- a/php-src/tests/http/error2.php +++ b/tests/http/error2.php diff --git a/php-src/tests/http/header.php b/tests/http/header.php index e5b295b6..e5b295b6 100644 --- a/php-src/tests/http/header.php +++ b/tests/http/header.php diff --git a/php-src/tests/http/payload.php b/tests/http/payload.php index a16984c5..a16984c5 100644 --- a/php-src/tests/http/payload.php +++ b/tests/http/payload.php diff --git a/php-src/tests/http/pid.php b/tests/http/pid.php index 1cc322bf..1cc322bf 100644 --- a/php-src/tests/http/pid.php +++ b/tests/http/pid.php diff --git a/php-src/tests/http/upload.php b/tests/http/upload.php index 2f7c0b64..2f7c0b64 100644 --- a/php-src/tests/http/upload.php +++ b/tests/http/upload.php diff --git a/php-src/tests/pid.php b/tests/pid.php index a8cfa229..a8cfa229 100644 --- a/php-src/tests/pid.php +++ b/tests/pid.php diff --git a/php-src/tests/sample.txt b/tests/sample.txt index eed7e79a..eed7e79a 100644 --- a/php-src/tests/sample.txt +++ b/tests/sample.txt diff --git a/php-src/tests/slow-client.php b/tests/slow-client.php index 2722868c..2722868c 100644 --- a/php-src/tests/slow-client.php +++ b/tests/slow-client.php diff --git a/php-src/tests/stop.php b/tests/stop.php index caa485d6..caa485d6 100644 --- a/php-src/tests/stop.php +++ b/tests/stop.php diff --git a/worker_test.go b/worker_test.go index 053a97b1..b3a3fc46 100644 --- a/worker_test.go +++ b/worker_test.go @@ -7,7 +7,7 @@ import ( ) func Test_GetState(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, err := NewPipeFactory().SpawnWorker(cmd) go func() { @@ -23,7 +23,7 @@ func Test_GetState(t *testing.T) { } func Test_Kill(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, err := NewPipeFactory().SpawnWorker(cmd) go func() { @@ -39,7 +39,7 @@ func Test_Kill(t *testing.T) { } func Test_Echo(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, _ := NewPipeFactory().SpawnWorker(cmd) go func() { @@ -58,7 +58,7 @@ func Test_Echo(t *testing.T) { } func Test_BadPayload(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, _ := NewPipeFactory().SpawnWorker(cmd) go func() { @@ -75,16 +75,16 @@ func Test_BadPayload(t *testing.T) { } func Test_NotStarted_String(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, _ := newWorker(cmd) - assert.Contains(t, w.String(), "php php-src/tests/client.php echo pipes") + assert.Contains(t, w.String(), "php tests/client.php echo pipes") assert.Contains(t, w.String(), "inactive") assert.Contains(t, w.String(), "numExecs: 0") } func Test_NotStarted_Exec(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, _ := newWorker(cmd) @@ -97,7 +97,7 @@ func Test_NotStarted_Exec(t *testing.T) { } func Test_String(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, _ := NewPipeFactory().SpawnWorker(cmd) go func() { @@ -105,13 +105,13 @@ func Test_String(t *testing.T) { }() defer w.Stop() - assert.Contains(t, w.String(), "php php-src/tests/client.php echo pipes") + assert.Contains(t, w.String(), "php tests/client.php echo pipes") assert.Contains(t, w.String(), "ready") assert.Contains(t, w.String(), "numExecs: 0") } func Test_Echo_Slow(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/slow-client.php", "echo", "pipes", "10", "10") + cmd := exec.Command("php", "tests/slow-client.php", "echo", "pipes", "10", "10") w, _ := NewPipeFactory().SpawnWorker(cmd) go func() { @@ -130,7 +130,7 @@ func Test_Echo_Slow(t *testing.T) { } func Test_Broken(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "broken", "pipes") + cmd := exec.Command("php", "tests/client.php", "broken", "pipes") w, err := NewPipeFactory().SpawnWorker(cmd) go func() { @@ -146,7 +146,7 @@ func Test_Broken(t *testing.T) { } func Test_OnStarted(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "broken", "pipes") + cmd := exec.Command("php", "tests/client.php", "broken", "pipes") assert.Nil(t, cmd.Start()) w, err := newWorker(cmd) @@ -157,7 +157,7 @@ func Test_OnStarted(t *testing.T) { } func Test_Error(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "error", "pipes") + cmd := exec.Command("php", "tests/client.php", "error", "pipes") w, _ := NewPipeFactory().SpawnWorker(cmd) go func() { @@ -174,7 +174,7 @@ func Test_Error(t *testing.T) { } func Test_NumExecs(t *testing.T) { - cmd := exec.Command("php", "php-src/tests/client.php", "echo", "pipes") + cmd := exec.Command("php", "tests/client.php", "echo", "pipes") w, _ := NewPipeFactory().SpawnWorker(cmd) go func() { |