mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: github.com/moby/buildkit db304eb93126 (v0.13.0-dev)
full diff: d6e142600e...db304eb931
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
18
vendor/github.com/moby/buildkit/util/testutil/integration/util.go
generated
vendored
18
vendor/github.com/moby/buildkit/util/testutil/integration/util.go
generated
vendored
@ -16,12 +16,23 @@ import (
|
||||
"github.com/containerd/continuity/fs/fstest"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/tonistiigi/fsutil"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
var ErrRequirements = errors.Errorf("missing requirements")
|
||||
|
||||
func Tmpdir(t *testing.T, appliers ...fstest.Applier) string {
|
||||
type TmpDirWithName struct {
|
||||
fsutil.FS
|
||||
Name string
|
||||
}
|
||||
|
||||
// This allows TmpDirWithName to continue being used with the `%s` 'verb' on Printf.
|
||||
func (d *TmpDirWithName) String() string {
|
||||
return d.Name
|
||||
}
|
||||
|
||||
func Tmpdir(t *testing.T, appliers ...fstest.Applier) *TmpDirWithName {
|
||||
t.Helper()
|
||||
|
||||
// We cannot use t.TempDir() to create a temporary directory here because
|
||||
@ -38,7 +49,10 @@ func Tmpdir(t *testing.T, appliers ...fstest.Applier) string {
|
||||
err = fstest.Apply(appliers...).Apply(tmpdir)
|
||||
require.NoError(t, err)
|
||||
|
||||
return tmpdir
|
||||
mount, err := fsutil.NewFS(tmpdir)
|
||||
require.NoError(t, err)
|
||||
|
||||
return &TmpDirWithName{FS: mount, Name: tmpdir}
|
||||
}
|
||||
|
||||
func RunCmd(cmd *exec.Cmd, logs map[string]*bytes.Buffer) error {
|
||||
|
Reference in New Issue
Block a user