func defaultGenInput() genInputParam {
	return genInputParam{
		pods:                  []string{"pod1", "pod2", "pod3", "pod4", "pod5"},
		meanNumFilesPerPod:    10,
		maxNumFilesPerPod:     15,
		fileNameLength:        10,
		minFileSizeLeafFactor: 0.5,
		maxFileSizeLeafFactor: 5,
	}
}
TODO(fred): test(CI) - smaller sample size for CI
defaultGenInput generates about 250 MB of random data
package core
import (
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"regexp"
	"sync"
	"testing"
	"time"
	"math/rand"  
	randfile "github.com/oneconcern/datamon/internal/rand"
	"github.com/oneconcern/datamon/pkg/cafs"
	context2 "github.com/oneconcern/datamon/pkg/context"
	"github.com/oneconcern/datamon/pkg/core/mocks"
	"github.com/oneconcern/datamon/pkg/model"
	"github.com/oneconcern/datamon/pkg/storage/localfs"
	"github.com/spf13/afero"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"go.uber.org/zap"
)
const (
	commonLocation   = "common"
	modifiedLocation = "modified"
	conflictsDir     = ".conflicts"
)
var modifRex, contribRex, emailRex *regexp.Regexp
func init() {
	modifRex = regexp.MustCompile(`(\w+)\s+modified this file on`)
	contribRex = regexp.MustCompile(`service-user-(\w+)`)
	emailRex = regexp.MustCompile(`fred@(\w+)\.com`)
}
func testDiamondEnv() (mocks.TestEnv, func(testing.TB) func()) {
	tmp := stringOrDie(ioutil.TempDir("", "test-diamond-"))
	testRoot := stringOrDie(ioutil.TempDir(tmp, "core-data-"))
	sourceDir := filepath.Join(testRoot, "bundle", "source")
	destinationDir := filepath.Join(testRoot, "bundle", "destination")
	originalDir := filepath.Join(testRoot, "internal")
	blobDir := filepath.Join(sourceDir, "blob")
	metaDir := filepath.Join(sourceDir, "meta")
	vmetaDir := filepath.Join(sourceDir, "vmeta")
	wal := filepath.Join(sourceDir, "wal")
	readLog := filepath.Join(sourceDir, "readLog")
	for _, dir := range []string{
		sourceDir, destinationDir, originalDir,
		blobDir, metaDir, vmetaDir, wal, readLog,
	} {
		err := os.MkdirAll(dir, 0700)
		if err != nil {
			panic(fmt.Errorf("could not create test environment dir %s: %v", dir, err))
		}
	}
	return mocks.TestEnv{
			LeafSize:               cafs.DefaultLeafSize,
			Repo:                   "bundle-diamond-test-repo",
			TestRoot:               testRoot,
			SourceDir:              sourceDir,
			BlobDir:                blobDir,
			MetaDir:                metaDir,
			VmetaDir:               vmetaDir,
			Wal:                    wal,
			ReadLog:                readLog,
			DestinationDir:         destinationDir,
			ReBundleEntriesPerFile: 15,
			Original:               originalDir,
			DataDir:                "dir",
		}, func(t testing.TB) func() {
			return func() {
				t.Logf("unwinding diamond test environment")
				_ = os.RemoveAll(tmp)
			}
		}
}
type genInputParam struct {
	pods                  []string
	meanNumFilesPerPod    int
	maxNumFilesPerPod     int
	fileNameLength        int
	minFileSizeLeafFactor float64
	maxFileSizeLeafFactor float64
}
func (p *genInputParam) lastPod() string {
	return p.pods[len(p.pods)-1]
}
func newGenInput(opts ...func(*genInputParam)) genInputParam {
	p := defaultGenInput()
	for _, apply := range opts {
		apply(&p)
	}
	return p
}