From 304b891eec532ca9d8c14f4c605493160a53370b Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Wed, 6 Jun 2018 18:33:55 +0300 Subject: tests fixed for windows --- server_config_test.go | 42 ++++++++---------------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) (limited to 'server_config_test.go') diff --git a/server_config_test.go b/server_config_test.go index 42d2fec4..e3ef6ec0 100644 --- a/server_config_test.go +++ b/server_config_test.go @@ -3,9 +3,7 @@ package roadrunner import ( "testing" "github.com/stretchr/testify/assert" - "os/user" "runtime" - "strconv" ) func Test_ServerConfig_PipeFactory(t *testing.T) { @@ -50,6 +48,10 @@ func Test_ServerConfig_SocketFactory(t *testing.T) { } func Test_ServerConfig_UnixSocketFactory(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("not supported on " + runtime.GOOS) + } + cfg := &ServerConfig{Relay: "unix://unix.sock"} f, err := cfg.makeFactory() defer f.Close() @@ -61,41 +63,13 @@ func Test_ServerConfig_UnixSocketFactory(t *testing.T) { } func Test_ServerConfig_ErrorFactory(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("not supported on " + runtime.GOOS) + } + cfg := &ServerConfig{Relay: "uni:unix.sock"} f, err := cfg.makeFactory() assert.Nil(t, f) assert.Error(t, err) assert.Equal(t, "invalid relay DSN (pipes, tcp://:6001, unix://rr.sock)", err.Error()) } - -func Test_ServerConfig_Cmd(t *testing.T) { - cfg := &ServerConfig{ - Command: "php php-src/tests/client.php pipes", - } - - cmd, err := cfg.makeCommand() - assert.NoError(t, err) - assert.NotNil(t, cmd) -} - -func Test_ServerConfig_Cmd_Credentials(t *testing.T) { - if runtime.GOOS == "windows" { - t.Skip("not supported on " + runtime.GOOS) - } - - u, err := user.Current() - assert.NoError(t, err) - - cfg := &ServerConfig{ - Command: "php php-src/tests/client.php pipes", - User: u.Username, - Group: u.Gid, - } - - cmd, err := cfg.makeCommand() - assert.NoError(t, err) - assert.NotNil(t, cmd) - - assert.Equal(t, u.Uid, strconv.Itoa(int(cmd().SysProcAttr.Credential.Uid))) - assert.Equal(t, u.Gid, strconv.Itoa(int(cmd().SysProcAttr.Credential.Gid))) -} -- cgit v1.2.3