...

Package kiviktest

import "github.com/go-kivik/kivik/v4/kiviktest"
Overview
Index
Subdirectories

Overview ▾

Package kiviktest provides integration tests for kivik.

This package is considered internal to the Kivik project, and is not subject to semver rules. It may change at any time, without any notice. Use at your own risk. You have been warned!

Constants

The available test suites

const (
    SuiteAuto        = "auto"
    SuitePouchLocal  = "pouch"
    SuitePouchRemote = "pouchRemote"
    SuiteCouch22     = "couch22"
    SuiteCouch23     = "couch23"
    SuiteCouch30     = "couch30"
    SuiteCouch31     = "couch31"
    SuiteCouch32     = "couch32"
    SuiteCouch33     = "couch33"
    SuiteKivikServer = "kivikServer"
    SuiteKivikMemory = "kivikMemory"
    SuiteKivikSQLite = "kivikSQLite"
    SuiteKivikFS     = "kivikFilesystem"
)

Variables

AllSuites is a list of all defined suites.

var AllSuites = []string{
    SuitePouchLocal,
    SuitePouchRemote,
    SuiteCouch22,
    SuiteCouch30,
    SuiteCouch31,
    SuiteCouch32,
    SuiteCouch33,
    SuiteKivikMemory,
    SuiteKivikFS,
    SuiteKivikSQLite,
    SuiteKivikServer,
}

func CleanupTests

func CleanupTests(driver, dsn string, verbose bool) error

CleanupTests attempts to clean up any stray test databases created by a previous test run.

func ConnectClients

func ConnectClients(t *testing.T, driverName, dsn string, opts kivik.Option) (*kt.Context, error)

ConnectClients connects clients.

func DoTest

func DoTest(t *testing.T, suite, envName string)

DoTest runs a suite of tests.

func ListTests

func ListTests()

ListTests prints a list of available test suites to stdout.

func RegisterSuite

func RegisterSuite(suite string, conf kt.SuiteConfig)

RegisterSuite registers a Suite as available for testing.

func RunTests

func RunTests(opts Options)

RunTests runs the requested test suites against the requested driver and DSN.

func RunTestsInternal

func RunTestsInternal(ctx *kt.Context, suite string)

RunTestsInternal is for internal use only.

func Test

func Test(t *testing.T, driver, dsn string, testSuites []string, rw bool)

Test is the main test entry point when running tests through the command line tool.

type Options

Options are the options to run a test from the command line tool.

type Options struct {
    Driver  string
    DSN     string
    Verbose bool
    RW      bool
    Match   string
    Suites  []string
    Cleanup bool
}

Subdirectories

Name Synopsis
..
client Package client provides integration tests for the kivik client.
db Package db provides integration tests for the kivik db.
kt Package kt provides common utilities for Kivik tests.