# HG changeset patch
# User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
# Date 1594376303 -7200
#      Fri Jul 10 12:18:23 2020 +0200
# Node ID 91e5e5e43bcb1d47a430a1184e8f36f7c13c3097
# Parent  72b01d6caa010a0c2e61e31a8e02a70cb4666956
✨ add metrics file

diff --git a/NEWS.rst b/NEWS.rst
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -11,6 +11,8 @@
 
 Change failure and error detection in ``run_tests``.
 
+run_tests: Add metrics when running in CI.
+
 3.2
 ---
 
diff --git a/run_tests b/run_tests
--- a/run_tests
+++ b/run_tests
@@ -61,6 +61,11 @@
 then
     tests_errors=0
 fi
+# create a metrics file
+if [ -n "$CI" ];
+then
+    echo "odoo_scripts_tests_ran $tests_ran\nodoo_scripts_tests_failures $tests_failures\nodoo_scripts_tests_error $tests_error" > metrics
+fi
 if [ $ODOO_TYPE != 'odoo13' ];
 then
     ok=$(grep ' OK' $logfile -c)