drivertest

package
v0.0.0-...-915478c Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package drivertest provides a conformance test for implementations of driver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunConformanceTests

func RunConformanceTests(t *testing.T, newHarness HarnessMaker, pathToTestdata string)

RunConformanceTests runs conformance tests for provider implementations of blob. pathToTestdata is a (possibly relative) path to a directory containing blob/testdata/* (e.g., test-small.txt).

Types

type Harness

type Harness interface {
	// MakeBucket creates a *blob.Bucket to test.
	// Multiple calls to MakeBucket during a test run must refer to	the
	// same storage bucket; i.e., a blob created using one *blob.Bucket must
	// be readable by a subsequent *blob.Bucket.
	MakeBucket(ctx context.Context) (*blob.Bucket, error)
	Close()
}

Harness descibes the functionality test harnesses must provide to run conformance tests.

type HarnessMaker

type HarnessMaker func(ctx context.Context, t *testing.T) (Harness, error)

HarnessMaker describes functions that construct a harness for running tests. It is called exactly once per test; Harness.Close() will be called when the test is complete.

Jump to

Keyboard shortcuts

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