From f8ba0ed906b67ced84cc3a8c2550df5c3507f928 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Mon, 9 Nov 2020 13:38:08 +0100 Subject: [PATCH] Rebase docker swarm test (#8163) Fix master tests Signed-off-by: Julien Pivotto --- discovery/dockerswarm/services_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/discovery/dockerswarm/services_test.go b/discovery/dockerswarm/services_test.go index f21caa175..bee41848e 100644 --- a/discovery/dockerswarm/services_test.go +++ b/discovery/dockerswarm/services_test.go @@ -330,21 +330,21 @@ filters: values: ["mon_node-exporter", "mon_grafana"] `, url) var cfg SDConfig - testutil.Ok(t, yaml.Unmarshal([]byte(cfgString), &cfg)) + require.NoError(t, yaml.Unmarshal([]byte(cfgString), &cfg)) d, err := NewDiscovery(&cfg, log.NewNopLogger()) - testutil.Ok(t, err) + require.NoError(t, err) ctx := context.Background() tgs, err := d.refresh(ctx) - testutil.Ok(t, err) + require.NoError(t, err) - testutil.Equals(t, 1, len(tgs)) + require.Equal(t, 1, len(tgs)) tg := tgs[0] - testutil.Assert(t, tg != nil, "tg should not be nil") - testutil.Assert(t, tg.Targets != nil, "tg.targets should not be nil") - testutil.Equals(t, 4, len(tg.Targets)) + require.NotNil(t, tg, "tg should not be nil") + require.NotNil(t, tg.Targets, "tg.targets should not be nil") + require.Equal(t, 4, len(tg.Targets)) for i, lbls := range []model.LabelSet{ { @@ -419,7 +419,7 @@ filters: }, } { t.Run(fmt.Sprintf("item %d", i), func(t *testing.T) { - testutil.Equals(t, lbls, tg.Targets[i]) + require.Equal(t, lbls, tg.Targets[i]) }) } }