Add e2e tests for exec env createOrUpdate
This also adds a Nomad client to the e2e_tests that can be used to query Nomad and validate that certain actions happened in Nomad correctly.
This commit is contained in:

committed by
Tobias Kantusch

parent
1be744f2d4
commit
1c4daa99a9
@@ -149,3 +149,18 @@ func HttpPatch(url string, contentType string, body io.Reader) (response *http.R
|
||||
client := &http.Client{}
|
||||
return client.Do(req)
|
||||
}
|
||||
|
||||
func HttpPut(url string, body io.Reader) (response *http.Response, err error) {
|
||||
req, _ := http.NewRequest(http.MethodPut, url, body)
|
||||
client := &http.Client{}
|
||||
return client.Do(req)
|
||||
}
|
||||
|
||||
func HttpPutJSON(url string, body interface{}) (response *http.Response, err error) {
|
||||
requestString, err := json.Marshal(body)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
reader := strings.NewReader(string(requestString))
|
||||
return HttpPut(url, reader)
|
||||
}
|
||||
|
Reference in New Issue
Block a user