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 ¶
- func Test(t *testing.T, f Factory, rf RestartFactory)
- func TestApplication(t *testing.T, factory Factory, restartF RestartFactory)
- func TestApplicationPollComplete(t *testing.T, factory Factory, restartF RestartFactory)
- func TestApplicationPollPeek(t *testing.T, factory Factory, restartF RestartFactory)
- func TestArtifact(t *testing.T, factory Factory, restartF RestartFactory)
- func TestBuild(t *testing.T, factory Factory, restartF RestartFactory)
- func TestConfig(t *testing.T, factory Factory, restartF RestartFactory)
- func TestConfigSource(t *testing.T, factory Factory, restartF RestartFactory)
- func TestConfigSourceWatch(t *testing.T, factory Factory, restartF RestartFactory)
- func TestConfigWatch(t *testing.T, factory Factory, restartF RestartFactory)
- func TestDeployment(t *testing.T, factory Factory, restartF RestartFactory)
- func TestGroup(t *testing.T, name string, f Factory, rf RestartFactory)
- func TestHMAC(t *testing.T, factory Factory, restartF RestartFactory)
- func TestInstance(t *testing.T, factory Factory, restartF RestartFactory)
- func TestJobAck(t *testing.T, factory Factory, rf RestartFactory)
- func TestJobAssign(t *testing.T, factory Factory, rf RestartFactory)
- func TestJobCancel(t *testing.T, factory Factory, rf RestartFactory)
- func TestJobComplete(t *testing.T, factory Factory, rf RestartFactory)
- func TestJobCreate_singleton(t *testing.T, factory Factory, rf RestartFactory)
- func TestJobHeartbeat(t *testing.T, factory Factory, rf RestartFactory)
- func TestJobIsAssignable(t *testing.T, factory Factory, rf RestartFactory)
- func TestJobUpdateRef(t *testing.T, factory Factory, rf RestartFactory)
- func TestOnDemandRunnerConfig(t *testing.T, factory Factory, restartF RestartFactory)
- func TestProject(t *testing.T, factory Factory, restartF RestartFactory)
- func TestProjectListWorkspaces(t *testing.T, factory Factory, restartF RestartFactory)
- func TestProjectPollComplete(t *testing.T, factory Factory, restartF RestartFactory)
- func TestProjectPollPeek(t *testing.T, factory Factory, restartF RestartFactory)
- func TestRelease(t *testing.T, factory Factory, restartF RestartFactory)
- func TestRunnerAdopt(t *testing.T, factory Factory, restartF RestartFactory)
- func TestRunnerAdopt_changeLabels(t *testing.T, factory Factory, restartF RestartFactory)
- func TestRunnerById_notFound(t *testing.T, factory Factory, restartF RestartFactory)
- func TestRunnerOffline_new(t *testing.T, factory Factory, restartF RestartFactory)
- func TestRunner_crud(t *testing.T, factory Factory, restartF RestartFactory)
- func TestServerConfig(t *testing.T, factory Factory, restartF RestartFactory)
- func TestServerURLToken(t *testing.T, factory Factory, restartF RestartFactory)
- func TestSnapshotRestore(t *testing.T, factory Factory, factoryRestart RestartFactory)
- func TestSnapshotRestore_corrupt(t *testing.T, factory Factory, factoryRestart RestartFactory)
- func TestStatusReport(t *testing.T, factory Factory, restartF RestartFactory)
- func TestTask(t *testing.T, factory Factory, restartF RestartFactory)
- func TestTrigger(t *testing.T, factory Factory, restartF RestartFactory)
- func TestUser(t *testing.T, factory Factory, restartF RestartFactory)
- func TestWorkspace(t *testing.T, factory Factory, restartF RestartFactory)
- func TestWorkspaceApp(t *testing.T, factory Factory, restartF RestartFactory)
- func TestWorkspaceProject(t *testing.T, factory Factory, restartF RestartFactory)
- func TestWorkspacePut(t *testing.T, factory Factory, _ RestartFactory)
- type Factory
- type RestartFactory
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 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 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 TestTrigger ¶
func TestTrigger(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.
Source Files
¶
- doc.go
- statetest.go
- test_application.go
- test_artifact.go
- test_build.go
- test_config.go
- test_config_source.go
- test_deployment.go
- test_hmac.go
- test_instance.go
- test_job.go
- test_project.go
- test_release.go
- test_runner.go
- test_runner_ondemand.go
- test_server_config.go
- test_server_urltoken.go
- test_snapshot.go
- test_status_report.go
- test_task.go
- test_trigger.go
- test_user.go
- test_workspace.go