Documentation ¶
Index ¶
- type IntegrationTestStatus
- type IntegrationTestStatusDetail
- type SnapshotIntegrationTestStatuses
- func (sits *SnapshotIntegrationTestStatuses) DeleteStatus(scenarioName string)
- func (sits *SnapshotIntegrationTestStatuses) GetScenarioStatus(scenarioName string) (*IntegrationTestStatusDetail, bool)
- func (sits *SnapshotIntegrationTestStatuses) GetStatuses() []*IntegrationTestStatusDetail
- func (sits *SnapshotIntegrationTestStatuses) InitStatuses(scenarioNames *[]string)
- func (sits *SnapshotIntegrationTestStatuses) IsDirty() bool
- func (sits *SnapshotIntegrationTestStatuses) MarshalJSON() ([]byte, error)
- func (sits *SnapshotIntegrationTestStatuses) ResetDirty()
- func (sits *SnapshotIntegrationTestStatuses) ResetStatus(scenarioName string)
- func (sits *SnapshotIntegrationTestStatuses) UnmarshalJSON(b []byte) error
- func (sits *SnapshotIntegrationTestStatuses) UpdateTestPipelineRunName(scenarioName string, pipelineRunName string) error
- func (sits *SnapshotIntegrationTestStatuses) UpdateTestStatusIfChanged(scenarioName string, status IntegrationTestStatus, details string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntegrationTestStatus ¶
type IntegrationTestStatus int
IntegrationTestScenario test runs status
const ( // Nothing is done yet for the ITS list and snapshot IntegrationTestStatusPending IntegrationTestStatus = iota + 1 // Pending // Starting to handle an integration test scenario for a snapshot IntegrationTestStatusInProgress // InProgress // Integration PLR deleted for this ITS and snapshot IntegrationTestStatusDeleted // Deleted // (Deprecated) The environment provision experienced error for this ITS and snapshot IntegrationTestStatusEnvironmentProvisionError_Deprecated // EnvironmentProvisionError // (Deprecated) The SEB deployment experienced error for this ITS and snapshot IntegrationTestStatusDeploymentError_Deprecated // DeploymentError // Integration PLR failed for this ITS and snapshot IntegrationTestStatusTestFail // TestFail // Integration PLR passed for this ITS and snapshot IntegrationTestStatusTestPassed // TestPassed // Integration PLR is invalid IntegrationTestStatusTestInvalid // TestInvalid )
func IntegrationTestStatusString ¶
func IntegrationTestStatusString(s string) (IntegrationTestStatus, error)
IntegrationTestStatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func IntegrationTestStatusValues ¶
func IntegrationTestStatusValues() []IntegrationTestStatus
IntegrationTestStatusValues returns all values of the enum
func (IntegrationTestStatus) IsAIntegrationTestStatus ¶
func (i IntegrationTestStatus) IsAIntegrationTestStatus() bool
IsAIntegrationTestStatus returns "true" if the value is listed in the enum definition. "false" otherwise
func (*IntegrationTestStatus) IsFinal ¶
func (sits *IntegrationTestStatus) IsFinal() bool
func (IntegrationTestStatus) MarshalJSON ¶
func (i IntegrationTestStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for IntegrationTestStatus
func (IntegrationTestStatus) String ¶
func (i IntegrationTestStatus) String() string
func (*IntegrationTestStatus) UnmarshalJSON ¶
func (i *IntegrationTestStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for IntegrationTestStatus
type IntegrationTestStatusDetail ¶
type IntegrationTestStatusDetail struct { // ScenarioName name ScenarioName string `json:"scenario"` // The status summary for the ITS and Snapshot Status IntegrationTestStatus `json:"status"` // The time of reporting the status LastUpdateTime time.Time `json:"lastUpdateTime"` // The details of reported status Details string `json:"details"` // Startime when we moved to inProgress StartTime *time.Time `json:"startTime,omitempty"` // pointer to make omitempty work // Completion time when test failed or passed CompletionTime *time.Time `json:"completionTime,omitempty"` // pointer to make omitempty work // TestPipelineName name of testing pipelineRun TestPipelineRunName string `json:"testPipelineRunName,omitempty"` }
IntegrationTestStatusDetail contains metadata about the particular scenario testing status
type SnapshotIntegrationTestStatuses ¶
type SnapshotIntegrationTestStatuses struct {
// contains filtered or unexported fields
}
SnapshotIntegrationTestStatuses type handles details about snapshot tests Please note that internal representation differs from marshalled representation Data are not written directly into snapshot, they are just cached in this structure
func NewSnapshotIntegrationTestStatuses ¶
func NewSnapshotIntegrationTestStatuses(jsondata string) (*SnapshotIntegrationTestStatuses, error)
NewSnapshotIntegrationTestStatuses creates empty SnapshotTestStatus struct
func (*SnapshotIntegrationTestStatuses) DeleteStatus ¶
func (sits *SnapshotIntegrationTestStatuses) DeleteStatus(scenarioName string)
DeleteStatus deletes status of the particular scenario
func (*SnapshotIntegrationTestStatuses) GetScenarioStatus ¶
func (sits *SnapshotIntegrationTestStatuses) GetScenarioStatus(scenarioName string) (*IntegrationTestStatusDetail, bool)
GetScenarioStatus returns detail of status for the requested scenario Second return value represents if result was found
func (*SnapshotIntegrationTestStatuses) GetStatuses ¶
func (sits *SnapshotIntegrationTestStatuses) GetStatuses() []*IntegrationTestStatusDetail
GetStatuses returns snapshot test statuses in external format
func (*SnapshotIntegrationTestStatuses) InitStatuses ¶
func (sits *SnapshotIntegrationTestStatuses) InitStatuses(scenarioNames *[]string)
InitStatuses creates initial representation all scenarios This function also removes scenarios which are not defined in scenarios param
func (*SnapshotIntegrationTestStatuses) IsDirty ¶
func (sits *SnapshotIntegrationTestStatuses) IsDirty() bool
IsDirty returns boolean if there are any changes
func (*SnapshotIntegrationTestStatuses) MarshalJSON ¶
func (sits *SnapshotIntegrationTestStatuses) MarshalJSON() ([]byte, error)
MarshalJSON converts data to JSON Please note that internal representation of data differs from marshalled output Example:
[ { "scenario": "scenario-1", "status": "EnvironmentProvisionError", "lastUpdateTime": "2023-07-26T16:57:49+02:00", "details": "Failed ...", "startTime": "2023-07-26T14:57:49+02:00", "completionTime": "2023-07-26T16:57:49+02:00", "testPipelineRunName": "pipeline-run-feedbeef" } ]
func (*SnapshotIntegrationTestStatuses) ResetDirty ¶
func (sits *SnapshotIntegrationTestStatuses) ResetDirty()
ResetDirty reset repo back to clean, i.e. no changes to data
func (*SnapshotIntegrationTestStatuses) ResetStatus ¶
func (sits *SnapshotIntegrationTestStatuses) ResetStatus(scenarioName string)
ResetStatus reset status of test back to initial Pending status and removes invalidated values
func (*SnapshotIntegrationTestStatuses) UnmarshalJSON ¶
func (sits *SnapshotIntegrationTestStatuses) UnmarshalJSON(b []byte) error
UnmarshalJSON load data from JSON
func (*SnapshotIntegrationTestStatuses) UpdateTestPipelineRunName ¶
func (sits *SnapshotIntegrationTestStatuses) UpdateTestPipelineRunName(scenarioName string, pipelineRunName string) error
UpdateTestPipelineRunName updates TestPipelineRunName if changed scenario must already exist in statuses
func (*SnapshotIntegrationTestStatuses) UpdateTestStatusIfChanged ¶
func (sits *SnapshotIntegrationTestStatuses) UpdateTestStatusIfChanged(scenarioName string, status IntegrationTestStatus, details string)
UpdateTestStatusIfChanged updates status of scenario test when status or details changed