MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / GetApiClient

Function GetApiClient

test/integration/integrationtestutil.go:21–31  ·  view source on GitHub ↗

This file contains utilities to help with integration testing GetApiClient returns a "back door" connection to the Octopus Server that integration tests can use to create fixture data, cleanup, etc

(spaceId string)

Source from the content-addressed store, hash-verified

19// GetApiClient returns a "back door" connection to the Octopus Server
20// that integration tests can use to create fixture data, cleanup, etc
21func GetApiClient(spaceId string) (*client.Client, error) {
22 apiUrl, err := url.Parse(os.Getenv("OCTOPUS_TEST_URL"))
23 apiKey := os.Getenv("OCTOPUS_TEST_APIKEY")
24
25 if err != nil || apiUrl == nil || apiKey == "" {
26 fmt.Println("IntegrationTest GetApiClient cannot launch; OCTOPUS_TEST_URL and OCTOPUS_TEST_APIKEY environment variables must be set")
27 os.Exit(999)
28 }
29
30 return client.NewClient(nil, apiUrl, apiKey, spaceId)
31}
32
33func GetCliPath() (cliPath string, cliDir string, err error) {
34 _, fileName, _, ok := runtime.Caller(1)

Callers 3

TestReleaseCreateBasicsFunction · 0.92
TestReleaseListAndDeleteFunction · 0.92
TestAccountListFunction · 0.92

Calls

no outgoing calls

Tested by 3

TestReleaseCreateBasicsFunction · 0.74
TestReleaseListAndDeleteFunction · 0.74
TestAccountListFunction · 0.74