run-all.bash 851 Bytes
Newer Older
Elian Kraja's avatar
Elian Kraja committed
1 2 3 4
#!/bin/bash

## Launch robot tests validator

Michele Carignani's avatar
Michele Carignani committed
5 6 7
mkdir logs

/bin/bash scripts/launch-validation.sh > logs/robot_stdout.log 2> logs/robot_stderr.log
Elian Kraja's avatar
Elian Kraja committed
8 9 10 11 12 13 14 15 16

## Filter failed Keywords
grep -r10n "| FAIL |" logs/robot_stdout.log  | grep -v "Output:" | grep -v "Log:" | grep -v "Report:" > logs/failures.log
rm -f logs/robot_stdout.log


## Filter Errors on code
grep -rn " ERROR " logs/robot_stderr.log | grep -v "File has no tests or tasks" > logs/errors.log
rm -f logs/robot_stderr.log
Elian Kraja's avatar
Elian Kraja committed
17 18 19 20 21 22


ERRORS=`awk 'END{print NR}' logs/errors.log logs/failures.log`
if [ "${ERRORS}" -eq 0 ]; then
	rm -f logs/errors.log
	rm -f logs/failures.log
Michele Carignani's avatar
Michele Carignani committed
23 24 25
fi


26
if [ -f logs/errors.log ]; then
Michele Carignani's avatar
Michele Carignani committed
27 28 29
	cat logs/errors.log
fi

30
if [ -f logs/failures.log ]; then
Michele Carignani's avatar
Michele Carignani committed
31 32 33
	cat logs/failures.log
fi

34
if [ -f logs/erros.log ] || [ -f logs.failures.log ]; then
Michele Carignani's avatar
Michele Carignani committed
35 36 37 38
	echo "Errors are found. Job failed"
	exit 1
fi