You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2021/07/27 12:39:52 UTC

[GitHub] [daffodil] stevedlawrence commented on pull request #601: Distinct return codes for CLI

stevedlawrence commented on pull request #601:
URL: https://github.com/apache/daffodil/pull/601#issuecomment-887477300


   Interesting, it looks like things are still failing on windows. And the failures are all with the error:
   ```scala
   java.lang.NumberFormatException: For input string: "%errorlevel%"
   ```
   So it seems our new expectExitCode capture our echo line, and not the results. Looking at the output for the integration tests, we see things like this:
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <never-fails>2f6481e6-542c-11eb-ae93-0242ac130002</never-fails>
   echo EXITCODE:%errorlevel%
   
   D:\a\daffodil\daffodil>echo EXITCODE:%errorlevel%
   EXITCODE:0
   ```
   So we can see some output happened (the never-fails stuff), and before we got a prompt we call sendLine with `echo EXITCODE:%errorlevel%`, which we can see (that's output to the console). Then we will call `expect("EXITCODE")`. But even though echo command has already been output, windows will output it again, and we are going to match that. I guess Linux doesn't output that stuff twice. 
   
   So as to a solution? I wonder if rather than expecting `EXITCODE:`, we can instead look for `\nEXITCODE', with a prepended newline? That way we won't match the keyword in the echo because there's a space before that keyword? Which would mean the expect line becomes this:
   
   ```scala
   shell.expect(contains("\n" + keyWord))
   ```


-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org