Skip some tests in certain condition to run with e2e image

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: e55d6fc8573580f6eea009cd7f1034aa912128ef
Component: engine
This commit is contained in:
Vincent Demeester
2018-03-29 09:10:39 +02:00
parent 39837033f0
commit 28e52cd76e
16 changed files with 58 additions and 31 deletions
@@ -5,7 +5,6 @@ import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"strings"
@@ -249,6 +248,7 @@ RUN cat somefile`
// #35403 #36122
func TestBuildUncleanTarFilenames(t *testing.T) {
skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.37"), "broken in earlier versions")
ctx := context.TODO()
defer setupTest(t)()
@@ -307,9 +307,7 @@ COPY bar /`
// docker/for-linux#135
// #35641
func TestBuildMultiStageLayerLeak(t *testing.T) {
fmt.Println(testEnv.DaemonAPIVersion())
skip.IfCondition(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.38"),
"Don't run on API lower than 1.38 as it has been fixed starting from that version")
skip.IfCondition(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.37"), "broken in earlier versions")
ctx := context.TODO()
defer setupTest(t)()
@@ -10,11 +10,14 @@ import (
"github.com/docker/docker/integration/internal/request"
"github.com/docker/docker/pkg/stdcopy"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/gotestyourself/gotestyourself/skip"
)
// Regression test for #35370
// Makes sure that when following we don't get an EOF error when there are no logs
func TestLogsFollowTailEmpty(t *testing.T) {
// FIXME(vdemeester) fails on a e2e run on linux...
skip.IfCondition(t, testEnv.IsRemoteDaemon())
defer setupTest(t)()
client := request.NewAPIClient(t)
ctx := context.Background()
@@ -155,6 +155,7 @@ func TestContainerNetworkMountsNoChown(t *testing.T) {
}
func TestMountDaemonRoot(t *testing.T) {
skip.If(t, testEnv.DaemonInfo.OSType != "linux" || testEnv.IsRemoteDaemon())
t.Parallel()
client := request.NewAPIClient(t)
@@ -17,10 +17,9 @@ func TestPsFilter(t *testing.T) {
client := request.NewAPIClient(t)
ctx := context.Background()
prev := container.Create(t, ctx, client, container.WithName("prev-"+t.Name()))
topContainerName := "top-" + t.Name()
container.Create(t, ctx, client, container.WithName(topContainerName))
next := container.Create(t, ctx, client, container.WithName("next-"+t.Name()))
prev := container.Create(t, ctx, client)
top := container.Create(t, ctx, client)
next := container.Create(t, ctx, client)
containerIDs := func(containers []types.Container) []string {
entries := []string{}
@@ -31,7 +30,7 @@ func TestPsFilter(t *testing.T) {
}
f1 := filters.NewArgs()
f1.Add("since", topContainerName)
f1.Add("since", top)
q1, err := client.ContainerList(ctx, types.ContainerListOptions{
All: true,
Filters: f1,
@@ -40,7 +39,7 @@ func TestPsFilter(t *testing.T) {
assert.Check(t, is.Contains(containerIDs(q1), next))
f2 := filters.NewArgs()
f2.Add("before", topContainerName)
f2.Add("before", top)
q2, err := client.ContainerList(ctx, types.ContainerListOptions{
All: true,
Filters: f2,
@@ -13,6 +13,7 @@ import (
"github.com/docker/docker/integration/internal/container"
"github.com/docker/docker/integration/internal/request"
"github.com/docker/docker/internal/testutil"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/gotestyourself/gotestyourself/assert"
is "github.com/gotestyourself/gotestyourself/assert/cmp"
)
@@ -36,14 +37,14 @@ func TestVolumesCreateAndList(t *testing.T) {
Name: name,
Mountpoint: fmt.Sprintf("%s/volumes/%s/_data", testEnv.DaemonInfo.DockerRootDir, name),
}
assert.Check(t, is.DeepEqual(vol, expected))
assert.Check(t, is.DeepEqual(vol, expected, cmpopts.EquateEmpty()))
volumes, err := client.VolumeList(ctx, filters.Args{})
assert.NilError(t, err)
assert.Check(t, is.Equal(len(volumes.Volumes), 1))
assert.Check(t, volumes.Volumes[0] != nil)
assert.Check(t, is.DeepEqual(*volumes.Volumes[0], expected))
assert.Check(t, is.DeepEqual(*volumes.Volumes[0], expected, cmpopts.EquateEmpty()))
}
func TestVolumesRemove(t *testing.T) {
@@ -96,7 +97,7 @@ func TestVolumesInspect(t *testing.T) {
Name: name,
Mountpoint: fmt.Sprintf("%s/volumes/%s/_data", testEnv.DaemonInfo.DockerRootDir, name),
}
assert.Check(t, is.DeepEqual(vol, expected))
assert.Check(t, is.DeepEqual(vol, expected, cmpopts.EquateEmpty()))
// comparing CreatedAt field time for the new volume to now. Removing a minute from both to avoid false positive
testCreatedAt, err := time.Parse(time.RFC3339, strings.TrimSpace(vol.CreatedAt))