You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered this issue while working on #4397 . I had two statements in my test feature file where I just curl application endpoint and verify whether we received expected response:
Then executing "curl -s http://quarkus-jkube-quarkus-app-deploy-flow-test.apps-crc.testing" succeeds
And stdout should contain "{\"applicationName\":\"JKube\",\"message\":\"Subatomic JKube really whips the llama's ass!\"}"
However, I was getting the actual output string as '', hence causing the assertion to fail.
On closer look to shell.go , it looks like we append a token of the command's exit code to command stdout. We split the command output by \n and expect the last line containing the exit code token exitCodeOfLastCommandInShell= .
Here while parsing command output we either write command output or exit code:
This works for most cases, however the application I was testing E2E test with didn't had output ending with a newline. So we were getting a line like this:
{"applicationName":"JKube","message":"Subatomic JKube really whips the llama's ass!"}exitCodeOfLastCommandInShell=0
Due to this command output was being ignored.
We should refactor this code to also extract any prefix before exit code token and also write it to output buffer.
Expected Behavior
Shell command should be correctly parsed regardless of whether it ends with newline or not
Acceptance Criteria
abovementioned code is refactored also to consider any prefix while parsing exit code token
The text was updated successfully, but these errors were encountered:
…without newline (crc-org#4416)
ScanPipe should not assume entire line to contain only the exit code
token. It should extract exit code token and write remainder output to
output buffer.
Signed-off-by: Rohan Kumar <[email protected]>
…without newline (crc-org#4416)
ScanPipe should not assume entire line to contain only the exit code
token. It should extract exit code token and write remainder output to
output buffer.
Signed-off-by: Rohan Kumar <[email protected]>
…without newline (crc-org#4416)
ScanPipe should not assume entire line to contain only the exit code
token. It should extract exit code token and write remainder output to
output buffer.
Signed-off-by: Rohan Kumar <[email protected]>
Component
E2E Test Utilities
Description
Related to #4397
I encountered this issue while working on #4397 . I had two statements in my test feature file where I just
curl
application endpoint and verify whether we received expected response:However, I was getting the actual output string as
''
, hence causing the assertion to fail.On closer look to shell.go , it looks like we append a token of the command's exit code to command stdout. We split the command output by
\n
and expect the last line containing the exit code tokenexitCodeOfLastCommandInShell=
.Here while parsing command output we either write command output or exit code:
crc/test/extended/util/shell.go
Lines 94 to 99 in 9b7772d
This works for most cases, however the application I was testing E2E test with didn't had output ending with a newline. So we were getting a line like this:
Due to this command output was being ignored.
We should refactor this code to also extract any prefix before exit code token and also write it to output buffer.
Expected Behavior
Shell command should be correctly parsed regardless of whether it ends with newline or not
Acceptance Criteria
The text was updated successfully, but these errors were encountered: