statetest

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test

func Test(t *testing.T, f Factory, rf RestartFactory, skipTests []string)

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. skipTests are function names of tests in the serverstate package to skip (i.e. TestJobCreate_singleton). It cannot skip sub-tests (called by t.Run() inside a top-level test)

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 TestDeploymentGet added in v0.11.0

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

func TestDeploymentListFilter added in v0.9.0

func TestDeploymentListFilter(t *testing.T, f Factory, rf 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 TestInstanceByDeployment added in v0.10.0

func TestInstanceByDeployment(t *testing.T, factory Factory, _ 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 TestJobHeartbeatOnRestart added in v0.9.0

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

func TestJobIsAssignable

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

func TestJobLatestInit added in v0.11.0

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

func TestJobListPagination added in v0.11.0

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

func TestJobPipeline_AckAndComplete added in v0.10.0

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

func TestJobTask_AckAndComplete added in v0.9.0

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

func TestJobUpdateExpiry added in v0.10.0

func TestJobUpdateExpiry(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 TestOnDemandRunnerConfig_LabelTargeting added in v0.9.0

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

func TestPipeline added in v0.10.0

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

func TestPipelineRun added in v0.10.0

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

func TestProject

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

func TestProjectCanTransitionDataSource added in v0.11.0

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

func TestProjectCount added in v0.11.0

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

func TestProjectGetSetAllProperties added in v0.9.0

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

func TestProjectGetSetAllPropertiesSansVariables added in v0.9.0

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

func TestProjectListWorkspaces

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

func TestProjectPagination added in v0.11.0

func TestProjectPagination(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 TestTaskCancel added in v0.9.0

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

func TestTokenSignature added in v0.10.0

func TestTokenSignature(t *testing.T, factory Factory, rf 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