satellite/metabase: rename BeginObjectExactVersion method

With the upcoming versioning changes `BeginObjectExactVersion` makes
only sense for testing. Currently this does not rename the options
struct or move it into `metabasetest`, because it would create a
significant amount of merge/rebase noise.

Change-Id: Iafa2f81a05ae66320bc6a839828217ec94c63e1f
This commit is contained in:
Egon Elbre 2023-10-02 16:14:52 +03:00
parent bec981aa7a
commit c6436e1500
7 changed files with 8 additions and 8 deletions

View File

@ -136,7 +136,7 @@ func (s *expiredScenario) run(ctx *testcontext.Context, b *testing.B, db *metaba
StreamID: testrand.UUID(),
}
s.objectStream = append(s.objectStream, objectStream)
_, err := db.BeginObjectExactVersion(ctx, metabase.BeginObjectExactVersion{
_, err := db.TestingBeginObjectExactVersion(ctx, metabase.BeginObjectExactVersion{
ObjectStream: objectStream,
Encryption: storj.EncryptionParameters{
CipherSuite: storj.EncAESGCM,

View File

@ -119,7 +119,7 @@ func (s *scenario) run(ctx *testcontext.Context, b *testing.B, db *metabase.DB)
totalUpload.Record(func() {
beginObject.Record(func() {
_, err := db.BeginObjectExactVersion(ctx, metabase.BeginObjectExactVersion{
_, err := db.TestingBeginObjectExactVersion(ctx, metabase.BeginObjectExactVersion{
ObjectStream: objectStream,
Encryption: storj.EncryptionParameters{
CipherSuite: storj.EncAESGCM,

View File

@ -191,8 +191,8 @@ func (opts *BeginObjectExactVersion) Verify() error {
return nil
}
// BeginObjectExactVersion adds a pending object to the database, with specific version.
func (db *DB) BeginObjectExactVersion(ctx context.Context, opts BeginObjectExactVersion) (committed Object, err error) {
// TestingBeginObjectExactVersion adds a pending object to the database, with specific version.
func (db *DB) TestingBeginObjectExactVersion(ctx context.Context, opts BeginObjectExactVersion) (committed Object, err error) {
defer mon.Task()(&ctx)(&err)
if err := opts.Verify(); err != nil {

View File

@ -457,7 +457,7 @@ func TestDeleteZombieObjects(t *testing.T) {
t.Run("migrated objects", func(t *testing.T) {
defer metabasetest.DeleteAll{}.Check(ctx, t, db)
_, err := db.BeginObjectExactVersion(ctx, metabase.BeginObjectExactVersion{
_, err := db.TestingBeginObjectExactVersion(ctx, metabase.BeginObjectExactVersion{
ObjectStream: obj1,
})
require.NoError(t, err)

View File

@ -267,7 +267,7 @@ func (co CreateTestObject) Run(ctx *testcontext.Context, t testing.TB, db *metab
boeOpts = *co.BeginObjectExactVersion
}
object, err := db.BeginObjectExactVersion(ctx, boeOpts)
object, err := db.TestingBeginObjectExactVersion(ctx, boeOpts)
require.NoError(t, err)
createdSegments := []metabase.Segment{}

View File

@ -65,7 +65,7 @@ type BeginObjectExactVersion struct {
// Check runs the test.
func (step BeginObjectExactVersion) Check(ctx *testcontext.Context, t require.TestingT, db *metabase.DB) {
got, err := db.BeginObjectExactVersion(ctx, step.Opts)
got, err := db.TestingBeginObjectExactVersion(ctx, step.Opts)
checkError(t, err, step.ErrClass, step.ErrText)
if step.ErrClass == nil {
require.Equal(t, step.Opts.Version, got.Version)

View File

@ -508,7 +508,7 @@ func insertSegment(ctx context.Context, t *testing.T, planet *testplanet.Planet,
StreamID: testrand.UUID(),
}
_, err := metabaseDB.BeginObjectExactVersion(ctx, metabase.BeginObjectExactVersion{
_, err := metabaseDB.TestingBeginObjectExactVersion(ctx, metabase.BeginObjectExactVersion{
ObjectStream: obj,
Encryption: storj.EncryptionParameters{
CipherSuite: storj.EncAESGCM,