From 76c96347ffe4831948418b0b84db77d7f1777275 Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Thu, 25 May 2023 13:58:10 +0100 Subject: [PATCH] tests: add basic remote bake context test Signed-off-by: Justin Chadwell --- tests/bake.go | 53 +++++++++++++++++++++++++++++++++++++++ tests/integration_test.go | 1 + 2 files changed, 54 insertions(+) create mode 100644 tests/bake.go diff --git a/tests/bake.go b/tests/bake.go new file mode 100644 index 00000000..0e64d1d1 --- /dev/null +++ b/tests/bake.go @@ -0,0 +1,53 @@ +package tests + +import ( + "path/filepath" + "testing" + + "github.com/containerd/continuity/fs/fstest" + "github.com/docker/buildx/util/gitutil" + "github.com/moby/buildkit/util/testutil/integration" + "github.com/stretchr/testify/require" +) + +func bakeCmd(sb integration.Sandbox, dir string, args ...string) (string, error) { + args = append([]string{"bake", "--progress=quiet"}, args...) + cmd := buildxCmd(sb, args...) + cmd.Dir = dir + out, err := cmd.CombinedOutput() + return string(out), err +} + +var bakeTests = []func(t *testing.T, sb integration.Sandbox){ + testBakeRemote, +} + +func testBakeRemote(t *testing.T, sb integration.Sandbox) { + bakefile := []byte(` +target "default" { + dockerfile-inline = <