CSIT-919: Jenkins job 59/11359/1
authorTibor Frank <tifrank@cisco.com>
Mon, 26 Mar 2018 09:02:54 +0000 (11:02 +0200)
committerTibor Frank <tifrank@cisco.com>
Mon, 26 Mar 2018 09:02:54 +0000 (11:02 +0200)
Change-Id: I8ed4a8e135ebbebc7799a633872a50293eb410af
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/generator_CPTA.py
resources/tools/presentation/pal.py
resources/tools/presentation/run_cpta.sh

index 8ae0662..bca5535 100644 (file)
@@ -462,9 +462,8 @@ def _generate_all_charts(spec, input_data):
             result = "PASS"
         elif item == 0.33 or item == 0.0:
             result = "FAIL"
-    print(results)
-    print(result)
-    if result == "FAIL":
-        return 1
-    else:
-        return 0
+
+    logging.info("Partial results: {0}".format(results))
+    logging.info("Result: {0}".format(result))
+
+    return result
index 85b7bbc..98642c8 100644 (file)
@@ -86,7 +86,7 @@ def main():
         logging.critical("Finished with error.")
         return 1
 
-    ret_code = 1
+    ret_code = 0
     try:
         env = Environment(spec.environment, args.force)
         env.set_environment()
@@ -109,9 +109,8 @@ def main():
         if spec.output["output"] == "report":
             generate_report(args.release, spec)
             logging.info("Successfully finished.")
-            ret_code = 0
         elif spec.output["output"] == "CPTA":
-            ret_code = generate_cpta(spec, data)
+            sys.stdout.write(generate_cpta(spec, data))
             logging.info("Successfully finished.")
         else:
             logging.critical("The output '{0}' is not supported.".
index 081becf..954f17d 100755 (executable)
@@ -24,13 +24,11 @@ pip install -r requirements.txt
 
 export PYTHONPATH=`pwd`
 
-python pal.py \
+STATUS=$(python pal.py \
     --specification specification_CPTA.yaml \
     --logging INFO \
-    --force
+    --force)
 RETURN_STATUS=$?
 
-rm -rf ${DIR[WORKING]}
-
-echo ${RETURN_STATUS}
+echo ${STATUS}
 exit ${RETURN_STATUS}