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:
sirkrypt0
2021-05-27 10:11:43 +02:00
committed by Tobias Kantusch
parent 1be744f2d4
commit 1c4daa99a9
4 changed files with 175 additions and 2 deletions

View File

@@ -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)
}