Add test for docker commands output

parent ce5acc6f
package docker_test
import (
"bytes"
"net/url"
"os"
"os/exec"
"regexp"
"strings"
"testing"
"time"
......@@ -185,6 +187,36 @@ func TestDockerCommandBuildCancel(t *testing.T) {
assert.EqualError(t, err, "canceled")
}
func TestDockerCommandOutput(t *testing.T) {
if helpers.SkipIntegrationTests(t, "docker", "info") {
return
}
successfulBuild, err := common.GetRemoteSuccessfulBuild()
assert.NoError(t, err)
build := &common.Build{
GetBuildResponse: successfulBuild,
Runner: &common.RunnerConfig{
RunnerSettings: common.RunnerSettings{
Executor: "docker",
Docker: &common.DockerConfig{
Image: "alpine",
},
},
},
}
var buf []byte
buffer := bytes.NewBuffer(buf)
err = build.Run(&common.Config{}, &common.Trace{Writer: buffer})
assert.NoError(t, err)
re, err := regexp.Compile("(?m)^Cloning into '/builds/gitlab-org/gitlab-test'...")
assert.NoError(t, err)
assert.Regexp(t, re, buffer.String())
}
func TestDockerPrivilegedServiceAccessingBuildsFolder(t *testing.T) {
if helpers.SkipIntegrationTests(t, "docker", "info") {
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment