handlertest

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: 21 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, skipTests []string)

Test runs a validation test suite for a pb.WaypointServer implementation. All server implementations should pass this suite with no errors to ensure the correct behavior of the server. 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 TestApp

func TestApp(t *testing.T, client pb.WaypointClient, ref *pb.Ref_Application)

TestApp creates the app in the DB.

func TestGroup

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

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

func TestListInstances

func TestListInstances(t *testing.T, factory Factory)

func TestListOIDCAuthMethods

func TestListOIDCAuthMethods(t *testing.T, factory Factory)

func TestOIDCAuth

func TestOIDCAuth(t *testing.T, factory Factory)

func TestOIDCAuth_accessSelector

func TestOIDCAuth_accessSelector(t *testing.T, factory Factory)

func TestServiceArtifact

func TestServiceArtifact(t *testing.T, factory Factory)

func TestServiceArtifact_List

func TestServiceArtifact_List(t *testing.T, factory Factory)

func TestServiceBuild

func TestServiceBuild(t *testing.T, factory Factory)

func TestServiceConfig

func TestServiceConfig(t *testing.T, factory Factory)

func TestServiceConfigSource

func TestServiceConfigSource(t *testing.T, factory Factory)

func TestServiceDeployment

func TestServiceDeployment(t *testing.T, factory Factory)

func TestServiceDeployment_GetDeployment

func TestServiceDeployment_GetDeployment(t *testing.T, factory Factory)

func TestServiceDeployment_ListDeployments

func TestServiceDeployment_ListDeployments(t *testing.T, factory Factory)

func TestServiceGetJobStream_bufferedData

func TestServiceGetJobStream_bufferedData(t *testing.T, factory Factory)

Tests that a client can connect to a job after the job has logs (but before the job has completed), and can get the buffered logs.

func TestServiceGetJobStream_complete

func TestServiceGetJobStream_complete(t *testing.T, factory Factory)

func TestServiceGetJobStream_completedBufferedData

func TestServiceGetJobStream_completedBufferedData(t *testing.T, factory Factory)

Tests that a client can connect to a completed job and still read its output. NOTE: this does not test that a client can read job logs for a long-completed job. Some server state implementation (namely this one) do not persist job logs, so streaming completed logs only works if the server hasn't restarted or pruned them from memory.

func TestServiceGetJobStream_expired

func TestServiceGetJobStream_expired(t *testing.T, factory Factory)

func TestServiceGetLogStreamCases

func TestServiceGetLogStreamCases(t *testing.T, factory Factory)

func TestServiceGetLogStream_byApp

func TestServiceGetLogStream_byApp(t *testing.T, factory Factory)

func TestServiceGetLogStream_depPlugin

func TestServiceGetLogStream_depPlugin(t *testing.T, factory Factory)

func TestServiceJob

func TestServiceJob(t *testing.T, factory Factory)

func TestServiceJob_List

func TestServiceJob_List(t *testing.T, factory Factory)

func TestServiceOnDemandRunnerConfig

func TestServiceOnDemandRunnerConfig(t *testing.T, factory Factory)

func TestServiceOnDemandRunnerConfig_DeleteOnDemandRunnerConfigs added in v0.10.0

func TestServiceOnDemandRunnerConfig_DeleteOnDemandRunnerConfigs(t *testing.T, factory Factory)

func TestServiceOnDemandRunnerConfig_GetOnDemandRunnerConfig

func TestServiceOnDemandRunnerConfig_GetOnDemandRunnerConfig(t *testing.T, factory Factory)

func TestServiceOnDemandRunnerConfig_ListOnDemandRunnerConfigs

func TestServiceOnDemandRunnerConfig_ListOnDemandRunnerConfigs(t *testing.T, factory Factory)

func TestServiceOndemandRunnerConfig_duplicateName added in v0.10.0

func TestServiceOndemandRunnerConfig_duplicateName(t *testing.T, factory Factory)

Should not be able to create two runner profiles with the same name

func TestServiceProject

func TestServiceProject(t *testing.T, factory Factory)

func TestServiceProject_GetApplication

func TestServiceProject_GetApplication(t *testing.T, factory Factory)

func TestServiceProject_InvalidName added in v0.10.0

func TestServiceProject_InvalidName(t *testing.T, factory Factory)

func TestServiceProject_UpsertApplication

