Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use report command from elastic-package #4649

Merged
merged 6 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pipeline {
''')
sh(label: "Benchmark integration: ${it}", script: '''
eval "$(../../build/elastic-package stack shellinit)"
../../build/elastic-package benchmark -v --report-format xUnit --report-output file
../../build/elastic-package benchmark -v --report-format json --report-output file
''')
}
}
Expand Down Expand Up @@ -178,9 +178,9 @@ def gitHubCommentWithBenchmarkReport() {
def benchmarkResults = 'benchmark-results'
def currentBenchmarkResults = "build/${benchmarkResults}"
def baseline = "build/${env.CHANGE_TARGET}/${benchmarkResults}"
def detailLevel = "short"
def isFullReport = "false"
if (env.GITHUB_COMMENT?.contains('benchmark fullreport')) {
detailLevel = "full"
isFullReport = "true"
}
dir("${BASE_DIR}") {
// download artifacts for this PR
Expand All @@ -207,9 +207,7 @@ def gitHubCommentWithBenchmarkReport() {
}

// run the benchmark diff generator
withMageEnv(){
sh(label: 'mage GetGithubMarkdownBenchReport', script: "mage GetGithubMarkdownBenchReport ${currentBenchmarkResults} ${baseline} ${env.BENCHMARK_THRESHOLD} ${benchmarkGitHubFile} ${detailLevel}")
}
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}")

// report back with a github comment the benchmark diff
try {
Expand Down
58 changes: 0 additions & 58 deletions dev/benchreport/benchmark.go

This file was deleted.

201 changes: 0 additions & 201 deletions dev/benchreport/report.go

This file was deleted.

72 changes: 0 additions & 72 deletions dev/benchreport/result.go

This file was deleted.

15 changes: 0 additions & 15 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ import (
"io"
"os"
"path/filepath"
"strconv"

"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
"github.com/pkg/errors"

"github.com/elastic/integrations/dev/benchreport"
"github.com/elastic/integrations/dev/codeowners"
)

Expand Down Expand Up @@ -53,19 +51,6 @@ func ImportBeats() error {
return sh.Run("go", args...)
}

func GetGithubMarkdownBenchReport(source, target, threshold, outputFile, detailLevel string) error {
t, err := strconv.ParseFloat(threshold, 64)
if err != nil {
return err
}
isFull := detailLevel == "full"
report, err := benchreport.GetBenchReport(source, target, t, isFull)
if err != nil {
return err
}
return os.WriteFile(outputFile, report, 0644)
}

func build() error {
mg.Deps(buildImportBeats)
return nil
Expand Down