statetest

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package statetest has a test suite for validating implementations of the serverstate.Interface interface. This must only be imported in "_test.go" files in other packages.

IMPORTANT: This package MUST NOT be imported outside of test code. This package imports "testing" as part of the exported API, and importing this into any non-test-compiled files will introduce the global test flags into the embedding process. This is due to an issue with Go where it registers test flags globally in an Init function on import.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test(t *testing.T, f Factory, rf RestartFactory)

Test runs a validation test suite for a state implementation. All state implementations should pass this suite with no errors to ensure the correct behavior of the state when Waypoint uses it.

func TestApplication

func TestApplication(t *testing.T, factory Factory, restartF RestartFactory)

func TestApplicationPollComplete

func TestApplicationPollComplete(t *testing.T, factory Factory, restartF RestartFactory)

func TestApplicationPollPeek

func TestApplicationPollPeek(t *testing.T, factory Factory, restartF RestartFactory)

func TestArtifact

func TestArtifact(t *testing.T, factory Factory, restartF RestartFactory)

func TestBuild

func TestBuild(t *testing.T, factory Factory, restartF RestartFactory)

func TestConfig

func TestConfig(t *testing.T, factory Factory, restartF RestartFactory)

func TestConfigSource

func TestConfigSource(t *testing.T, factory Factory, restartF RestartFactory)

func TestConfigSourceWatch

func TestConfigSourceWatch(t *testing.T, factory Factory, restartF RestartFactory)

func TestConfigWatch

func TestConfigWatch(t *testing.T, factory Factory, restartF RestartFactory)

func TestDeployment

func TestDeployment(t *testing.T, factory Factory, restartF RestartFactory)

func TestGroup

func TestGroup(t *testing.T, name string, f Factory, rf RestartFactory)

TestGroup runs a specific group of validation tests for a state implementation.

func TestHMAC

func TestHMAC(t *testing.T, factory Factory, restartF RestartFactory)

func TestInstance

func TestInstance(t *testing.T, factory Factory, restartF RestartFactory)

func TestJobAck

func TestJobAck(t *testing.T, factory Factory, rf RestartFactory)

func TestJobAssign

func TestJobAssign(t *testing.T, factory Factory, rf RestartFactory)

func TestJobCancel

func TestJobCancel(t *testing.T, factory Factory, rf RestartFactory)

func TestJobComplete

func TestJobComplete(t *testing.T, factory Factory, rf RestartFactory)

func TestJobCreate_singleton

func TestJobCreate_singleton(t *testing.T, factory Factory, rf RestartFactory)

func TestJobHeartbeat

func TestJobHeartbeat(t *testing.T, factory Factory, rf RestartFactory)

func TestJobIsAssignable

func TestJobIsAssignable(t *testing.T, factory Factory, rf RestartFactory)

func TestJobUpdateRef

func TestJobUpdateRef(t *testing.T, factory Factory, rf RestartFactory)

func TestOnDemandRunnerConfig

func TestOnDemandRunnerConfig(t *testing.T, factory Factory, restartF RestartFactory)

func TestProject

func TestProject(t *testing.T, factory Factory, restartF RestartFactory)

func TestProjectListWorkspaces

func TestProjectListWorkspaces(t *testing.T, factory Factory, restartF RestartFactory)

func TestProjectPollComplete

func TestProjectPollComplete(t *testing.T, factory Factory, restartF RestartFactory)

func TestProjectPollPeek

func TestProjectPollPeek(t *testing.T, factory Factory, restartF RestartFactory)

func TestRelease

func TestRelease(t *testing.T, factory Factory, restartF RestartFactory)

func TestRunnerAdopt

func TestRunnerAdopt(t *testing.T, factory Factory, restartF RestartFactory)

func TestRunnerAdopt_changeLabels

func TestRunnerAdopt_changeLabels(t *testing.T, factory Factory, restartF RestartFactory)

func TestRunnerById_notFound

func TestRunnerById_notFound(t *testing.T, factory Factory, restartF RestartFactory)

func TestRunnerOffline_new

func TestRunnerOffline_new(t *testing.T, factory Factory, restartF RestartFactory)

New runners that are unadopted should just get deleted when they go offline.

func TestRunner_crud

func TestRunner_crud(t *testing.T, factory Factory, restartF RestartFactory)

func TestServerConfig

func TestServerConfig(t *testing.T, factory Factory, restartF RestartFactory)

func TestServerURLToken

func TestServerURLToken(t *testing.T, factory Factory, restartF RestartFactory)

func TestSnapshotRestore

func TestSnapshotRestore(t *testing.T, factory Factory, factoryRestart RestartFactory)

func TestSnapshotRestore_corrupt

func TestSnapshotRestore_corrupt(t *testing.T, factory Factory, factoryRestart RestartFactory)

func TestStatusReport

func TestStatusReport(t *testing.T, factory Factory, restartF RestartFactory)

func TestTask

func TestTask(t *testing.T, factory Factory, restartF RestartFactory)

func TestTrigger

func TestTrigger(t *testing.T, factory Factory, restartF RestartFactory)

func TestUser

func TestUser(t *testing.T, factory Factory, restartF RestartFactory)

func TestWorkspace

func TestWorkspace(t *testing.T, factory Factory, restartF RestartFactory)

func TestWorkspaceApp

func TestWorkspaceApp(t *testing.T, factory Factory, restartF RestartFactory)

func TestWorkspaceProject

func TestWorkspaceProject(t *testing.T, factory Factory, restartF RestartFactory)

func TestWorkspacePut

func TestWorkspacePut(t *testing.T, factory Factory, _ RestartFactory)

Types

type Factory

type Factory func(*testing.T) serverstate.Interface

Factory is the function type used to create a new serverstate implementation. To fail, this should fail the test.

type RestartFactory

type RestartFactory func(*testing.T, serverstate.Interface) serverstate.Interface

RestartFactory functions simulate a server restart. This should gracefully close the existing interface given and create a new one using the same data store. Therefore, data persisted in the first version should become visible in the second.

This SHOULD simulate a physical restart as much as possible. Therefore, do NOT just return the same state pointer. Try to clean up, reopen disks, reconnect to databases, etc. This is used as part of failure testing, snapshot restore, etc.

Jump to

Keyboard shortcuts

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