Skip to content

Enhance error handling for script execution by introducing isScriptError flag in test results - #7029

Merged
bijin-bruno merged 3 commits into
usebruno:fix/runner-results-enhancementfrom
sanjaikumar-bruno:fix/runner-results-enhancement-improvement-2
Feb 4, 2026
Merged

bijin-bruno merged 3 commits into
usebruno:fix/runner-results-enhancementfrom
sanjaikumar-bruno:fix/runner-results-enhancement-improvement-2

Conversation

@sanjaikumar-bruno

@sanjaikumar-bruno sanjaikumar-bruno commented Feb 3, 2026 •

Copy link
Copy Markdown
Contributor

Improvements on top of: #6261

@coderabbitai

coderabbitai Bot commented Feb 3, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • main
  • release/*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Walkthrough

This PR enhances script error handling in the runner by introducing an isScriptError flag to test result types and adjusting the runner logic to distinguish, log, and handle pre-request/post-response/test script errors separately. Early returns prevent cascading execution when pre-request scripts fail, and summary counts now filter out script errors from pass tallies.

Changes

Cohort / File(s) Summary
Script Error Type Definition
packages/bruno-common/src/runner/types/index.ts
Added optional isScriptError?: boolean field to T_TestPassResult and T_TestFailResult to signal script-level execution errors.
Runner Error Handling
packages/bruno-cli/src/runner/run-single-request.js
Added error logging with relative paths for pre-request failures, applied isScriptError: true flag to script error payloads, and implemented early return on pre-request errors to prevent HTTP request and subsequent script execution.
Summary Calculation Logic
packages/bruno-common/src/runner/runner-summary.ts
Modified test counting to filter out isScriptError entries from pass tallies, treating script errors as failures in the result summary aggregation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #6261: Related script-error handling path improvements with error propagation and partial-result aggregation that work alongside this isScriptError flag implementation.

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno

Poem

🛑 When scripts stumble, errors now flow clear,
With flags that signal troubles near,
Early returns prevent cascade woes,
Summary counts now properly compose,
Better errors lead the way! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: introducing an isScriptError flag for enhanced error handling in script execution across test results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sanjaikumar-bruno

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bijin-bruno
bijin-bruno merged commit 1325722 into usebruno:fix/runner-results-enhancement Feb 4, 2026
@sanjaikumar-bruno
sanjaikumar-bruno deleted the fix/runner-results-enhancement-improvement-2 branch February 4, 2026 06:32
sanjaikumar-bruno added a commit to sanjaikumar-bruno/bruno that referenced this pull request Feb 4, 2026
…ror flag in test results (usebruno#7029)

* fix: Enhance error handling for script execution by introducing isScriptError flag in test results
sanjaikumar-bruno added a commit to sanjaikumar-bruno/bruno that referenced this pull request Feb 4, 2026
…ror flag in test results (usebruno#7029)

* fix: Enhance error handling for script execution by introducing isScriptError flag in test results

Enhance error reporting in script execution by adding isScriptError flag to error responses

fix: Mark pre-request script errors as failures in runner summary
bijin-bruno added a commit that referenced this pull request Feb 4, 2026
* Mark test script errors as failed in runner (#6261)

* Mark test script errors as failed in runner
    and CLI

* Unify handling of post-response and pre-request script errors in both CLI and Electron

* feat: Enhance error handling in script execution by preserving partial results for pre-request and post-response scripts across CLI and Electron. This ensures that tests passing before an error are still reported.

* Preserving stopExecution in test script error handler

---------

Co-authored-by: Pragadesh-45 <[email protected]>

* Enhance error handling for script execution by introducing isScriptError flag in test results (#7029)

* fix: Enhance error handling for script execution by introducing isScriptError flag in test results

Enhance error reporting in script execution by adding isScriptError flag to error responses

fix: Mark pre-request script errors as failures in runner summary

---------

Co-authored-by: Karan Pradhan <[email protected]>
Co-authored-by: Pragadesh-45 <[email protected]>
maxenceleblanc pushed a commit to maxenceleblanc/curly_cats2 that referenced this pull request Jul 20, 2026
…ror flag in test results (usebruno#7029)

* fix: Enhance error handling for script execution by introducing isScriptError flag in test results

Enhance error reporting in script execution by adding isScriptError flag to error responses

fix: Mark pre-request script errors as failures in runner summary
maxenceleblanc pushed a commit to maxenceleblanc/curly_cats2 that referenced this pull request Jul 20, 2026
* Mark test script errors as failed in runner (usebruno#6261)

* Mark test script errors as failed in runner
    and CLI

* Unify handling of post-response and pre-request script errors in both CLI and Electron

* feat: Enhance error handling in script execution by preserving partial results for pre-request and post-response scripts across CLI and Electron. This ensures that tests passing before an error are still reported.

* Preserving stopExecution in test script error handler

---------

Co-authored-by: Pragadesh-45 <[email protected]>

* Enhance error handling for script execution by introducing isScriptError flag in test results (usebruno#7029)

* fix: Enhance error handling for script execution by introducing isScriptError flag in test results

Enhance error reporting in script execution by adding isScriptError flag to error responses

fix: Mark pre-request script errors as failures in runner summary

---------

Co-authored-by: Karan Pradhan <[email protected]>
Co-authored-by: Pragadesh-45 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants