From 69bbebb99a3a9ac74c34f15de32c0e53bf1d81a5 Mon Sep 17 00:00:00 2001
From: Kevin Duret <duret.kevin@gmail.com>
Date: Tue, 20 Mar 2018 10:26:45 +0100
Subject: [PATCH] test(acceptance): add log file to clapi acceptance test
 (#6151)

---
 features/bootstrap/ClapiContext.php | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/features/bootstrap/ClapiContext.php b/features/bootstrap/ClapiContext.php
index ba4e9c3b07..06dadb223f 100644
--- a/features/bootstrap/ClapiContext.php
+++ b/features/bootstrap/ClapiContext.php
@@ -78,6 +78,15 @@ class ClapiContext extends CentreonContext
         $fileCompare = trim(file_get_contents($this->file['compare'], FILE_USE_INCLUDE_PATH));
 
         if ($fileLocal != $fileCompare) {
+            exec(
+                'diff ' . $this->file['localpath'] . ' ' . $this->file['compare'],
+                $output
+            );
+            file_put_contents(
+                $this->composeFiles['log_directory'] . '/' .
+                    date('Y-m-d-H-i') . '-diffClapi.txt',
+                implode("\n", $output)
+            );
             throw new \Exception('Configuration not imported');
         }
     }
-- 
GitLab