Bug 686357 - don't create files outside of TPS' virtualenv, r=rnewman, a=testonly, DONTBUILD
authorJonathan Griffin <jgriffin@mozilla.com>
Tue, 13 Sep 2011 16:24:27 -0700
changeset 77259 272a1113b4d173fe51d162db21d3f784ed4c603b
parent 77258 384a64b6afe1b68fa409973da2eb69f7beef82c0
child 77260 eef6577442273c6c60fa3f122d569afe6d580ba5
push id21190
push userpweitershausen@mozilla.com
push dateWed, 21 Sep 2011 19:55:51 +0000
treeherdermozilla-central@50b36274e689 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman, testonly, DONTBUILD
bugs686357
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 686357 - don't create files outside of TPS' virtualenv, r=rnewman, a=testonly, DONTBUILD
testing/tps/INSTALL.sh
testing/tps/tps/testrunner.py
--- a/testing/tps/INSTALL.sh
+++ b/testing/tps/INSTALL.sh
@@ -52,16 +52,21 @@ then
     echo "virtualenv wasn't installed correctly, aborting"
     exit 1
 fi
 
 # install TPS
 cd ${CWD}
 python setup.py install
 
+# clean up files created by setup.py
+rm -rf build/
+rm -rf dist/
+rm -rf tps.egg-info/
+
 if [ "$?" -gt 0 ]
 then
   exit 1
 fi
 
 CONFIG="`find ${VIRTUAL_ENV} -name config.json.in`"
 NEWCONFIG=${CONFIG:0:${#CONFIG}-3}
 
--- a/testing/tps/tps/testrunner.py
+++ b/testing/tps/tps/testrunner.py
@@ -164,41 +164,16 @@ class TPSTestRunner(object):
       zip.write(os.path.join(rootDir, dir), dir)
     except:
       # on some OS's, adding directory entries doesn't seem to work
       pass
     for root, dirs, files in os.walk(os.path.join(rootDir, dir)):
       for f in files:
         zip.write(os.path.join(root, f), os.path.join(dir, f))
 
-  def make_xpi(self):
-    """Build the test extension."""
-
-    tpsdir = os.path.join(self.extensionDir, "tps")
-
-    if self.tpsxpi is None:
-      tpsxpi = os.path.join(tpsdir, "tps.xpi")
-
-      if os.access(tpsxpi, os.F_OK):
-        os.remove(tpsxpi)
-      if not os.access(os.path.join(tpsdir, "install.rdf"), os.F_OK):
-        raise Exception("extension code not found in %s" % tpsdir)
-
-      from zipfile import ZipFile
-      z = ZipFile(tpsxpi, 'w')
-      self._zip_add_file(z, 'chrome.manifest', tpsdir)
-      self._zip_add_file(z, 'install.rdf', tpsdir)
-      self._zip_add_dir(z, 'components', tpsdir)
-      self._zip_add_dir(z, 'modules', tpsdir)
-      z.close()
-
-      self.tpsxpi = tpsxpi
-
-    return self.tpsxpi
-
   def run_single_test(self, testdir, testname):
     testpath = os.path.join(testdir, testname)
     self.log("Running test %s\n" % testname)
 
     # Create a random account suffix that is used when creating test
     # accounts on a staging server.
     account_suffix = {"account-suffix": ''.join([str(random.randint(0,9))
                                                  for i in range(1,6)])}
@@ -400,17 +375,17 @@ class TPSTestRunner(object):
     if platform.uname()[0].find("Win") > -1:
       os_string = "Windows " + platform.uname()[3]
 
     # reset number of passed/failed tests
     self.numpassed = 0
     self.numfailed = 0
 
     # build our tps.xpi extension
-    self.extensions.append(self.make_xpi())
+    self.extensions.append(os.path.join(self.extensionDir, 'tps'))
     self.extensions.append(os.path.join(self.extensionDir, "mozmill"))
 
     # build the test list
     try:
       f = open(self.testfile)
       jsondata = f.read()
       f.close()
       testfiles = json.loads(jsondata)