[oe-commits] [bitbake] 43/45: toaster: views jsunittest Add MACHINE and an extra layer to test project

git at git.openembedded.org git at git.openembedded.org
Wed Apr 6 22:12:01 UTC 2016


rpurdie pushed a commit to branch master
in repository bitbake.

commit a0c1432f32930a17e10d50c08c2aa84a0659514b
Author: Michael Wood <michael.g.wood at intel.com>
AuthorDate: Mon Apr 4 11:47:31 2016 +0100

    toaster: views jsunittest Add MACHINE and an extra layer to test project
    
    Add set a MACHINE if needed and add a layer. When we're running in the
    context of the django unit tests we don't have these defaults setup for
    the project so add them.
    
    Signed-off-by: Michael Wood <michael.g.wood at intel.com>
    Signed-off-by: Elliot Smith <elliot.smith at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/toaster/toastergui/views.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index 8b685ab..30295a7 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -2084,13 +2084,23 @@ if True:
 
         name = "_js_unit_test_prj_"
 
-        # If there is an existing project by this name delete it. We don't want
-        # Lots of duplicates cluttering up the projects.
+        # If there is an existing project by this name delete it.
+        # We don't want Lots of duplicates cluttering up the projects.
         Project.objects.filter(name=name).delete()
 
-        new_project = Project.objects.create_project(name=name, release=release)
+        new_project = Project.objects.create_project(name=name,
+                                                     release=release)
+        # Add a layer
+        layer = new_project.get_all_compatible_layer_versions().first()
 
-        context = { 'project' : new_project }
+        ProjectLayer.objects.get_or_create(layercommit=layer,
+                                           project=new_project)
+
+        # make sure we have a machine set for this project
+        ProjectVariable.objects.get_or_create(project=new_project,
+                                              name="MACHINE",
+                                              value="qemux86")
+        context = {'project': new_project}
         return render(request, "js-unit-tests.html", context)
 
     from django.views.decorators.csrf import csrf_exempt

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list