Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
2.3 kB · 82 lines
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283diff --git a/shells/bash_test.go b/shells/bash_test.goindex 9ed9e65ff..02b6e6d5f 100644--- a/shells/bash_test.go+++ b/shells/bash_test.go@@ -4,11 +4,9 @@ package shells import ( "path"- "runtime" "testing" "github.com/stretchr/testify/assert"- "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitlab-runner/common" ) @@ -90,65 +88,6 @@ func TestBash_CheckForErrors(t *testing.T) { } } -func TestBash_GetConfiguration(t *testing.T) {- tests := map[string]struct {- info common.ShellScriptInfo- cmd string- args []string- os string- }{- `bash`: {- info: common.ShellScriptInfo{Shell: "bash", Type: common.NormalShell},- cmd: "bash",- },- `bash -l`: {- info: common.ShellScriptInfo{Shell: "bash", Type: common.LoginShell},- cmd: "bash",- args: []string{"-l"},- },- `su -s /bin/bash foobar -c bash`: {- info: common.ShellScriptInfo{Shell: "bash", User: "foobar", Type: common.NormalShell},- cmd: "su",- args: []string{"-s", "/bin/bash", "foobar", "-c", "bash"},- os: OSLinux,- },- `su -s /bin/bash foobar -c $'bash -l'`: {- info: common.ShellScriptInfo{Shell: "bash", User: "foobar", Type: common.LoginShell},- cmd: "su",- args: []string{"-s", "/bin/bash", "foobar", "-c", "bash -l"},- os: OSLinux,- },- `su -s /bin/sh foobar -c $'sh -l'`: {- info: common.ShellScriptInfo{Shell: "sh", User: "foobar", Type: common.LoginShell},- cmd: "su",- args: []string{"-s", "/bin/sh", "foobar", "-c", "sh -l"},- os: OSLinux,- },- `su foobar -c $'bash -l'`: {- info: common.ShellScriptInfo{Shell: "bash", User: "foobar", Type: common.LoginShell},- cmd: "su",- args: []string{"foobar", "-c", "bash -l"},- os: "darwin",- },- }-- for tn, tc := range tests {- t.Run(tn, func(t *testing.T) {- if tc.os != "" && tc.os != runtime.GOOS {- t.Skipf("test only runs on %s", tc.os)- }-- sh := BashShell{Shell: tc.info.Shell}- config, err := sh.GetConfiguration(tc.info)- require.NoError(t, err)-- assert.Equal(t, tc.cmd, config.Command)- assert.Equal(t, tc.args, config.Arguments)- assert.Equal(t, tn, config.CmdLine)- })- }-}- func Test_BashWriter_isTmpFile(t *testing.T) { tmpDir := "/foo/bar" bw := BashWriter{TemporaryPath: tmpDir}