Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Commit

Permalink
Merge #517
Browse files Browse the repository at this point in the history
517: [backports/ci/1.3] backport CI updates r=falfaro a=sameersbn



Co-authored-by: Sameer Naik <sameer@bitnami.com>
  • Loading branch information
bors[bot] and Sameer Naik committed Apr 29, 2019
2 parents a3de976 + 1efe989 commit 87fe4cd
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 38 deletions.
11 changes: 7 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ spec:
// See:
// gcloud container get-server-config
def gkeKversions = ["1.11", "1.12"]
for (kversion in gkeKversions) {
for (x in gkeKversions) {
def kversion = x // local bind required because closures
def project = 'bkprtesting'
def zone = 'us-east1-b'
def platform = "gke-" + kversion
Expand Down Expand Up @@ -384,7 +385,8 @@ spec:
// See:
// az aks get-versions -l centralus --query 'sort(orchestrators[?orchestratorType==`Kubernetes`].orchestratorVersion)'
def aksKversions = ["1.11", "1.12"]
for (kversion in aksKversions) {
for (x in aksKversions) {
def kversion = x // local bind required because closures
def resourceGroup = 'jenkins-bkpr-rg'
def location = "eastus"
def platform = "aks-" + kversion
Expand Down Expand Up @@ -501,7 +503,8 @@ spec:
}

def eksKversions = ["1.11"]
for (kversion in eksKversions) {
for (x in eksKversions) {
def kversion = x // local bind required because closures
def awsRegion = "us-east-1"
def awsUserPoolId = "${awsRegion}_zkRzdsjxA"
def awsZones = ["us-east-1b", "us-east-1f"]
Expand Down Expand Up @@ -593,7 +596,7 @@ spec:
}
}
container('eksctl') {
sh "eksctl delete cluster --name ${clusterName}"
sh "eksctl delete cluster --name ${clusterName} --timeout 10m0s || true"
}
}
// dnsSetup
Expand Down
10 changes: 5 additions & 5 deletions tests/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ var _ = Describe("Ingress", func() {
}

return lbAddr, nil
}, "20m", "5s").
}, "5m", "5s").
ShouldNot(WithTransform(isPrivateIP, BeTrue()))
})

Expand Down Expand Up @@ -249,7 +249,7 @@ var _ = Describe("Ingress", func() {

resp, err = getURL(client, url)
return resp, err
}, "20m", "5s").
}, "5m", "5s").
Should(WithTransform(statusCode, Equal(200)))

defer resp.Body.Close()
Expand Down Expand Up @@ -295,7 +295,7 @@ var _ = Describe("Ingress", func() {
Eventually(func() (*http.Response, error) {
resp, err = getURL(client, url)
return resp, err
}, "30m", "5s").
}, "10m", "5s").
Should(WithTransform(statusCode, Equal(200)))

defer resp.Body.Close()
Expand Down Expand Up @@ -336,7 +336,7 @@ var _ = Describe("Ingress", func() {
// NB: will follow redirects
resp, err = getURL(client, testUrl)
return resp, err
}, "20m", "5s").
}, "10m", "5s").
Should(WithTransform(statusCode, Or(Equal(200), Equal(400))))

fmt.Fprintf(GinkgoWriter, "Response:\n%#v", resp)
Expand Down Expand Up @@ -400,7 +400,7 @@ var _ = Describe("Ingress", func() {
// NB: will follow redirects
resp, err = getURL(client, testUrl)
return resp, err
}, "20m", "5s").
}, "10m", "5s").
Should(WithTransform(statusCode, Equal(200)))

fmt.Fprintf(GinkgoWriter, "Response:\n%#v", resp)
Expand Down
2 changes: 1 addition & 1 deletion tests/logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ var _ = Describe("Logging", func() {
resp := apiResponse{}
json.Unmarshal(resultRaw, &resp)
return &resp, err
}, "15m", "5s").
}, "5m", "5s").
Should(WithTransform(totalHits, BeNumerically(">", 0)))
})
})
Expand Down
46 changes: 18 additions & 28 deletions tests/monitoring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,23 @@ var _ = Describe("Exporters", func() {
"match[]": selector,
"start": fmt.Sprintf("%d", time.Now().Add(-20*time.Minute).Unix()),
}
resultRaw, err := c.CoreV1().
Services("kubeprod").
ProxyGet("http", "prometheus", "9090", "api/v1/series", params).
DoRaw()
Expect(err).NotTo(HaveOccurred())

resp := promResponse{}
json.Unmarshal(resultRaw, &resp)
var series []map[string]string
json.Unmarshal(resp.Data, &series)

fmt.Fprintf(GinkgoWriter, "%s found %d timeseries:\n", selector, len(series))
for i, s := range series {
if i >= 10 {
fmt.Fprintf(GinkgoWriter, "(truncated ...)\n")
break
}
fmt.Fprintf(GinkgoWriter, "%s{", s["__name__"])
for k, v := range s {
if k != "__name__" {
fmt.Fprintf(GinkgoWriter, "%s=%q,", k, v)
}
Eventually(func() ([]map[string]string, error) {
var series []map[string]string
resultRaw, err := c.CoreV1().
Services("kubeprod").
ProxyGet("http", "prometheus", "9090", "api/v1/series", params).
DoRaw()
if err != nil {
return nil, err
}
fmt.Fprintf(GinkgoWriter, "}\n")
}

Expect(series).To(match)
resp := promResponse{}
json.Unmarshal(resultRaw, &resp)
json.Unmarshal(resp.Data, &series)

return series, err
}, "5m", "5s").Should(match)
},
Entry("prometheus", `prometheus_tsdb_head_chunks{kubernetes_namespace="kubeprod",name="prometheus"}`, Not(BeEmpty())),
Entry("alertmanager", `alertmanager_peer_position`, Not(BeEmpty())),
Expand Down Expand Up @@ -180,7 +170,7 @@ var _ = Describe("Monitoring", func() {
json.Unmarshal(resp.Data, &series)

return series, err
}, "20m", "5s").
}, "5m", "5s").
Should(WithTransform(countSeries, BeNumerically(">", 0)))

Expect(series[0].Container).To(Equal(deploy.Spec.Template.Spec.Containers[0].Name))
Expand All @@ -203,7 +193,7 @@ var _ = Describe("Monitoring", func() {
json.Unmarshal(resp.Data, &managers)

return managers.Active, err
}, "20m", "5s").
}, "5m", "5s").
Should(WithTransform(countEndpoints, BeNumerically(">", 0)))

Expect(managers.Active[0].Url).To(ContainSubstring(am_path + "/api/v1/alerts"))
Expand Down Expand Up @@ -233,7 +223,7 @@ var _ = Describe("Monitoring", func() {
json.Unmarshal(resp.Data, &series)

return series, err
}, "20m", "5s").
}, "5m", "5s").
Should(WithTransform(countSeries, BeNumerically(">", 0)))

Expect(series[0].Container).To(Equal(deploy.Spec.Template.Spec.Containers[0].Name))
Expand All @@ -257,7 +247,7 @@ var _ = Describe("Monitoring", func() {
json.Unmarshal(resp.Data, &alerts)

return alerts, err
}, "20m", "5s").
}, "5m", "5s").
Should(WithTransform(countAlerts, BeNumerically(">", 0)))

Expect(alerts[0].Label.Container).To(Equal(deploy.Spec.Template.Spec.Containers[0].Name))
Expand Down

0 comments on commit 87fe4cd

Please sign in to comment.