Documentation ¶
Overview ¶
Package helpers contains functions that help executing tests. The helper functions generally look from the client side - a Poseidon user.
Index ¶
- func BuildURL(parts ...string) string
- func CreateTemplateJob() (base, job *nomadApi.Job)
- func HTTPDelete(url string, body io.Reader) (response *http.Response, err error)
- func HTTPPatch(url, contentType string, body io.Reader) (response *http.Response, err error)
- func HTTPPostJSON(url string, body interface{}) (response *http.Response, err error)
- func HTTPPut(url string, body io.Reader) (response *http.Response, err error)
- func HTTPPutJSON(url string, body interface{}) (response *http.Response, err error)
- func ReceiveAllWebSocketMessages(connection *websocket.Conn) (messages []*dto.WebSocketMessage, err error)
- func ReceiveNextWebSocketMessage(connection *websocket.Conn) (*dto.WebSocketMessage, error)
- func StartTLSServer(t *testing.T, router *mux.Router) (*httptest.Server, error)
- func WebSocketControlMessages(messages []*dto.WebSocketMessage) (controls []*dto.WebSocketMessage)
- func WebSocketOutputMessages(messages []*dto.WebSocketMessage) (stdout, stderr string, errors []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTemplateJob ¶
func HTTPDelete ¶
HTTPDelete sends a "Delete" Http Request with body to the passed url.
func HTTPPostJSON ¶
func HTTPPutJSON ¶
func ReceiveAllWebSocketMessages ¶
func ReceiveAllWebSocketMessages(connection *websocket.Conn) (messages []*dto.WebSocketMessage, err error)
ReceiveAllWebSocketMessages pulls all messages from the websocket connection without sending anything. This function does not return unless the server closes the connection or a readDeadline is set in the WebSocket connection.
func ReceiveNextWebSocketMessage ¶
func ReceiveNextWebSocketMessage(connection *websocket.Conn) (*dto.WebSocketMessage, error)
ReceiveNextWebSocketMessage pulls the next message from the websocket connection. This function does not return unless the server sends a message, closes the connection or a readDeadline is set in the WebSocket connection.
func StartTLSServer ¶
StartTLSServer runs a httptest.Server with the passed mux.Router and TLS enabled.
func WebSocketControlMessages ¶
func WebSocketControlMessages(messages []*dto.WebSocketMessage) (controls []*dto.WebSocketMessage)
WebSocketControlMessages extracts all meta (and exit) messages from the passed messages.
func WebSocketOutputMessages ¶
func WebSocketOutputMessages(messages []*dto.WebSocketMessage) (stdout, stderr string, errors []string)
WebSocketOutputMessages extracts all stdout, stderr and error messages from the passed messages. It is useful since Nomad splits the command output nondeterministic.
Types ¶
This section is empty.