integration: run build session tests on non-experimental

The session endpoint is no longer experimental since
01c9e7082e, so we don't
need to start an experimental daemon.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit becd29c665)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-07-17 23:40:37 +02:00
parent 7e76438537
commit 1d795b53d3
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 6 additions and 29 deletions

View file

@ -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"
@ -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

View file

@ -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"
@ -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),
@ -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)