You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/07/16 22:17:21 UTC
[20/27] git commit: [#6277] make forgeuserstats tmp repos not
conflict with forgegit
[#6277] make forgeuserstats tmp repos not conflict with forgegit
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/d2a60bbb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/d2a60bbb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/d2a60bbb
Branch: refs/heads/cj/4656
Commit: d2a60bbbf547798b74a42ee87d68b6a26480a373
Parents: 3ec3fed
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Tue May 28 10:32:26 2013 -0400
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Jul 11 22:10:00 2013 +0000
----------------------------------------------------------------------
ForgeUserStats/forgeuserstats/tests/test_model.py | 5 +++--
ForgeUserStats/forgeuserstats/tests/test_stats.py | 8 ++++++--
run_tests | 4 ++++
3 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d2a60bbb/ForgeUserStats/forgeuserstats/tests/test_model.py
----------------------------------------------------------------------
diff --git a/ForgeUserStats/forgeuserstats/tests/test_model.py b/ForgeUserStats/forgeuserstats/tests/test_model.py
index 2203469..6940385 100644
--- a/ForgeUserStats/forgeuserstats/tests/test_model.py
+++ b/ForgeUserStats/forgeuserstats/tests/test_model.py
@@ -29,10 +29,11 @@ from allura.model import User, Project, TroveCategory
from allura.lib import helpers as h
from allura import model as M
-from forgegit.tests import with_git
-
from forgeuserstats.model import stats as USM
+test_project_with_repo = 'test2' # important to be distinct from 'test' which ForgeGit uses, so that the tests can run in parallel and not clobber each other
+with_git = td.with_tool(test_project_with_repo, 'Git', 'src-git', 'Git', type='git')
+
class TestUserStats(unittest.TestCase):
def setUp(self):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d2a60bbb/ForgeUserStats/forgeuserstats/tests/test_stats.py
----------------------------------------------------------------------
diff --git a/ForgeUserStats/forgeuserstats/tests/test_stats.py b/ForgeUserStats/forgeuserstats/tests/test_stats.py
index b2b20ce..bbb43f5 100644
--- a/ForgeUserStats/forgeuserstats/tests/test_stats.py
+++ b/ForgeUserStats/forgeuserstats/tests/test_stats.py
@@ -27,10 +27,14 @@ from allura.lib import helpers as h
from allura.model import User
from allura import model as M
-from forgegit.tests import with_git
from forgewiki import model as WM
from forgetracker import model as TM
+
+test_project_with_repo = 'test2' # important to be distinct from 'test' which ForgeGit uses, so that the tests can run in parallel and not clobber each other
+with_git = td.with_tool(test_project_with_repo, 'Git', 'src-git', 'Git', type='git')
+
+
class TestStats(TestController):
def setUp(self):
@@ -185,7 +189,7 @@ class TestGitCommit(TestController, unittest.TestCase):
@td.with_wiki
def setup_with_tools(self):
setup_global_objects()
- h.set_context('test', 'src-git', neighborhood='Projects')
+ h.set_context(test_project_with_repo, 'src-git', neighborhood='Projects')
repo_dir = pkg_resources.resource_filename(
'forgeuserstats', 'tests/data')
c.app.repo.fs_path = repo_dir
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d2a60bbb/run_tests
----------------------------------------------------------------------
diff --git a/run_tests b/run_tests
index 7d033b1..a85aefe 100755
--- a/run_tests
+++ b/run_tests
@@ -29,6 +29,8 @@ import textwrap
def run_one(cmd, **popen_kwargs):
print '{} running {} {}'.format(threading.current_thread(), cmd, popen_kwargs)
+ sys.stdout.flush()
+
all_popen_kwargs = dict(shell=True, stderr=subprocess.STDOUT,
stdout=subprocess.PIPE,
bufsize=1, # 1 == line-buffered
@@ -43,6 +45,8 @@ def run_one(cmd, **popen_kwargs):
out_remainder, _ = proc.communicate()
sys.stdout.write(out_remainder)
sys.stdout.flush()
+ print 'finished {} {}'.format(cmd, popen_kwargs)
+ sys.stdout.flush()
return proc