From e7e29543ddd6df23faa6e0630e963320eedf4e40 Mon Sep 17 00:00:00 2001
From: madiot <madiot@localhost>
Date: Wed, 27 Jan 2010 09:14:32 +0000
Subject: [PATCH] fix related to code coverage with EMMA - serialize the startDS in the tools function startservers to avoid emma.properties generated file to overwrite each other - skip the kill on OpenDS processes to avoid potential unexpected behaviour with code coverage - generating a new Emma coverage.ec statistics file for each start of any given OpenDS instance

---
 opends/tests/staf-tests/shared/functions/utils.xml |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/opends/tests/staf-tests/shared/functions/utils.xml b/opends/tests/staf-tests/shared/functions/utils.xml
index d19f160..933bd79 100755
--- a/opends/tests/staf-tests/shared/functions/utils.xml
+++ b/opends/tests/staf-tests/shared/functions/utils.xml
@@ -1145,7 +1145,7 @@
         <sequence>
           <script>
             coveragePath=os.path.join(LOGS_ROOT,'coverage')
-            coverageEm=os.path.join(coveragePath,'coverage.em')
+            coverageEm=os.path.join(DIRECTORY_INSTANCE_DIR,OPENDSNAME,'coverage.em')
             ecPath=os.path.join(coveragePath,CurrentTestPath['group'])
             coverageEcs=[ os.path.join(ecPath,ec) for ec in os.listdir(ecPath) if ec.startswith('coverage') and ec.endswith('.ec')]
             coverageFiles=','.join(coverageEcs)
@@ -1969,13 +1969,18 @@
           pid = STAXResult[:-1]
           _args = '-9 %s' % pid
       </script>
-      <call function="'runCommand'">
-        { 'name'      : 'Kill DS server',
-          'location'  : location,
-          'command'   : _cmd,
-          'arguments' : _args
-        }
-      </call>
+      <if expr="os.path.exists(os.path.join(dsPath,'lib','emma.jar')) == False">
+        <call function="'runCommand'">
+          { 'name'      : 'Kill DS server',
+            'location'  : location,
+            'command'   : _cmd,
+            'arguments' : _args
+          }
+        </call>
+        <else>
+          <message>'skip the killing of process when running with coverage to avoid data corruption'</message>
+        </else>
+      </if>
       <return>STAXResult</return>        
     </sequence>
   </function>

--
Gitblit v1.10.0