This repository was archived by the owner on Feb 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathtaskcluster_proxy_broken_on_docker_test.go
More file actions
67 lines (61 loc) · 1.62 KB
/
taskcluster_proxy_broken_on_docker_test.go
File metadata and controls
67 lines (61 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// +build !dockerEngine
package main
import (
"os"
"testing"
)
func TestTaskclusterProxy(t *testing.T) {
if os.Getenv("TASKCLUSTER_PROXY_URL") == "" {
if os.Getenv("TASKCLUSTER_CLIENT_ID") == "" ||
os.Getenv("TASKCLUSTER_ACCESS_TOKEN") == "" ||
os.Getenv("TASKCLUSTER_ROOT_URL") == "" {
t.Skip("Skipping test since TASKCLUSTER_{CLIENT_ID,ACCESS_TOKEN,ROOT_URL} env vars not set")
}
}
defer setup(t)()
payload := GenericWorkerPayload{
Command: append(
append(
goEnv(),
// long enough to reclaim and get new credentials
sleep(12)...,
),
goRun(
"curlget.go",
// note that curlget.go supports substituting the proxy URL from its runtime environment
"TASKCLUSTER_PROXY_URL/queue/v1/task/KTBKfEgxR5GdfIIREQIvFQ/runs/0/artifacts/SampleArtifacts/_/X.txt",
)...,
),
MaxRunTime: 60,
Env: map[string]string{},
Features: FeatureFlags{
TaskclusterProxy: true,
},
}
for _, envVar := range []string{
"PATH",
"GOPATH",
"GOROOT",
} {
if v, exists := os.LookupEnv(envVar); exists {
payload.Env[envVar] = v
}
}
td := testTask(t)
td.Scopes = []string{"queue:get-artifact:SampleArtifacts/_/X.txt"}
reclaimEvery5Seconds = true
taskID := submitAndAssert(t, td, payload, "completed", "completed")
reclaimEvery5Seconds = false
expectedArtifacts := ExpectedArtifacts{
"public/logs/live_backing.log": {
Extracts: []string{
"test artifact",
"Successfully refreshed taskcluster-proxy credentials",
},
ContentType: "text/plain; charset=utf-8",
ContentEncoding: "gzip",
Expires: td.Expires,
},
}
expectedArtifacts.Validate(t, taskID, 0)
}