mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #39554 from thaJeztah/session_not_experimental
integration: run build session tests on non-experimental
This commit is contained in:
commit
88f6b5e746
2 changed files with 6 additions and 29 deletions
|
@ -9,8 +9,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
|
"github.com/docker/docker/api/types/versions"
|
||||||
dclient "github.com/docker/docker/client"
|
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/fakecontext"
|
||||||
"github.com/docker/docker/internal/test/request"
|
"github.com/docker/docker/internal/test/request"
|
||||||
"github.com/moby/buildkit/session"
|
"github.com/moby/buildkit/session"
|
||||||
|
@ -23,18 +23,9 @@ import (
|
||||||
|
|
||||||
func TestBuildWithSession(t *testing.T) {
|
func TestBuildWithSession(t *testing.T) {
|
||||||
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
skip.If(t, testEnv.DaemonInfo.OSType == "windows")
|
||||||
|
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), "experimental in older versions")
|
||||||
|
|
||||||
var client dclient.APIClient
|
client := testEnv.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()
|
|
||||||
}
|
|
||||||
|
|
||||||
dockerfile := `
|
dockerfile := `
|
||||||
FROM busybox
|
FROM busybox
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/docker/docker/internal/test/daemon"
|
"github.com/docker/docker/api/types/versions"
|
||||||
req "github.com/docker/docker/internal/test/request"
|
req "github.com/docker/docker/internal/test/request"
|
||||||
"gotest.tools/assert"
|
"gotest.tools/assert"
|
||||||
is "gotest.tools/assert/cmp"
|
is "gotest.tools/assert/cmp"
|
||||||
|
@ -13,17 +13,10 @@ import (
|
||||||
|
|
||||||
func TestSessionCreate(t *testing.T) {
|
func TestSessionCreate(t *testing.T) {
|
||||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||||
|
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), "experimental in older versions")
|
||||||
|
|
||||||
defer setupTest(t)()
|
defer setupTest(t)()
|
||||||
daemonHost := req.DaemonHost()
|
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",
|
res, body, err := req.Post("/session",
|
||||||
req.Host(daemonHost),
|
req.Host(daemonHost),
|
||||||
|
@ -41,17 +34,10 @@ func TestSessionCreate(t *testing.T) {
|
||||||
|
|
||||||
func TestSessionCreateWithBadUpgrade(t *testing.T) {
|
func TestSessionCreateWithBadUpgrade(t *testing.T) {
|
||||||
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
skip.If(t, testEnv.OSType == "windows", "FIXME")
|
||||||
|
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.39"), "experimental in older versions")
|
||||||
|
|
||||||
defer setupTest(t)()
|
defer setupTest(t)()
|
||||||
daemonHost := req.DaemonHost()
|
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))
|
res, body, err := req.Post("/session", req.Host(daemonHost))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
Loading…
Reference in a new issue