Browse code

integration-cli/build: Alias `cmp` as `is`

To make it consistent with other tests.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>

Paweł Gronowski authored on 2023/09/04 23:23:35
Showing 1 changed files
... ...
@@ -26,7 +26,7 @@ import (
26 26
 	"github.com/moby/buildkit/frontend/dockerfile/command"
27 27
 	"github.com/opencontainers/go-digest"
28 28
 	"gotest.tools/v3/assert"
29
-	"gotest.tools/v3/assert/cmp"
29
+	is "gotest.tools/v3/assert/cmp"
30 30
 	"gotest.tools/v3/icmd"
31 31
 )
32 32
 
... ...
@@ -4626,7 +4626,7 @@ func (s *DockerCLIBuildSuite) TestBuildMultiStageArg(c *testing.T) {
4626 4626
 	result.Assert(c, icmd.Success)
4627 4627
 
4628 4628
 	imgs := strings.Split(strings.TrimSpace(result.Stdout()), "\n")
4629
-	assert.Assert(c, cmp.Len(imgs, 1), `only one image with "multifromtest" label is expected`)
4629
+	assert.Assert(c, is.Len(imgs, 1), `only one image with "multifromtest" label is expected`)
4630 4630
 
4631 4631
 	parentID := imgs[0]
4632 4632
 
... ...
@@ -4656,7 +4656,7 @@ func (s *DockerCLIBuildSuite) TestBuildMultiStageGlobalArg(c *testing.T) {
4656 4656
 	result.Assert(c, icmd.Success)
4657 4657
 
4658 4658
 	imgs := strings.Split(strings.TrimSpace(result.Stdout()), "\n")
4659
-	assert.Assert(c, cmp.Len(imgs, 1), `only one image with "multifromtest" label is expected`)
4659
+	assert.Assert(c, is.Len(imgs, 1), `only one image with "multifromtest" label is expected`)
4660 4660
 
4661 4661
 	parentID := imgs[0]
4662 4662
 
... ...
@@ -4783,7 +4783,7 @@ func (s *DockerCLIBuildSuite) TestBuildFollowSymlinkToFile(c *testing.T) {
4783 4783
 	cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
4784 4784
 
4785 4785
 	out := cli.DockerCmd(c, "run", "--rm", name, "cat", "target").Combined()
4786
-	assert.Assert(c, cmp.Regexp("^bar$", out))
4786
+	assert.Assert(c, is.Regexp("^bar$", out))
4787 4787
 
4788 4788
 	// change target file should invalidate cache
4789 4789
 	err = os.WriteFile(filepath.Join(ctx.Dir, "foo"), []byte("baz"), 0o644)
... ...
@@ -4792,7 +4792,7 @@ func (s *DockerCLIBuildSuite) TestBuildFollowSymlinkToFile(c *testing.T) {
4792 4792
 	result := cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
4793 4793
 	assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
4794 4794
 	out = cli.DockerCmd(c, "run", "--rm", name, "cat", "target").Combined()
4795
-	assert.Assert(c, cmp.Regexp("^baz$", out))
4795
+	assert.Assert(c, is.Regexp("^baz$", out))
4796 4796
 }
4797 4797
 
4798 4798
 func (s *DockerCLIBuildSuite) TestBuildFollowSymlinkToDir(c *testing.T) {
... ...
@@ -4813,7 +4813,7 @@ func (s *DockerCLIBuildSuite) TestBuildFollowSymlinkToDir(c *testing.T) {
4813 4813
 	cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
4814 4814
 
4815 4815
 	out := cli.DockerCmd(c, "run", "--rm", name, "cat", "abc", "def").Combined()
4816
-	assert.Assert(c, cmp.Regexp("^barbaz$", out))
4816
+	assert.Assert(c, is.Regexp("^barbaz$", out))
4817 4817
 
4818 4818
 	// change target file should invalidate cache
4819 4819
 	err = os.WriteFile(filepath.Join(ctx.Dir, "foo/def"), []byte("bax"), 0o644)
... ...
@@ -4822,7 +4822,7 @@ func (s *DockerCLIBuildSuite) TestBuildFollowSymlinkToDir(c *testing.T) {
4822 4822
 	result := cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
4823 4823
 	assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
4824 4824
 	out = cli.DockerCmd(c, "run", "--rm", name, "cat", "abc", "def").Combined()
4825
-	assert.Assert(c, cmp.Regexp("^barbax$", out))
4825
+	assert.Assert(c, is.Regexp("^barbax$", out))
4826 4826
 }
4827 4827
 
4828 4828
 // TestBuildSymlinkBasename tests that target file gets basename from symlink,
... ...
@@ -4844,7 +4844,7 @@ func (s *DockerCLIBuildSuite) TestBuildSymlinkBasename(c *testing.T) {
4844 4844
 	cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
4845 4845
 
4846 4846
 	out := cli.DockerCmd(c, "run", "--rm", name, "cat", "asymlink").Combined()
4847
-	assert.Assert(c, cmp.Regexp("^bar$", out))
4847
+	assert.Assert(c, is.Regexp("^bar$", out))
4848 4848
 }
4849 4849
 
4850 4850
 // #17827