packtest

package
v1.66.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BenchmarkIndex

func BenchmarkIndex(b *testing.B, idx pack.ArchiveIndex)

BenchmarkIndex times IndexArchive on an archive of b.N records.

func BenchmarkLookup

func BenchmarkLookup(b *testing.B, idx pack.ArchiveIndex)

BenchmarkLookup times LocateObject over ten indexed archives.

func RandomIndexFile

func RandomIndexFile(records int) pack.IndexFile

RandomIndexFile makes records with random sums, unsorted.

func TestArchiveIndex

func TestArchiveIndex(t *testing.T, idx pack.ArchiveIndex)

TestArchiveIndex exercises indexing, lookup and deletion on idx.

func TestArchiveIndexCopies

func TestArchiveIndexCopies(t *testing.T, idx pack.ArchiveIndex)

TestArchiveIndexCopies checks that LocateCopies finds every committed copy of each ref, however many refs it is asked about, and those in a pending archive only for its own session.

func TestArchiveIndexExclusion

func TestArchiveIndexExclusion(t *testing.T, idx pack.ArchiveIndex)

TestArchiveIndexExclusion checks that LocateObject skips excluded archives.

func TestArchiveIndexSessions

func TestArchiveIndexSessions(t *testing.T, idx pack.ArchiveIndex)

TestArchiveIndexSessions checks session visibility, commit and abort.

func TestArchiveIndexTombstones

func TestArchiveIndexTombstones(t *testing.T, idx pack.ArchiveIndex)

TestArchiveIndexTombstones checks that LocateTombstones finds the tombstone records of the refs and passes over every other record.

func TestArchiveStorage

func TestArchiveStorage(t *testing.T, store pack.ArchiveStorage)

TestArchiveStorage runs the ArchiveStorage contract against an empty store and leaves it empty.

func TestArchiveVersions

func TestArchiveVersions(t *testing.T, idx pack.ArchiveIndex)

TestArchiveVersions checks that idx keeps each archive's creation time, fills in one it lacked, and keeps the versions records were carried with.

func TestClaimIndex

func TestClaimIndex(t *testing.T, idx ClaimingIndex)

TestClaimIndex checks open archives: their claims, finalizing, abandoning, and what a commit or an abort does with them.

Types

type ClaimingIndex

type ClaimingIndex interface {
	pack.ArchiveIndex
	pack.ClaimIndex
}

ClaimingIndex is an archive index that also takes claims on open archives.

type TestArchive

type TestArchive struct {
	// contains filtered or unexported fields
}

TestArchive is a random archive name and index for exercising an ArchiveIndex.

func RandomArchive

func RandomArchive(numRecords int) TestArchive

RandomArchive makes a TestArchive with numRecords random records.

func (TestArchive) Index

func (a TestArchive) Index() pack.IndexFile

Index is the archive's index file.

func (TestArchive) Name

func (a TestArchive) Name() string

Name is the archive's name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL