Skip to content

Commit

Permalink
Fix tests for new api client
Browse files Browse the repository at this point in the history
  • Loading branch information
lox committed May 22, 2019
1 parent b6167f7 commit da1853e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions agent/artifact_downloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package agent

import (
"fmt"
"github.com/buildkite/agent/logger"
"net/http"
"net/http/httptest"
"testing"

"github.com/buildkite/agent/api"
"github.com/buildkite/agent/logger"
)

func TestArtifactDownloaderConnectsToEndpoint(t *testing.T) {
Expand All @@ -27,7 +29,7 @@ func TestArtifactDownloaderConnectsToEndpoint(t *testing.T) {
}))
defer server.Close()

ac := NewAPIClient(logger.Discard, APIClientConfig{
ac := api.NewClient(logger.Discard, api.Config{
Endpoint: server.URL,
Token: `llamasforever`,
})
Expand Down
8 changes: 6 additions & 2 deletions agent/integration/job_runner_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ func runJob(t *testing.T, ag *api.AgentRegisterResponse, j *api.Job, cfg agent.A
// set the bootstrap into the config
cfg.BootstrapScript = bs.Path

jr, err := agent.NewJobRunner(l, scope, ag, j, agent.JobRunnerConfig{
Endpoint: server.URL,
client := api.NewClient(l, api.Config{
Endpoint: server.URL,
Token: ag.AccessToken,
})

jr, err := agent.NewJobRunner(l, scope, ag, j, client, agent.JobRunnerConfig{
AgentConfiguration: cfg,
})
if err != nil {
Expand Down

0 comments on commit da1853e

Please sign in to comment.