-
Notifications
You must be signed in to change notification settings - Fork 753
Refactor Google Batch getExitCode to imperative style #6649
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
Conversation
✅ Deploy Preview for nextflow-docs-staging canceled.
|
- Change getExitCode visibility from private to protected for testability - Replace functional stream-based implementation with imperative for-loop to fix IntelliJ syntax errors with lambda expressions in Groovy - Add StatusEvent import to support the refactored code - Add comprehensive unit test using Spock data-driven where clause covering 8 scenarios including null status, empty events, single/multiple events, out-of-order timestamps, and mixed events - Add detailed comments explaining the logic flow Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
707d226 to
faf54a5
Compare
|
This was rewritten because intellij was reporting (false positive) compilation errors, still annoying tho. |
|
Do the errors prevent you from building? |
|
obviously no, tests were passing |
|
I wonder if the errors go away by replacing the lambdas with closures. Even though it's not desirable, I think Groovy is compiling lambdas the same way as closures anyway, so you might as well use the closure if it removes the error |
|
Likely yes, however it's not worth spending more time on this (and i also find a bit more readable the imperative approach) |
plugins/nf-google/src/main/nextflow/cloud/google/batch/GoogleBatchTaskHandler.groovy
Outdated
Show resolved
Hide resolved
…atchTaskHandler.groovy [ci fast] Co-authored-by: Jorge Ejarque <jorgee@users.noreply.github.com> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Summary
getExitCode()method inGoogleBatchTaskHandlerfrom functional stream-based style to imperative for-loop to fix IntelliJ syntax errors with lambda expressions in GroovyStatusEventimport to support the refactored codewhereclause covering 8 scenariosChanges
GoogleBatchTaskHandler.groovy
GoogleBatchTaskHandlerTest.groovy
makeStatusEventWithTime()andmakeTaskStatusWithEvents()should get exit code from latest task execution eventwith 8 test cases:Test plan
./gradlew :plugins:nf-google:test --tests GoogleBatchTaskHandlerTest🤖 Generated with Claude Code