Documentation
¶
Index ¶
- Constants
- type APIHandler
- func (ah *APIHandler) GetTaskResult(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) GetTest(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) GetTestRun(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) GetTestRunDetails(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) GetTestRunStatus(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) GetTestRunTaskDetails(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) GetTestRuns(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) GetTests(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) PostTestRunCancel(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) PostTestRunsDelete(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) PostTestRunsSchedule(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) PostTestsDelete(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) PostTestsRegister(w http.ResponseWriter, r *http.Request)
- func (ah *APIHandler) PostTestsRegisterExternal(w http.ResponseWriter, r *http.Request)
- type GetTestResponse
- type GetTestRunDetailedTask
- type GetTestRunDetailedTaskLog
- type GetTestRunDetailsResponse
- type GetTestRunResponse
- type GetTestRunTask
- type GetTestRunTaskResult
- type GetTestRunsResponse
- type GetTestsResponse
- type PostTestRunCancelRequest
- type PostTestRunCancelResponse
- type PostTestRunsDeleteRequest
- type PostTestRunsDeleteResponse
- type PostTestRunsScheduleRequest
- type PostTestRunsScheduleResponse
- type PostTestsDeleteRequest
- type PostTestsDeleteResponse
- type PostTestsRegisterExternalRequest
- type PostTestsRegisterExternalResponse
- type PostTestsRegisterRequest
- type PostTestsRegisterResponse
- type Response
Constants ¶
const ( TaskStatusPending = "pending" TaskStatusRunning = "running" TaskStatusComplete = "complete" )
Task status constants
const ( TaskResultNone = "none" TaskResultSuccess = "success" TaskResultFailure = "failure" )
Task result constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIHandler ¶
type APIHandler struct {
// contains filtered or unexported fields
}
func NewAPIHandler ¶
func NewAPIHandler(logger logrus.FieldLogger, coordinator types.Coordinator) *APIHandler
func (*APIHandler) GetTaskResult ¶ added in v0.0.13
func (ah *APIHandler) GetTaskResult(w http.ResponseWriter, r *http.Request)
GetTaskResult godoc @Id getTaskResult @Summary Get task result file @Tags TestRun @Description Returns a specific result file from a task @Produce octet-stream @Param runId path string true "ID of the test run" @Param taskId path string true "ID of the task" @Param resultType path string true "Type of file to return (summary, result, ...)" @Param fileId path string true "Index or name of the result file" @Success 200 {file} binary "Success" @Failure 400 {object} Response "Bad Request" @Failure 404 {object} Response "Not Found" @Failure 500 {object} Response "Server Error" @Router /api/v1/test_run/{runId}/task/{taskIndex}/result/{resultType}/{fileId} [get]
func (*APIHandler) GetTest ¶
func (ah *APIHandler) GetTest(w http.ResponseWriter, r *http.Request)
GetTest godoc @Id getTest @Summary Get test definition by test ID @Tags Test @Description Returns the test definition with given ID. @Produce json @Param testId path string true "ID of the test definition to get details for" @Success 200 {object} Response{data=GetTestResponse} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/test/{testId} [get]
func (*APIHandler) GetTestRun ¶
func (ah *APIHandler) GetTestRun(w http.ResponseWriter, r *http.Request)
GetTestRun godoc @Id getTestRun @Summary Get test run by run ID @Tags TestRun @Description Returns the run details with given ID. Includes a summary and a list of task with limited details @Produce json @Param runId path string true "ID of the test run to get details for" @Success 200 {object} Response{data=GetTestRunResponse} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/test_run/{runId} [get]
func (*APIHandler) GetTestRunDetails ¶
func (ah *APIHandler) GetTestRunDetails(w http.ResponseWriter, r *http.Request)
GetTestRunDetails godoc @Id getTestRunDetails @Summary Get detailed test run by run ID @Tags TestRun @Description Returns the run details with given ID. Includes a summary and a list of task with all details (incl. logs & task configurations) @Produce json @Param runId path string true "ID of the test run to get details for" @Success 200 {object} Response{data=GetTestRunDetailsResponse} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/test_run/{runId}/details [get]
func (*APIHandler) GetTestRunStatus ¶
func (ah *APIHandler) GetTestRunStatus(w http.ResponseWriter, r *http.Request)
GetTestRunStatus godoc @Id getTestRunStatus @Summary Get test run status by run ID @Tags TestRun @Description Returns the run status with given ID. @Produce json @Param runId path string true "ID of the test run to get the status for" @Success 200 {object} Response{data=string} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/test_run/{runId}/status [get]
func (*APIHandler) GetTestRunTaskDetails ¶ added in v0.0.15
func (ah *APIHandler) GetTestRunTaskDetails(w http.ResponseWriter, r *http.Request)
GetTestRunTaskDetails godoc @Id getTestRunTaskDetails @Summary Get detailed task of a given test run @Tags TestRun @Description Returns the task details with given run ID and task index. Includes full log, configuration and result variables (unless security trimmed). @Produce json @Param runId path string true "ID of the test run" @Param taskIndex path string true "Index of the task to get details for" @Success 200 {object} Response{data=GetTestRunDetailedTask} "Success" @Failure 400 {object} Response "Bad Request" @Failure 404 {object} Response "Not Found" @Failure 500 {object} Response "Server Error" @Router /api/v1/test_run/{runId}/task/{taskIndex}/details [get]
func (*APIHandler) GetTestRuns ¶
func (ah *APIHandler) GetTestRuns(w http.ResponseWriter, r *http.Request)
GetTestRuns godoc @Id getTestRuns @Summary Get list of test runs @Tags TestRun @Description Returns a list of all test runs. @Produce json @Param test_id query string false "Return test runs for this test ID only" @Success 200 {object} Response{data=[]GetTestRunsResponse} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/test_runs [get]
func (*APIHandler) GetTests ¶
func (ah *APIHandler) GetTests(w http.ResponseWriter, r *http.Request)
GetTests godoc @Id getTests @Summary Get list of test definitions @Tags Test @Description Returns the list of test definitions. These test definitions can be used to create new test runs and are supplied via the assertoor configuration. @Produce json @Success 200 {object} Response{data=[]GetTestsResponse} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/tests [get]
func (*APIHandler) PostTestRunCancel ¶
func (ah *APIHandler) PostTestRunCancel(w http.ResponseWriter, r *http.Request)
PostTestRunCancel godoc @Id postTestRunCancel @Summary Cancel test run by test ID @Tags TestRun @Description Returns the test/run id & status of the cancelled test. @Produce json @Param runId path string true "ID of the test run to cancel" @Param cancelOptions body PostTestRunCancelRequest true "Test cancellation options" @Success 200 {object} Response{data=PostTestRunCancelResponse} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/test_run/{runId}/cancel [post]
func (*APIHandler) PostTestRunsDelete ¶ added in v0.0.12
func (ah *APIHandler) PostTestRunsDelete(w http.ResponseWriter, r *http.Request)
PostTestRunsDelete godoc @Id postTestRunsDelete @Summary Delete test runs @Tags TestRun @Description Deletes test runs @Produce json @Accept json,application/yaml @Param testConfig body PostTestRunsDeleteRequest true "Test configuration (json or yaml)" @Success 200 {object} Response{data=PostTestRunsDeleteResponse} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/test_runs/delete [post]
func (*APIHandler) PostTestRunsSchedule ¶ added in v0.0.5
func (ah *APIHandler) PostTestRunsSchedule(w http.ResponseWriter, r *http.Request)
PostTestRunsSchedule godoc @Id postTestRunsSchedule @Summary Schedule new test run by test ID @Tags TestRun @Description Returns the test & run id of the scheduled test execution. @Produce json @Param runOptions body PostTestRunsScheduleRequest true "Rest run options" @Success 200 {object} Response{data=PostTestRunsScheduleResponse} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/test_runs/schedule [post]
func (*APIHandler) PostTestsDelete ¶ added in v0.0.12
func (ah *APIHandler) PostTestsDelete(w http.ResponseWriter, r *http.Request)
PostTestsDelete godoc @Id postTestsDelete @Summary Delete tests @Tags Test @Description Deletes tests @Produce json @Accept json,application/yaml @Param testConfig body PostTestsDeleteRequest true "Test configuration (json or yaml)" @Success 200 {object} Response{data=PostTestsDeleteResponse} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/tests/delete [post]
func (*APIHandler) PostTestsRegister ¶ added in v0.0.5
func (ah *APIHandler) PostTestsRegister(w http.ResponseWriter, r *http.Request)
PostTestsRegister godoc @Id postTestsRegister @Summary Register new test via yaml configuration @Tags Test @Description Returns the test id and name of the added test. @Produce json @Accept json,application/yaml @Param testConfig body PostTestsRegisterRequest true "Test configuration (json or yaml)" @Success 200 {object} Response{data=PostTestsRegisterResponse} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/tests/register [post]
func (*APIHandler) PostTestsRegisterExternal ¶ added in v0.0.5
func (ah *APIHandler) PostTestsRegisterExternal(w http.ResponseWriter, r *http.Request)
PostTestsRegisterExternal godoc @Id postTestsRegisterExternal @Summary Register new test via external test configuration @Tags Test @Description Returns the test id and name of the added test. @Produce json @Accept json @Param externalTestConfig body PostTestsRegisterExternalRequest true "Test configuration (json or yaml)" @Success 200 {object} Response{data=PostTestsRegisterExternalResponse} "Success" @Failure 400 {object} Response "Failure" @Failure 500 {object} Response "Server Error" @Router /api/v1/tests/register_external [post]
type GetTestResponse ¶
type GetTestResponse struct {
ID string `json:"id"`
Source string `json:"source"`
BasePath string `json:"basePath"`
Name string `json:"name"`
Timeout uint64 `json:"timeout"`
Config map[string]any `json:"config"`
ConfigVars map[string]string `json:"configVars"`
Schedule *types.TestSchedule `json:"schedule"`
}
type GetTestRunDetailedTask ¶
type GetTestRunDetailedTask struct {
Index uint64 `json:"index"`
ParentIndex uint64 `json:"parent_index"`
Name string `json:"name"`
Title string `json:"title"`
Started bool `json:"started"`
Completed bool `json:"completed"`
StartTime int64 `json:"start_time"`
StopTime int64 `json:"stop_time"`
Timeout uint64 `json:"timeout"`
RunTime uint64 `json:"runtime"`
Status string `json:"status"`
Result string `json:"result"`
ResultError string `json:"result_error"`
Log []*GetTestRunDetailedTaskLog `json:"log"`
ConfigYaml string `json:"config_yaml"`
ResultYaml string `json:"result_yaml"`
}
type GetTestRunDetailsResponse ¶
type GetTestRunDetailsResponse struct {
RunID uint64 `json:"run_id"`
TestID string `json:"test_id"`
Name string `json:"name"`
Status types.TestStatus `json:"status"`
StartTime int64 `json:"start_time"`
StopTime int64 `json:"stop_time"`
Tasks []*GetTestRunDetailedTask `json:"tasks"`
}
type GetTestRunResponse ¶
type GetTestRunResponse struct {
RunID uint64 `json:"run_id"`
TestID string `json:"test_id"`
Name string `json:"name"`
Status types.TestStatus `json:"status"`
StartTime int64 `json:"start_time"`
StopTime int64 `json:"stop_time"`
Tasks []*GetTestRunTask `json:"tasks"`
}
type GetTestRunTask ¶
type GetTestRunTask struct {
Index uint64 `json:"index"`
ParentIndex uint64 `json:"parent_index"`
Name string `json:"name"`
Title string `json:"title"`
Started bool `json:"started"`
Completed bool `json:"completed"`
StartTime int64 `json:"start_time"`
StopTime int64 `json:"stop_time"`
Timeout uint64 `json:"timeout"`
RunTime uint64 `json:"runtime"`
Status string `json:"status"`
Result string `json:"result"`
ResultFiles []GetTestRunTaskResult `json:"result_files"`
ResultError string `json:"result_error"`
}
type GetTestRunTaskResult ¶ added in v0.0.13
type GetTestRunsResponse ¶
type GetTestsResponse ¶
type PostTestRunsDeleteRequest ¶ added in v0.0.12
type PostTestRunsDeleteRequest struct {
TestRuns []uint64 `json:"test_runs"`
}
type PostTestRunsDeleteResponse ¶ added in v0.0.12
type PostTestRunsScheduleRequest ¶ added in v0.0.5
type PostTestRunsScheduleResponse ¶ added in v0.0.5
type PostTestsDeleteRequest ¶ added in v0.0.12
type PostTestsDeleteRequest struct {
Tests []string `json:"tests"`
}
type PostTestsDeleteResponse ¶ added in v0.0.12
type PostTestsRegisterExternalRequest ¶ added in v0.0.5
type PostTestsRegisterExternalRequest struct {
File string `yaml:"file" json:"file"`
Name string `yaml:"name" json:"name,omitempty"`
Timeout uint64 `yaml:"timeout" json:"timeout,omitempty"`
Config map[string]interface{} `yaml:"config" json:"config,omitempty"`
ConfigVars map[string]string `yaml:"configVars" json:"configVars,omitempty"`
Schedule *types.TestSchedule `yaml:"schedule" json:"schedule,omitempty"`
}
type PostTestsRegisterExternalResponse ¶ added in v0.0.5
type PostTestsRegisterRequest ¶ added in v0.0.5
type PostTestsRegisterRequest struct {
ID string `yaml:"id" json:"id"`
Name string `yaml:"name" json:"name"`
Timeout string `yaml:"timeout" json:"timeout"`
Config map[string]interface{} `yaml:"config" json:"config"`
ConfigVars map[string]string `yaml:"configVars" json:"configVars"`
Tasks []helper.RawMessage `yaml:"tasks" json:"tasks"`
CleanupTasks []helper.RawMessage `yaml:"cleanupTasks" json:"cleanupTasks"`
Schedule *types.TestSchedule `yaml:"schedule" json:"schedule"`
}
type PostTestsRegisterResponse ¶ added in v0.0.5
Source Files
¶
- constants.go
- get_task_details_api.go
- get_task_result_api.go
- get_test_api.go
- get_test_run_api.go
- get_test_run_details_api.go
- get_test_run_status_api.go
- get_test_runs_api.go
- get_tests_api.go
- handler.go
- post_test_run_api.go
- post_test_run_cancel_api.go
- post_test_runs_delete_api.go
- post_tests_delete_api.go
- post_tests_register_api.go
- post_tests_register_external_api.go