Add tests for api client creation

This commit is contained in:
sirkrypt0
2021-05-10 11:58:28 +02:00
committed by Konrad Hanff
parent 9879b152e5
commit a2a9ed367a
3 changed files with 38 additions and 4 deletions

View File

@@ -44,9 +44,9 @@ func (apiClient *ApiClient) init(nomadURL *url.URL) (err error) {
return nil
}
// LoadRunners loads the allocations of the specified job.
func (apiClient *ApiClient) LoadRunners(jobId string) (runnerIds []string, err error) {
list, _, err := apiClient.client.Jobs().Allocations(jobId, true, nil)
// LoadAvailableRunners loads the allocations of the specified job.
func (apiClient *ApiClient) LoadAvailableRunners(jobId string) (runnerIds []string, err error) {
list, err := apiClient.loadRunners(jobId)
if err != nil {
return nil, err
}