-
-
Notifications
You must be signed in to change notification settings - Fork 598
test: Remove Parse.Cloud.job
parameters from tests
#2640
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
test: Remove Parse.Cloud.job
parameters from tests
#2640
Conversation
🚀 Thanks for opening this pull request! |
📝 WalkthroughWalkthroughA new cloud job Changes
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Parse.Cloud.job
parameter from testsParse.Cloud.job
parameters from tests
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## alpha #2640 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 63 63
Lines 6193 6193
Branches 1472 1472
=========================================
Hits 6193 6193 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I would rather you update the job saving the parameters to the job status object so we know parameters have been passed properly |
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: 0
🧹 Nitpick comments (1)
integration/test/cloud/main.js (1)
48-50
: Good approach, but add error handling for robustness.This implementation effectively addresses the Parse Server changes by preserving parameter validation through message passing. However, consider adding error handling to prevent potential runtime issues.
Apply this diff to improve robustness and consistency:
-Parse.Cloud.job('CloudJobParamsInMessage', request => { - request.message(JSON.stringify(request.params)); -}); +Parse.Cloud.job('CloudJobParamsInMessage', function (request) { + try { + const params = request.params || {}; + request.message(JSON.stringify(params)); + } catch (error) { + request.message(`Error serializing parameters: ${error.message}`); + } +});This improvement:
- Uses consistent function declaration syntax with other jobs in the file
- Handles cases where
request.params
might be undefined- Catches JSON.stringify errors (e.g., circular references)
- Provides meaningful error messages for debugging
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
integration/test/IdempotencyTest.js
(2 hunks)integration/test/ParseCloudTest.js
(1 hunks)integration/test/cloud/main.js
(1 hunks)integration/test/helper.js
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- integration/test/helper.js
🚧 Files skipped from review as they are similar to previous changes (2)
- integration/test/ParseCloudTest.js
- integration/test/IdempotencyTest.js
Like so? I've added checking params in the job message. I think the test jobs are wrong to return a status object, because a Cloud Job doesn't expect any return value. As far as I know there's only the |
LGTM! |
Pull Request
Issue
Tests fail because of parse-community/parse-server#8343.
Approach
Remove expecting the param from the test.
Summary by CodeRabbit