From 6d4cd91fdbf7adb92d1fd5f5d70b95dee4632cb0 Mon Sep 17 00:00:00 2001
From: david_williams <david_williams>
Date: Fri, 6 Aug 2010 20:07:51 +0000
Subject: [PATCH] 303564 -  Run performance tests against the WTP

---
 .../wtp.tests/testScripts/perftest.xml        |  6 +--
 .../wtp.tests/testScripts/test.xml            |  2 +-
 .../scripts/standaloneTest/runtest.bat        | 47 +++++++++----------
 .../standaloneTest/standalonePerfTest.xml     |  2 +
 .../scripts/standaloneTest/standaloneTest.xml |  2 +
 5 files changed, 31 insertions(+), 28 deletions(-)

diff --git a/releng.wtpbuilder/distribution/wtp.tests/testScripts/perftest.xml b/releng.wtpbuilder/distribution/wtp.tests/testScripts/perftest.xml
index 59c2feac4..42d149bd4 100644
--- a/releng.wtpbuilder/distribution/wtp.tests/testScripts/perftest.xml
+++ b/releng.wtpbuilder/distribution/wtp.tests/testScripts/perftest.xml
@@ -54,7 +54,7 @@
     <!-- TODO: The framework apps might need this. But we should elmimnate if posslbe. -->
     <property
         name="eclipse-home"
-        value="${testRoot}"/>
+        value="${testRoot}/eclipse"/>
     <!--
         The directory that will contain the xml and html results from
         the tests that are run
@@ -99,7 +99,7 @@
 	            inheritall="true"
 	            failonerror="false">
 	            <fileset
-	                dir="${eclipse-home}/eclipse/plugins/">
+	                dir="${eclipse-home}/">
 	                <include
 	                    name="**/test.xml"/>
 	            </fileset>
@@ -135,7 +135,7 @@
             target="performance"
             inheritall="true">
             <fileset
-                dir="${eclipse-home}/plugins/">
+                dir="${eclipse-home}/">
                 <include
                     name="**/${testBundle}*/test.xml"/>
             </fileset>
diff --git a/releng.wtpbuilder/distribution/wtp.tests/testScripts/test.xml b/releng.wtpbuilder/distribution/wtp.tests/testScripts/test.xml
index 6c0def08e..12b215d33 100644
--- a/releng.wtpbuilder/distribution/wtp.tests/testScripts/test.xml
+++ b/releng.wtpbuilder/distribution/wtp.tests/testScripts/test.xml
@@ -146,7 +146,7 @@
             target=""
             inheritall="true">
             <fileset
-                dir="${eclipse-home}/plugins/">
+                dir="${eclipse-home}/">
                 <exclude
                     name="**/*performance*/test.xml"/>
                 <include
diff --git a/releng.wtpbuilder/scripts/standaloneTest/runtest.bat b/releng.wtpbuilder/scripts/standaloneTest/runtest.bat
index d7da3053d..39d6a4136 100644
--- a/releng.wtpbuilder/scripts/standaloneTest/runtest.bat
+++ b/releng.wtpbuilder/scripts/standaloneTest/runtest.bat
@@ -1,6 +1,6 @@
 
 REM Example script to run standalone test on Windows
-REM
+REM -performance and -functional options both require releng data to be present (i.e. call with -checkout first)
 @echo off
 SETLOCAL
 
@@ -66,30 +66,34 @@ REM timestamp         Basically the "end" part of a download zip or build name,
 REM build.stream      (not sure if needed)
 REM buildBranch       Build branch used in various scripts ... usually the "middle" part of projectname, such as R3.2 in wtp-R3.2-I
 REM testTarget        The specific test suite(s) to run. These target names are from the test.xml file. Omit or use 'all' to run all tests.
+REM testBundle		  The specific plugin to test, such as org.eclipse.jst.jsp. Will run the selected tests only on that bundle.  
 REM -f antfile        The name or path should not have to be changed, but the "releng.wtpbuilder" project must already be checked out from CVS
 REM                   (or exported from Eclipse) into a directory named 'webtools.releng' which is immediately under the BUILD_HOME directory.
 REM                   It is assume this batch file, then, is in the BUILD_HOME directory.
 
