[ARVADOS] updated: edc5c5d88db4f9584db8b8a4ec24e9307ec45244
git at public.curoverse.com
git at public.curoverse.com
Mon Mar 9 23:19:33 EDT 2015
Summary of changes:
services/keepstore/pull_worker_integration_test.go | 46 +++++++++++++---------
1 file changed, 27 insertions(+), 19 deletions(-)
via edc5c5d88db4f9584db8b8a4ec24e9307ec45244 (commit)
from 5744e0bd6cdf57815739599291951884ba7f540d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit edc5c5d88db4f9584db8b8a4ec24e9307ec45244
Author: Radhika Chippada <radhika at curoverse.com>
Date: Mon Mar 9 23:19:06 2015 -0400
3761: a little refactoring
diff --git a/services/keepstore/pull_worker_integration_test.go b/services/keepstore/pull_worker_integration_test.go
index decc668..4944380 100644
--- a/services/keepstore/pull_worker_integration_test.go
+++ b/services/keepstore/pull_worker_integration_test.go
@@ -2,6 +2,7 @@ package main
import (
"crypto/tls"
+ "encoding/json"
"fmt"
"git.curoverse.com/arvados.git/sdk/go/arvadosclient"
"git.curoverse.com/arvados.git/sdk/go/arvadostest"
@@ -10,7 +11,6 @@ import (
"os"
"strings"
"testing"
- "encoding/json"
)
var keepClient keepclient.KeepClient
@@ -33,29 +33,17 @@ func SetupPullWorkerIntegrationTest(t *testing.T, testData PullWorkIntegrationTe
t.Error("Error creating arv")
}
- keepClient = keepclient.KeepClient{
- Arvados: &arv,
- Want_replicas: 1,
- Using_proxy: true,
- Client: &http.Client{},
- }
-
- random_token := GenerateRandomApiToken()
- keepClient.Arvados.ApiToken = random_token
- if err != nil {
- t.Error("Error creating keepclient")
- }
-
servers := GetKeepServices(t)
- pullRequest := PullRequest{
- Locator: testData.Locator,
- Servers: servers,
- }
+ random_token := GenerateRandomApiToken()
+ // Put content if the test needs it
if wantData {
+ CreateKeepClient(arv, random_token)
+ keepClient.Arvados.ApiToken = random_token
+
service_roots := make(map[string]string)
- for _, addr := range pullRequest.Servers {
+ for _, addr := range servers {
service_roots[addr] = addr
}
keepClient.SetServiceRoots(service_roots)
@@ -66,9 +54,29 @@ func SetupPullWorkerIntegrationTest(t *testing.T, testData PullWorkIntegrationTe
}
}
+ // Create pullRequest for the test
+ CreateKeepClient(arv, random_token)
+
+ pullRequest := PullRequest{
+ Locator: testData.Locator,
+ Servers: servers,
+ }
return pullRequest
}
+func CreateKeepClient(arv arvadosclient.ArvadosClient, random_token string) {
+ client := &http.Client{Transport: &http.Transport{
+ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}}
+
+ keepClient = keepclient.KeepClient{
+ Arvados: &arv,
+ Want_replicas: 1,
+ Using_proxy: true,
+ Client: client,
+ }
+ keepClient.Arvados.ApiToken = random_token
+}
+
func GetKeepServices(t *testing.T) []string {
client := &http.Client{Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list