-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix/test runner script error detection fixes #6953
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
base: main
Are you sure you want to change the base?
Fix/test runner script error detection fixes #6953
Conversation
… CLI and Electron
…l results for pre-request and post-response scripts across CLI and Electron. This ensures that tests passing before an error are still reported.
… assertion results. This adds clear visual feedback for pass/fail outcomes in the CLI output.
WalkthroughCentralizes script execution error handling across pre-request, post-response, and test scripts, preserves and surfaces partialResults from script errors, and computes a unified per-request status by aggregating failures across all test phases. Changes
Sequence DiagramsequenceDiagram
actor User
participant CLI as CLI Runner
participant IPC as IPC / UI
participant Runtime as Script Runtime
participant Status as Status Computer
User->>CLI: trigger request run
CLI->>Runtime: run pre-request script
alt pre-request succeeds
Runtime-->>CLI: pre-request results
else pre-request errors (with partialResults)
Runtime-->>CLI: error + partialResults
CLI->>IPC: emit pre-request results (partial)
end
CLI->>Runtime: run main request -> response
Runtime-->>CLI: response
CLI->>Runtime: run post-response script
alt post-response succeeds
Runtime-->>CLI: post-response results
else post-response errors (with partialResults)
Runtime-->>CLI: error + partialResults
CLI->>IPC: emit post-response results (partial)
end
CLI->>Runtime: run test scripts
alt tests succeed
Runtime-->>CLI: test results
else tests error (with partialResults)
Runtime-->>CLI: error + partialResults
CLI->>IPC: emit test results (partial)
end
CLI->>Status: aggregate pre/post/test/assertions
Status-->>CLI: consolidated requestStatus (pass|fail)
CLI-->>User: final result with unified status
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/bruno-cli/src/runner/run-single-request.js`:
- Around line 801-821: Remove the stray literal 'tomato' from the failure branch
console.log so the output shows only the colored filename and metadata; locate
the block that computes hasAnyFailures/requestStatus and the subsequent if
(hasAnyFailures) console.log call (uses relativeItemPathname, stripExtension,
chalk, response, responseTime) and delete the 'tomato' string so the failure
message mirrors the success branch but with chalk.red for the filename.
Description
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.