Documentation
¶
Index ¶
- func InspectCopyBuckets(dbPath string) error
- func LoadSpectraRoots(spectraFS *sdk.SpectraFS) (types.Folder, types.Folder, error)
- func PrintCopyVerification(stats queue.QueueStats)
- func RunInspectCopyBuckets()
- func SetupCopyTest(cleanSpectraDB bool, removeMigrationDB bool) (*db.DB, types.FSAdapter, types.FSAdapter, error)
- func SetupCopyTestConfig(cleanSpectraDB bool, removeMigrationDB bool) (migration.Config, error)
- func SetupLocalCopyTest(srcPath, dstPath string, removeMigrationDB bool) (*db.DB, types.FSAdapter, types.FSAdapter, error)
- func SetupSpectraFS(configPath string, cleanDB bool) (*sdk.SpectraFS, error)
- func VerifyCopyCompletion(database *db.DB) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InspectCopyBuckets ¶
InspectCopyBuckets opens the database and prints the first 10 items from each copy status bucket for each level. If a bucket doesn't exist, it prints that information.
func LoadSpectraRoots ¶
LoadSpectraRoots fetches the Spectra root nodes and maps them to types.Folder structures.
func PrintCopyVerification ¶
func PrintCopyVerification(stats queue.QueueStats)
PrintCopyVerification prints the copy phase statistics in a formatted way.
func RunInspectCopyBuckets ¶
func RunInspectCopyBuckets()
RunInspectCopyBuckets is a main function that can be called from a test or standalone
func SetupCopyTest ¶
func SetupCopyTest(cleanSpectraDB bool, removeMigrationDB bool) (*db.DB, types.FSAdapter, types.FSAdapter, error)
SetupCopyTest sets up the database and adapters for copy phase testing. cleanSpectraDB controls whether to delete the existing Spectra DB (use false for copy tests). removeMigrationDB controls whether to remove the migration database (use false to use pre-provisioned DB). Returns the database instance, source adapter, destination adapter, and error.
func SetupCopyTestConfig ¶
SetupCopyTestConfig returns a full migration.Config for the copy test (Spectra roots, DB at copy/shared/main_test.db). Use with migration.LetsMigrate to run traversal and produce a DuckDB ready for copy-phase tests. cleanSpectraDB: false to keep existing Spectra DB. removeMigrationDB: true to create a fresh migration DB.
func SetupLocalCopyTest ¶
func SetupLocalCopyTest(srcPath, dstPath string, removeMigrationDB bool) (*db.DB, types.FSAdapter, types.FSAdapter, error)
SetupLocalCopyTest sets up the database and adapters for local filesystem copy phase testing. srcPath and dstPath are absolute paths to the source and destination directories. removeMigrationDB controls whether to remove the migration database (use true for fresh test). Returns the DuckDB instance, source adapter, destination adapter, and error.
func SetupSpectraFS ¶
SetupSpectraFS creates a SpectraFS instance, handling DB cleanup appropriately. Since each test run is a separate process, we can't rely on in-memory state. Instead, we check if the DB file exists (from the config) and only clean it if explicitly requested. The SDK should load existing data from the DB file if it exists. The configPath should point to a JSON config file that contains the db_path.
func VerifyCopyCompletion ¶
VerifyCopyCompletion verifies that all copy status buckets are in expected state. Uses stats bucket for O(1) lookups instead of O(N) scans. Checks that no pending copy tasks remain and reports successful/failed counts.
Types ¶
This section is empty.