testaid

package
v0.0.0-...-d4f9e80 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TestCDBBad is a test database that points to an invalid but existing CDB
	TestCDBBad = TestDB{Driver: "cdb", Path: "THIS_WILL_BE_OVERRIDDEN_BADCDB"} // Path points to something that exists, but is not in CDB format, should be overridden from Run()
	// TestCDB points to a valid CDB with data, it is pre-compiled
	TestCDB = TestDB{Driver: "cdb", Path: "THIS_WILL_BE_OVERRIDDEN_CDB"}
	// TestCDBv2 points to a valid CDB with data, it is pre-compiled
	TestCDBv2 = TestDB{Driver: "cdb", Path: "THIS_WILL_BE_OVERRIDDEN_CDBV2"}
	// TestRDB points to a temporary RDB, it is compiled on each run
	TestRDB = TestDB{Driver: "rocksdb", Path: "THIS_WILL_BE_OVERRIDDEN_RDB", Flavour: "keys v1"}
	// TestRDBV2 points to a temporary RDB with v2 keys, it is compiled on each run
	TestRDBV2 = TestDB{Driver: "rocksdb", Path: "THIS_WILL_BE_OVERRIDDEN_RDB", Flavour: "keys v2"}
)
View Source
var TestDBs []TestDB

TestDBs consists of all test databases

Functions

func MkTestCert

func MkTestCert(t *testing.T) string

MkTestCert creates a temporary file PEM file and write it to disk. The file contains both a private key and a cert. returns the file name where the cert/key were saved. The caller must delete the file.

func Run

func Run(m *testing.M, relativePath string) int

Run creates the test databases and runs the tests. It returns an exit code to pass to os.Exit.

Types

type TestDB

type TestDB struct {
	Driver  string
	Path    string
	Flavour string
}

TestDB is a description of a test database

Jump to

Keyboard shortcuts

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