#3642 Test speedup by reducing user-app installation

v1.0.0
closed
General
nobody
2015-08-20
2012-01-24
No

This gains a 30-40% speedup, based on initial test tests. I haven't tested everything, so some tests may need some user apps available -- and if not, we need to add tests that cover the user apps. Also, of course, we want to make it some sort of test config option, so that in real usage the user apps are installed.

diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 57e43d6..2cf2994 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -574,10 +574,7 @@ def configure_project(
         if users is None: users = [ c.user ]
         if apps is None:
             if is_user_project:
-                apps = [('Wiki', 'wiki', 'Wiki'),
-                        ('profile', 'profile', 'Profile'),
-                        ('admin', 'admin', 'Admin'),
-                        ('search', 'search', 'Search')]
+                apps = []
             else:
                 apps = [('admin', 'admin', 'Admin'),
                         ('search', 'search', 'Search')]
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index e66e469..e985e17 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -402,11 +402,12 @@ def register(cls, doc, make_project=True):
             p._extra_tool_status = ['user']
             # add user project informative text to home
             home_app = p.app_instance('wiki')
-            home_page = WM.Page.query.get(app_config_id=home_app.config._id)
-            home_page.text = ("This is the personal project of %s."
-            " This project is created automatically during user registration"
-            " as an easy place to store personal data that doesn't need its own"
-            " project such as cloned repositories.") % user.display_name
+            if home_app:
+                home_page = WM.Page.query.get(app_config_id=home_app.config._id)
+                home_page.text = ("This is the personal project of %s."
+                " This project is created automatically during user registration"
+                " as an easy place to store personal data that doesn't need its own"
+                " project such as cloned repositories.") % user.display_name
         return user

     def private_project(self):

Discussion

  • Dave Brondsema

    Dave Brondsema - 2012-04-19

    If this avoids writing repos to disk, then we may be one step closer to being able to run tests in parallel.

     
  • Dave Brondsema

    Dave Brondsema - 2012-04-19
    • milestone: forge-backlog --> forge-may-04
     
  • Dave Brondsema

    Dave Brondsema - 2012-04-20
    • size: --> 2
     
  • Dave Brondsema

    Dave Brondsema - 2012-04-24

    The existing diff was just for testing purposes, and is not appropriate for actual usage.

    Changes probably should be made in bootstrap.py where it already distinguishes between running under test, and for real. Passing make_project=False to M.User.register may be very useful.

     
    • status: open --> in-progress
     
    • assigned_to: Tim Van Steenburgh
     
    • status: in-progress --> code-review
    • qa: Jenny Steele
     
  • forge:tv/3642

    • Run tests. Observe ~50% speedup.
    • Run paster setup-app production.ini. Confirm /u neighborhood has user projects for the default users.
     
  • Jenny Steele - 2012-04-25
    • status: code-review --> closed
     

Log in to post a comment.