From 0c6d1cad302f8af566352ed674bc62e81024b18f Mon Sep 17 00:00:00 2001 From: Elian Kraja Date: Fri, 19 Jul 2019 17:06:24 +0200 Subject: [PATCH] Adding validation scripts --- requirements.txt | 1 + scripts/launch-validation.sh | 8 ++++++++ scripts/run-all.bash | 14 ++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 scripts/launch-validation.sh create mode 100644 scripts/run-all.bash diff --git a/requirements.txt b/requirements.txt index c92df1b..2c8b44f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,4 @@ RESTinstance==1.0.0rc4 robotframework-dependencylibrary==1.0.0.post1 robotframework-jsonlibrary==0.3 robotframework-jsonschemalibrary==1.0 +robotframework-requests==0.5.0 diff --git a/scripts/launch-validation.sh b/scripts/launch-validation.sh new file mode 100644 index 0000000..5903057 --- /dev/null +++ b/scripts/launch-validation.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +echo "Starting check on ROBOT CODE" + +for FILE in $(find . -name "*.robot"); do + echo "Syntax check on ${FILE}" + robot --dryrun -d /tmp ${FILE} +done diff --git a/scripts/run-all.bash b/scripts/run-all.bash new file mode 100644 index 0000000..75eef6b --- /dev/null +++ b/scripts/run-all.bash @@ -0,0 +1,14 @@ +#!/bin/bash + +## Launch robot tests validator + +/bin/bash /scripts/launch-validation.sh > logs/robot_stdout.log 2> logs/robot_stderr.log + +## 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 -- GitLab