-REM whatever the user chose, we're going to need the releng data, so run checkout every time
-
- echo Running standalonecheckout.xml
- call ant ^
-     -Dprojectname=wtp-R3.2.1 ^
-     -DbuildType=R ^
-     -DbuildId=3.2.1 ^
-     -Dtimestamp=20100730021206 ^
-     -DmapVersionTag=R3_2_1 ^
-     -Dbuild.stream=R3.2.1 ^
-     -DbuildBranch=R3.2.1 ^
-     -f standalonecheckout.xml 
-     
 REM check to see what the user chose. Default is help. 
 
 if x%1==x-functional goto func
-if x%1==x-both goto func
+if x%1==x-checkout goto chk
 if x%1==x-performance goto perf
 goto hlp
 
+:chk
+ echo Running standalonecheckout.xml
+call ant ^
+      -Dprojectname=wtp-R3.2.1 ^
+      -DbuildType=R ^
+      -DbuildId=3.2.1 ^
+      -Dtimestamp=20100730021206 ^
+      -DmapVersionTag=R3_2_1 ^
+      -Dbuild.stream=R3.2.1 ^
+      -DbuildBranch=R3.2.1 ^
+      -f standalonecheckout.xml 
+     
+
+goto exit
+
+
 :func
 
 echo Running standaloneTest.xml
@@ -101,11 +105,7 @@ call ant  ^
      -Dbuild.stream=R3.2.1 ^
      -DbuildBranch=R3.2.1 ^
      -f standaloneTest.xml 
-rem     -DtestBundle=org.eclipse.jst.jsp ^
-     
-
-REM Only 2 ways to get here are func or both. If func then exit, otherwise must be both, so continue to perf tests. 
-if x%1==x-functional goto exit
+goto exit
 
 :perf
 echo Running standalonePerfTest.xml
@@ -117,12 +117,11 @@ call ant  ^
      -Dbuild.stream=R3.2.1 ^
      -DbuildBranch=R3.2.1 ^
      -f standalonePerfTest.xml 
-rem -DtestBundle=org.eclipse.jst.jsp ^
+
+     
 goto exit
 
 :hlp
-echo Use -performance for performance tests, -funtional for function tests, -both for both, or anything else for this message
-echo
-echo At this time, to run the performance tests it is necessary to to manually install the eclipse test plugins to the WTP install you want to test.
+echo Use -performance for performance tests, -funtional for function tests, -checkout to (re)fetch releng data, or anything else for this message
 :exit
 ENDLOCAL
diff --git a/releng.wtpbuilder/scripts/standaloneTest/standalonePerfTest.xml b/releng.wtpbuilder/scripts/standaloneTest/standalonePerfTest.xml
index 633e04a1d..ff6202cd9 100644
--- a/releng.wtpbuilder/scripts/standaloneTest/standalonePerfTest.xml
+++ b/releng.wtpbuilder/scripts/standaloneTest/standalonePerfTest.xml
@@ -198,6 +198,8 @@
     	  depends="getDependencies">
         <mkdir
             dir="${testRoot}/results/consolelogs"/>
+    	<mkdir
+    	    dir="${testRoot}/results/xml"/>    	
         <copy
             todir="${testRoot}"
             flatten="true"
diff --git a/releng.wtpbuilder/scripts/standaloneTest/standaloneTest.xml b/releng.wtpbuilder/scripts/standaloneTest/standaloneTest.xml
index 3263ede75..58117a381 100644
--- a/releng.wtpbuilder/scripts/standaloneTest/standaloneTest.xml
+++ b/releng.wtpbuilder/scripts/standaloneTest/standaloneTest.xml
@@ -198,6 +198,8 @@
     	  depends="getDependencies">
         <mkdir
             dir="${testRoot}/results/consolelogs"/>
+    	<mkdir
+    	    dir="${testRoot}/results/xml"/>
         <copy
             todir="${testRoot}"
             flatten="true"
-- 
GitLab