func TestServiceProject_UpsertApplication(t *testing.T, factory Factory)

func TestServiceQueueJob

func TestServiceQueueJob(t *testing.T, factory Factory)

func TestServiceQueueJob_odr_basic added in v0.10.0

func TestServiceQueueJob_odr_basic(t *testing.T, factory Factory)

func TestServiceQueueJob_odr_customTask added in v0.10.0

func TestServiceQueueJob_odr_customTask(t *testing.T, factory Factory)

func TestServiceQueueJob_odr_customTaskSkipOp added in v0.10.0

func TestServiceQueueJob_odr_customTaskSkipOp(t *testing.T, factory Factory)

func TestServiceQueueJob_odr_default

func TestServiceQueueJob_odr_default(t *testing.T, factory Factory)

func TestServiceQueueJob_odr_depends added in v0.10.0

func TestServiceQueueJob_odr_depends(t *testing.T, factory Factory)

Test that a job with dependencies has an ODR started that depends on the same things.

func TestServiceQueueJob_odr_target_id

func TestServiceQueueJob_odr_target_id(t *testing.T, factory Factory)

func TestServiceQueueJob_odr_target_labels

func TestServiceQueueJob_odr_target_labels(t *testing.T, factory Factory)

func TestServiceRelease

func TestServiceRelease(t *testing.T, factory Factory)

func TestServiceRelease_GetRelease

func TestServiceRelease_GetRelease(t *testing.T, factory Factory)

func TestServiceRelease_ListReleases

func TestServiceRelease_ListReleases(t *testing.T, factory Factory)

func TestServiceStatusReport

func TestServiceStatusReport(t *testing.T, factory Factory)

func TestServiceStatusReport_ExpediteStatusReport

func TestServiceStatusReport_ExpediteStatusReport(t *testing.T, factory Factory)

func TestServiceStatusReport_GetStatusReport

func TestServiceStatusReport_GetStatusReport(t *testing.T, factory Factory)

func TestServiceStatusReport_ListStatusReports

func TestServiceStatusReport_ListStatusReports(t *testing.T, factory Factory)

func TestServiceTrigger

func TestServiceTrigger(t *testing.T, factory Factory)

func TestServiceTrigger_DeleteTrigger

func TestServiceTrigger_DeleteTrigger(t *testing.T, factory Factory)

func TestServiceTrigger_GetTrigger

func TestServiceTrigger_GetTrigger(t *testing.T, factory Factory)

func TestServiceTrigger_ListTriggersSimple

func TestServiceTrigger_ListTriggersSimple(t *testing.T, factory Factory)

func TestServiceTrigger_ListTriggersWithFilters

func TestServiceTrigger_ListTriggersWithFilters(t *testing.T, factory Factory)

func TestServiceTrigger_RunTrigger

func TestServiceTrigger_RunTrigger(t *testing.T, factory Factory)

func TestServiceUI_Deployment_GetDeployment added in v0.11.0

func TestServiceUI_Deployment_GetDeployment(t *testing.T, factory Factory)

func TestServiceUI_Deployment_ListDeployments

func TestServiceUI_Deployment_ListDeployments(t *testing.T, factory Factory)

func TestServiceUI_GetProject

func TestServiceUI_GetProject(t *testing.T, factory Factory)

func TestServiceUI_ListProjects added in v0.11.0

func TestServiceUI_ListProjects(t *testing.T, factory Factory)

func TestServiceUI_Release_ListReleases

func TestServiceUI_Release_ListReleases(t *testing.T, factory Factory)

func TestServiceUpdateUser

func TestServiceUpdateUser(t *testing.T, factory Factory)

func TestServiceValidateJob

func TestServiceValidateJob(t *testing.T, factory Factory)

func TestServiceWaypointHclFmt

func TestServiceWaypointHclFmt(t *testing.T, factory Factory)

func TestWorkspace_Upsert

func TestWorkspace_Upsert(t *testing.T, factory Factory)

Types

type Factory

type Factory func(*testing.T) (pb.WaypointClient, TestServerImpl)

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

type TestServerImpl

type TestServerImpl interface {

	// State returns the underlying serverstate implementation.
	State(ctx context.Context) serverstate.Interface
}

TestServerImpl is a wrapper around a server implementation that allows us to access otherwise-private fields and methods inside our tests. It should not be used outside of testing.

Jump to

Keyboard shortcuts

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