File tree 3 files changed +59
-12
lines changed
3 files changed +59
-12
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,11 @@ steps:
66
66
{{- end }}
67
67
68
68
{{- if $test.Dind }}
69
- - make -C .ci TARGET="{{ $deployerCommand }} e2e-run e2e-generate-xml " ci
69
+ - make -C .ci TARGET="{{ $deployerCommand }} e2e-run" ci
70
70
{{- else }}
71
- - make {{ $deployerCommand }} e2e-run e2e-generate-xml
71
+ - make {{ $deployerCommand }} e2e-run
72
72
{{- end }}
73
73
74
- - mkdir tests-report && mv e2e-tests.xml tests-report/e2e-tests-{{ $test.SlugName }}.xml
75
-
76
74
agents :
77
75
{{- if $test.Dind }}
78
76
provider : " gcp"
85
83
{{- end }}
86
84
87
85
artifact_paths :
88
- - tests-report/*.xml
86
+ - e2e- tests-*.json
89
87
- " eck-diagnostic*.zip"
90
88
91
89
{{- end }}
@@ -123,6 +121,17 @@ steps:
123
121
image : " family/elastic-buildkite-agent-ubuntu-2004-lts"
124
122
{{- end }}
125
123
124
+
125
+
126
126
{{- end }}
127
127
{{- end }}
128
128
129
+ - wait : ~
130
+ continue_on_failure : true
131
+
132
+ - label : aggregate tests-results
133
+ commands :
134
+ - buildkite-agent artifact download e2e-tests-*.json .
135
+ - .buildkite/scripts/test/generate-tests-reports.sh
136
+ artifact_paths :
137
+ - e2e-tests-*.xml
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ # or more contributor license agreements. Licensed under the Elastic License 2.0;
5
+ # you may not use this file except in compliance with the Elastic License 2.0.
6
+
7
+ # Script to generate e2e tests reports in JUnit XML format from JSON go test results.
8
+
9
+ set -eu
10
+
11
+ gen_junit_report () {
12
+ local input_file=${1:- " input file" }
13
+ local xml_report=${input_file% .* } .xml
14
+
15
+ # exit without error when there is no input file
16
+ if [[ ! -f $input_file ]]; then
17
+ echo " No $input_file to generate a JUnit XML report."
18
+ exit 0
19
+ fi
20
+
21
+ # temporary filter out lines containing a space in the timestamp,
22
+ # see https://github.com/elastic/cloud-on-k8s/issues/3560.
23
+ gotestsum \
24
+ --junitfile " $xml_report " \
25
+ --raw-command grep -v ' "Time":"[^"]*\s[^"]*"' " $input_file " || \
26
+ ( \
27
+ echo " Failed to generate a JUnit XML report."
28
+ # print the input file for further debugging
29
+ echo " --- $input_file - START ---"
30
+ cat " $input_file "
31
+ echo " --- $input_file - END ---"
32
+ exit 1
33
+ )
34
+ }
35
+
36
+ for f in e2e-tests-* .json; do
37
+ gen_junit_report " $f "
38
+ done
Original file line number Diff line number Diff line change @@ -35,12 +35,12 @@ import (
35
35
)
36
36
37
37
const (
38
- jobTimeout = 600 * time .Minute // time to wait for the test job to finish
39
- kubePollInterval = 10 * time .Second // Kube API polling interval
40
- testRunLabel = "test-run" // name of the label applied to resources
41
- logStreamLabel = "stream-logs" // name of the label enabling log streaming to e2e runner
42
- testsLogFile = "e2e-tests.json" // name of file to keep all test logs in JSON format
43
- operatorReadyTimeout = 3 * time .Minute // time to wait for the operator pod to be ready
38
+ jobTimeout = 600 * time .Minute // time to wait for the test job to finish
39
+ kubePollInterval = 10 * time .Second // Kube API polling interval
40
+ testRunLabel = "test-run" // name of the label applied to resources
41
+ logStreamLabel = "stream-logs" // name of the label enabling log streaming to e2e runner
42
+ testsLogFilePattern = "e2e-tests-%s .json" // name of file to keep all test logs in JSON format
43
+ operatorReadyTimeout = 3 * time .Minute // time to wait for the operator pod to be ready
44
44
45
45
TestNameLabel = "test-name" // name of the label applied to resources during each test
46
46
)
@@ -602,7 +602,7 @@ func (h *helper) startAndMonitorTestJobs(client *kubernetes.Clientset) error {
602
602
603
603
outputs := []io.Writer {os .Stdout }
604
604
if h .logToFile {
605
- jl , err := newJSONLogToFile (testsLogFile )
605
+ jl , err := newJSONLogToFile (fmt . Sprintf ( testsLogFilePattern , h . testContext . ClusterName ) )
606
606
if err != nil {
607
607
log .Error (err , "Failed to create log file for test output" )
608
608
return err
You can’t perform that action at this time.
0 commit comments