-
Couldn't load subscription status.
- Fork 14
test: add integration tests for flows with map steps #222
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: add integration tests for flows with map steps #222
Conversation
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests
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 |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected -t lint typecheck test --parallel -... |
❌ Failed | 6m 33s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-10-06 15:33:53 UTC
b63837a to
ece6b73
Compare
| const firstAttemptTasks = await sql` | ||
| SELECT status, attempts_count, error_message FROM pgflow.step_tasks | ||
| WHERE run_id = ${flowRun.run_id} AND step_slug = 'retryStep'; | ||
| `; | ||
| const firstAttemptTask = firstAttemptTasks[0]; |
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.
The query result is stored in firstAttemptTasks array, but then the code immediately accesses firstAttemptTasks[0] without checking if the array contains any elements. This could lead to accessing properties on undefined if the query returns no results. Consider adding a null check before accessing the first element:
const firstAttemptTasks = await sql`...`;
if (firstAttemptTasks.length === 0) {
// Handle empty result case
return;
}
const firstAttemptTask = firstAttemptTasks[0];| const firstAttemptTasks = await sql` | |
| SELECT status, attempts_count, error_message FROM pgflow.step_tasks | |
| WHERE run_id = ${flowRun.run_id} AND step_slug = 'retryStep'; | |
| `; | |
| const firstAttemptTask = firstAttemptTasks[0]; | |
| const firstAttemptTasks = await sql` | |
| SELECT status, attempts_count, error_message FROM pgflow.step_tasks | |
| WHERE run_id = ${flowRun.run_id} AND step_slug = 'retryStep'; | |
| `; | |
| if (firstAttemptTasks.length === 0) { | |
| throw new Error('No tasks found for retryStep'); | |
| } | |
| const firstAttemptTask = firstAttemptTasks[0]; |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
5543ded to
c2a2e38
Compare
ece6b73 to
583047f
Compare
583047f to
eed4e5e
Compare
c2a2e38 to
2e8084f
Compare
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-222.pgflow.pages.dev 📝 Details:
_Last updated: _ |
🔍 Preview Deployment: Playground✅ Deployment successful! 🔗 Preview URL: https://pr-222--pgflow-demo.netlify.app 📝 Details:
_Last updated: _ |
Introduce new tests covering root map, dependent map, and empty array map scenarios. Verify correct execution, task creation, and output aggregation for various flow configurations.
eed4e5e to
b89cc1d
Compare
2e8084f to
85630ea
Compare
Merge activity
|
Introduce new tests covering root map, dependent map, and empty array map scenarios. Verify correct execution, task creation, and output aggregation for various flow configurations.

Introduce new tests covering root map, dependent map, and empty array map scenarios.
Verify correct execution, task creation, and output aggregation for various flow configurations.