Skip to content

Commit

Permalink
Merge pull request moby#39554 from thaJeztah/session_not_experimental
Browse files Browse the repository at this point in the history
integration: run build session tests on non-experimental
  • Loading branch information
AkihiroSuda authored Jul 19, 2019
2 parents 0949fe8 + becd29c commit 88f6b5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
15 changes: 3 additions & 12 deletions integration/build/build_session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/versions"
dclient "github.com/docker/docker/client"
"github.com/docker/docker/internal/test/daemon"
"github.com/docker/docker/internal/test/fakecontext"
"github.com/docker/docker/internal/test/request"
"github.com/moby/buildkit/session"
Expand All @@ -23,18 +23,9 @@ import (

func TestBuildWithSession(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), "experimental in older versions")

var client dclient.APIClient
if !testEnv.DaemonInfo.ExperimentalBuild {
skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")

d := daemon.New(t, daemon.WithExperimental)
d.StartWithBusybox(t)
defer d.Stop(t)
client = d.NewClientT(t)
} else {
client = testEnv.APIClient()
}
client := testEnv.APIClient()

dockerfile := `
FROM busybox
Expand Down
20 changes: 3 additions & 17 deletions integration/session/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"net/http"
"testing"

"github.com/docker/docker/internal/test/daemon"
"github.com/docker/docker/api/types/versions"
req "github.com/docker/docker/internal/test/request"
"gotest.tools/assert"
is "gotest.tools/assert/cmp"
Expand All @@ -13,17 +13,10 @@ import (

func TestSessionCreate(t *testing.T) {
skip.If(t, testEnv.OSType == "windows", "FIXME")
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), "experimental in older versions")

defer setupTest(t)()
daemonHost := req.DaemonHost()
if !testEnv.DaemonInfo.ExperimentalBuild {
skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")

d := daemon.New(t, daemon.WithExperimental)
d.StartWithBusybox(t)
defer d.Stop(t)
daemonHost = d.Sock()
}

res, body, err := req.Post("/session",
req.Host(daemonHost),
Expand All @@ -41,17 +34,10 @@ func TestSessionCreate(t *testing.T) {

func TestSessionCreateWithBadUpgrade(t *testing.T) {
skip.If(t, testEnv.OSType == "windows", "FIXME")
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), "experimental in older versions")

defer setupTest(t)()
daemonHost := req.DaemonHost()
if !testEnv.DaemonInfo.ExperimentalBuild {
skip.If(t, testEnv.IsRemoteDaemon, "cannot run daemon when remote daemon")

d := daemon.New(t, daemon.WithExperimental)
d.StartWithBusybox(t)
defer d.Stop(t)
daemonHost = d.Sock()
}

res, body, err := req.Post("/session", req.Host(daemonHost))
assert.NilError(t, err)
Expand Down

0 comments on commit 88f6b5e

Please sign in to comment.