MCPcopy
hub / github.com/apache/devlake / createConnection

Function createConnection

backend/test/e2e/manual/testmo/testmo_test.go:149–173  ·  view source on GitHub ↗
(cfg TestConfig, client *helper.DevlakeClient)

Source from the content-addressed store, hash-verified

147}
148
149func createConnection(cfg TestConfig, client *helper.DevlakeClient) *helper.Connection {
150 conn := pluginmodels.TestmoConn{
151 RestConnection: api.RestConnection{
152 Endpoint: "https://yourorganization.testmo.net/api/v1", // Update this endpoint in testmo_local_test.go as needed
153 Proxy: "",
154 RateLimitPerHour: 0,
155 },
156 AccessToken: api.AccessToken{
157 Token: cfg.Token,
158 },
159 }
160 client.TestConnection(pluginName, conn)
161 connections := client.ListConnections(pluginName)
162 for _, connection := range connections {
163 if connection.Name == "testmo-conn" {
164 return connection
165 }
166 }
167 return client.CreateConnection(pluginName, pluginmodels.TestmoConnection{
168 BaseConnection: api.BaseConnection{
169 Name: "testmo-conn",
170 },
171 TestmoConn: conn,
172 })
173}

Callers 3

TestTestmoPluginFunction · 0.70
TestArgoCDPluginFunction · 0.50
TestGitlabPluginFunction · 0.50

Calls 3

CreateConnectionMethod · 0.80
TestConnectionMethod · 0.45
ListConnectionsMethod · 0.45

Tested by

no test coverage detected