Skip to content
Snippets Groups Projects

BMK-137 lint validation of json files produced by python parsing scripts

Merged BMK-137 lint validation of json files produced by python parsing scripts
Merged Martina Javurkova requested to merge BMK-137 into qa
1 file
+ 9
1
Compare changes
  • Side-by-side
  • Inline
+ 9
1
@@ -396,16 +396,24 @@ cd $baseWDir
@@ -396,16 +396,24 @@ cd $baseWDir
echo -e "\n[$bmkDriver] json file validation: starting"
echo -e "\n[$bmkDriver] json file validation: starting"
json=0
json=0
jsonFile=$baseWDir/${APP}_summary.json
jsonFile=$baseWDir/${APP}_summary.json
 
jsonFile_new=$baseWDir/${APP}_summary_new.json
if [ ! -f ${jsonFile} ]; then
if [ ! -f ${jsonFile} ]; then
echo -e "[$bmkDriver] ERROR! json file '${jsonFile}' not found"
echo -e "[$bmkDriver] ERROR! json file '${jsonFile}' not found"
json=1
json=1
else
else
echo "[$bmkDriver] lint json file syntax using jq"
echo "[$bmkDriver] lint json file '${jsonFile}' syntax using jq"
if ! jq '.' -c < ${jsonFile}; then
if ! jq '.' -c < ${jsonFile}; then
echo "[$bmkDriver] json file '${jsonFile}' lint validation failed"
echo "[$bmkDriver] json file '${jsonFile}' lint validation failed"
json=1
json=1
fi
fi
fi
fi
 
if [ -f ${jsonFile_new} ]; then
 
echo "[$bmkDriver] lint json file '${jsonFile_new}' syntax using jq"
 
if ! jq '.' -c < ${jsonFile_new}; then
 
echo "[$bmkDriver] json file '${jsonFile_new}' lint validation failed"
 
json=1
 
fi
 
fi
echo -e "[$bmkDriver] json file validation: completed (status=$json)\n"
echo -e "[$bmkDriver] json file validation: completed (status=$json)\n"
# NB: This script is meant to be sourced, it does not return or exit at the end
# NB: This script is meant to be sourced, it does not return or exit at the end
Loading