// Copyright 2022 The LevelDB-Go and Pebble Authors. All rights reserved. Use // of this source code is governed by a BSD-style license that can be found in // the LICENSE file. // Package crossversion builds on the metamorphic testing implemented in // internal/metamorphic, performing metamorphic testing across versions of // Pebble. This improves test coverage of upgrade and migration code paths. package crossversion import ( "bytes" "context" "flag" "fmt" "io" "math/rand" "os" "os/exec" "path/filepath" "strconv" "strings" "sync" "testing" "time" "unicode" "github.com/cockroachdb/errors" "github.com/cockroachdb/pebble/metamorphic" "github.com/cockroachdb/pebble/vfs" "github.com/stretchr/testify/require" ) var ( factor int seed int64 versions pebbleVersions artifactsDir string streamOutput bool ) func init() { // NB: If you add new command-line flags, you should update the // reproductionCommand function. flag.Int64Var(&seed, "seed", 0, `a pseudorandom number generator seed`) flag.IntVar(&factor, "factor", 10, `the number of data directories to carry forward from one version's run to the subsequent version's runs.`) flag.Var(&versions, "version", `a comma-separated 3-tuple defining a Pebble version to test. The expected format is