Permalink
Browse files

add some first-run info for tests

  • Loading branch information...
1 parent b9c5c18 commit b14d6f505aabce7630513dca2fee1e2a961b4383 @termie committed May 8, 2011
Showing with 33 additions and 7 deletions.
  1. +10 −0 run_tests.sh
  2. +23 −7 tests/test_basic.py
View
@@ -1,2 +1,12 @@
#!/bin/sh
+if [ ! -f "run_tests.log" ];
+then
+ echo "The first time you run this will most likely take quite a while"
+ echo "as it will be checking out quite a lot of different vendor"
+ echo "packages to test against."
+ echo ""
+ echo "Running some preliminary setup in 5 seconds."
+ sleep 5
+ python run_tests.py tests.test_basic:SetupVendorOnly.setup_vendor
+fi
python run_tests.py $@ 2> run_tests.log
View
@@ -95,17 +95,14 @@ def rmdir(path):
pass
-class GitBzrTest(unittest.TestCase):
+class SetupVendorOnly(object):
BZR = BZRPATH % '2.3.1'
BZRFASTIMPORT = BZRFASTIMPORT_STABLE
- def setUp(self):
+ def setup_vendor(self):
+ logging.getLogger().setLevel(logging.INFO)
self._ensure_checkouts()
self._symlink_plugin()
- self._setup_bzr_branches()
-
- def tearDown(self):
- pass
def _symlink_plugin(self):
try:
@@ -133,6 +130,7 @@ def _ensure_checkouts(self):
tarball = 'bzr-%s.tar.gz'
for v in VERSIONS:
if not os.path.exists(BZRPATH % v[1]):
+ logging.info('Downloading %s', download_url % (v[0], v[1], v[1]))
cd(VENDOR)
check_output(['curl', '-O', '-L',
download_url % (v[0], v[1], v[1])
@@ -144,25 +142,30 @@ def _ensure_checkouts(self):
bzr_head = BZRPATH % 'head'
if not os.path.exists(bzr_head):
+ logging.info('Getting HEAD of bzr')
cd(VENDOR)
bzr('branch', 'lp:bzr', BZRPATH % 'head')
if not os.path.exists(PYFASTIMPORT):
+ logging.info('Getting a HEAD of python-fastimport')
cd(VENDOR)
bzr('branch', 'lp:python-fastimport')
if not os.path.exists(PLUGINDIR):
os.mkdir(PLUGINDIR)
if not os.path.exists(BZRFASTIMPORT_STABLE):
+ logging.info('Getting revision 307 of bzr-fastimport')
cd(VENDOR)
bzr('branch', 'lp:bzr-fastimport', '-r', '307', BZRFASTIMPORT_STABLE)
if not os.path.exists(BZRFASTIMPORT_HEAD):
+ logging.info('Getting HEAD of bzr-fastimport')
cd(VENDOR)
bzr('branch', 'lp:bzr-fastimport', BZRFASTIMPORT_HEAD)
if not os.path.exists(BZRFASTIMPORT_STABLE_TARBALL):
+ logging.info('Downloading bzr-fastimport version 0.10')
cd(VENDOR)
check_output(['curl', '-O', '-L',
'http://launchpad.net/bzr-fastimport/trunk/'
@@ -179,6 +182,20 @@ def _ensure_checkouts(self):
os.environ['BZR_PLUGIN_PATH'] = PLUGINDIR
os.environ['BZR_PDB'] = '1'
+
+class GitBzrTest(SetupVendorOnly, unittest.TestCase):
+ BZR = BZRPATH % '2.3.1'
+ BZRFASTIMPORT = BZRFASTIMPORT_STABLE
+
+ def setUp(self):
+ #SetupVendorOnly.setUp(self)
+ self._ensure_checkouts()
+ self._symlink_plugin()
+ self._setup_bzr_branches()
+
+ def tearDown(self):
+ pass
+
def _setup_bzr_branches(self):
memo = '%s_%s_%s' % (TESTDIR, self.__class__.__name__, TIMESTAMP)
if os.path.exists(memo):
@@ -214,7 +231,6 @@ def _setup_bzr_branches(self):
shutil.rmtree(path)
shutil.copytree(TESTDIR, memo)
-
def test_all(self):
"""Test most of the functionality.

0 comments on commit b14d6f5

Please sign in to comment.