Skip to content

Commit cf97d82

Browse files
authored
Use report command from elastic-package (elastic#4649)
1 parent 188d92a commit cf97d82

File tree

5 files changed

+4
-352
lines changed

5 files changed

+4
-352
lines changed

.ci/Jenkinsfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pipeline {
112112
''')
113113
sh(label: "Benchmark integration: ${it}", script: '''
114114
eval "$(../../build/elastic-package stack shellinit)"
115-
../../build/elastic-package benchmark -v --report-format xUnit --report-output file
115+
../../build/elastic-package benchmark -v --report-format json --report-output file
116116
''')
117117
}
118118
}
@@ -178,9 +178,9 @@ def gitHubCommentWithBenchmarkReport() {
178178
def benchmarkResults = 'benchmark-results'
179179
def currentBenchmarkResults = "build/${benchmarkResults}"
180180
def baseline = "build/${env.CHANGE_TARGET}/${benchmarkResults}"
181-
def detailLevel = "short"
181+
def isFullReport = "false"
182182
if (env.GITHUB_COMMENT?.contains('benchmark fullreport')) {
183-
detailLevel = "full"
183+
isFullReport = "true"
184184
}
185185
dir("${BASE_DIR}") {
186186
// download artifacts for this PR
@@ -207,9 +207,7 @@ def gitHubCommentWithBenchmarkReport() {
207207
}
208208

209209
// run the benchmark diff generator
210-
withMageEnv(){
211-
sh(label: 'mage GetGithubMarkdownBenchReport', script: "mage GetGithubMarkdownBenchReport ${currentBenchmarkResults} ${baseline} ${env.BENCHMARK_THRESHOLD} ${benchmarkGitHubFile} ${detailLevel}")
212-
}
210+
sh(label: 'elastic-package report benchmark', script: "elastic-package report benchmark --fail-on-missing=false --new=\"${currentBenchmarkResults}\" --old=\"${baseline}\" --threshold=${env.BENCHMARK_THRESHOLD} --report-output-path=\"${benchmarkGitHubFile}\" --full=${isFullReport}")
213211

214212
// report back with a github comment the benchmark diff
215213
try {

dev/benchreport/benchmark.go

Lines changed: 0 additions & 58 deletions
This file was deleted.

dev/benchreport/report.go

Lines changed: 0 additions & 201 deletions
This file was deleted.

dev/benchreport/result.go

Lines changed: 0 additions & 72 deletions
This file was deleted.

magefile.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ import (
1010
"io"
1111
"os"
1212
"path/filepath"
13-
"strconv"
1413

1514
"github.com/magefile/mage/mg"
1615
"github.com/magefile/mage/sh"
1716
"github.com/pkg/errors"
1817

19-
"github.com/elastic/integrations/dev/benchreport"
2018
"github.com/elastic/integrations/dev/codeowners"
2119
)
2220

@@ -53,19 +51,6 @@ func ImportBeats() error {
5351
return sh.Run("go", args...)
5452
}
5553

56-
func GetGithubMarkdownBenchReport(source, target, threshold, outputFile, detailLevel string) error {
57-
t, err := strconv.ParseFloat(threshold, 64)
58-
if err != nil {
59-
return err
60-
}
61-
isFull := detailLevel == "full"
62-
report, err := benchreport.GetBenchReport(source, target, t, isFull)
63-
if err != nil {
64-
return err
65-
}
66-
return os.WriteFile(outputFile, report, 0644)
67-
}
68-
6954
func build() error {
7055
mg.Deps(buildImportBeats)
7156
return nil

0 commit comments

Comments
 (0)