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

fix: issue where scraper does not run when test contains setup error #4914

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
13 changes: 7 additions & 6 deletions contrib/executor/jmeterd/pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,26 +176,27 @@ func (r *JMeterDRunner) Run(ctx context.Context, execution testkube.Execution) (
out = envManager.ObfuscateSecrets(out)

var executionResult testkube.ExecutionResult
var jtlCheckError error
if hasJunit && hasReport {
executionResult, err = processJTLReport(r.fs, jtlPath, out)
if err != nil {
jtlCheckError = errors.Wrap(err, "error processing jtl report")
if errors.Is(err, parser.ErrEmptyReport) {
output.PrintLogf("%s JTL report is empty which probably indicates an issue with the test. Check the jmeter.log for more info.", ui.IconCross)
errMsg := "JTL report is empty which probably indicates an issue with the test. Check the jmeter.log for more info."
output.PrintLogf("%s %s", ui.IconCross, errMsg)
jtlCheckError = errors.New(errMsg)
}
return *result.Err(errors.Wrap(err, "error processing jtl report")), nil
}
} else {
executionResult = parser.MakeSuccessExecution(out)
}

output.PrintLogf("%s Mapped JMeter results to Execution Results...", ui.IconCheckMark)

postRunScriptErr := runPostRunScriptIfEnabled(execution, r.Params.WorkingDir)

scrapeErr := runScraperIfEnabled(ctx, r.Params.ScrapperEnabled, r.Scraper, []string{outputDir}, execution)

if postRunScriptErr != nil || scrapeErr != nil {
return *result.WithErrors(postRunScriptErr, scrapeErr), nil
if jtlCheckError != nil || postRunScriptErr != nil || scrapeErr != nil {
return *result.WithErrors(jtlCheckError, postRunScriptErr, scrapeErr), nil
}

return executionResult, nil
Expand Down
Loading