command line build shell scripts breaks while loop on error

Hello,

I have a bash script like below. 

sbt projects | sed 's/\x1b\[[0-9;]*m//g' | \
while read n
do
x=( $n )
echo "project : ${x[1]}"

if [[ ${x[1]} == "aaa"* ]] || [[ ${x[1]} == "bbb"* ]]; then
echo "module is ${x[1]}"
export module=${x[1]}
sbt "project ${x[1]}" stryker
echo "completed"
echo "$?"
fi
echo "project : ${x[1]}"
done

I am running test using command  sbt "project ${x[1]}" stryker for every sbt projects.
tests sometime fails and this cause build comes out of while loop. 
When i try the same code from a shell script in local, while loop works perfectly for all values.

Log in TC:

[error] (stryker) stryker4s.extension.exception.TestSetupException: Could not setup mutation testing environment. Unable to resolve project classpath. This could be due to compile errors or misconfiguration of Stryker4s. See debug logs for more information.

  [error] Total time: 141 s (02:21), completed Jul 2, 2021 3:06:30 PM

   [0Jcompleted

  project : aaa

Process exited with code 0

Log in Local

  [error] (stryker) stryker4s.extension.exception.TestSetupException: Could not setup mutation testing environment. Unable to resolve project classpath. This could be due to compile errors or misconfiguration of Stryker4s. See debug logs for more information.
[error] Total time: 20 s, completed 2 Jul, 2021 4:03:27 PM
completed
0
project : aaa
project : bbbb

Please sign in to leave a comment.