leehaut opened a new pull request, #9462:
URL: https://github.com/apache/hop/pull/9462

   Fix https://github.com/apache/hop/issues/9441
   
   ## What does this PR do?
   
   `hop import` now exits 1 when it stops before importing anything. Fixes 
#9441.
   
   `hop import` goes through `Hop.main` and picocli `execute()`. `HopImport` 
was a `Runnable`, so an early return was always exit code 0. `hop-import.sh` / 
`hop-import.bat` call `HopImport.main`, which already exits 1 while 
`finishedWithoutError` stays false.
   
   `HopImport` now also implements `Callable<Integer>`, the same way `hop run` 
does. picocli uses that return value: 0 when the import finishes, 1 when it 
stops or fails. A missing input folder still fails with an exception and exits 
1. A finished import still exits 0.
   
   ## Test plan
   
   - [x] `HopImportExitCodeTest`: no folders, input without output, and an 
unknown import type all exit 1
   - [x] Integration test 
`integration-tests/hop_run/main-0006-hop-import-exit-code.hwf` (Linux):
     - `hop import` with no `-i` / `-o` exits 1
     - `hop import -i <dir>` with no `-o` exits 1
     - `hop import -t nosuchtype` exits 1
     - `hop-import.sh` with no arguments exits 1
     - `hop import -i <missing folder>` exits 1
     - `hop import -t kettle` of an empty folder exits 0
   - [x] Rebuilt on Windows and checked `hop.bat import` for the same failure 
cases: exit code changed from 0 to 1. `hop-import.bat` with no arguments still 
exits 1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to