[Toaster] Usage of already cloned layers in toaster
sujith h
sujith.h at gmail.com
Fri Jul 31 06:06:55 PDT 2015
On Wed, Jul 29, 2015 at 8:09 PM, sujith h <sujith.h at gmail.com> wrote:
>
>
> On Wed, Jul 29, 2015 at 12:21 AM, Michael Wood <michael.g.wood at intel.com>
> wrote:
>
>> On 27/07/15 16:23, sujith h wrote:
>>
>>>
>>>
>>> On Mon, Jul 27, 2015 at 6:55 PM, Michael Wood <michael.g.wood at intel.com
>>> <mailto:michael.g.wood at intel.com>> wrote:
>>>
>>> On 27/07/15 11:31, sujith h wrote:
>>>
>>>
>>>
>>> On Mon, Jul 27, 2015 at 3:39 PM, Barros Pena, Belen
>>> <belen.barros.pena at intel.com
>>> <mailto:belen.barros.pena at intel.com>
>>> <mailto:belen.barros.pena at intel.com
>>> <mailto:belen.barros.pena at intel.com>>> wrote:
>>>
>>>
>>>
>>> On 27/07/2015 07:54, "sujith h" <sujith.h at gmail.com
>>> <mailto:sujith.h at gmail.com>
>>> <mailto:sujith.h at gmail.com <mailto:sujith.h at gmail.com>>>
>>> wrote:
>>>
>>> >
>>> >
>>> >On Fri, Jul 24, 2015 at 6:36 PM, Barros Pena, Belen
>>> ><belen.barros.pena at intel.com
>>> <mailto:belen.barros.pena at intel.com>
>>> <mailto:belen.barros.pena at intel.com
>>> <mailto:belen.barros.pena at intel.com>>> wrote:
>>> >
>>> >
>>> >
>>> >On 24/07/2015 13:57, "sujith h" <sujith.h at gmail.com
>>> <mailto:sujith.h at gmail.com>
>>> <mailto:sujith.h at gmail.com <mailto:sujith.h at gmail.com>>>
>>>
>>> wrote:
>>> >
>>> >
>>> >* Which version of Yocto Project you are using (fido or
>>> master)?
>>> >
>>> >I am using fido branch.
>>> >
>>> >
>>> >* Which release you have selected for your project?
>>> >
>>> >
>>> >In the release I have selected "Local Yocto Project"
>>> >
>>> >
>>> >* If you click the "view all compatible layers" link and
>>> in that
>>> page you
>>> >search for meta-oe, do you get any results?
>>> >
>>> >I can see only "meta-yocto-bsp", "meta-yocto" and
>>> "openembedded-core".
>>> >Attached screenshot of the same.
>>> >
>>> >
>>> >Also attaching screenshot of page where I try to import
>>> meta-oe
>>> from my
>>> >locally cloned location.
>>> >
>>> >
>>> >Below is the file structure I have:
>>> >
>>> >sujith at kdekid:~/MEL/homework$ pwd
>>> >/home/sujith/MEL/homework
>>> >sujith at kdekid:~/MEL/homework$ ls -l
>>> >total 5180
>>> >drwxrwxr-x 19 sujith sujith 4096 Jun 12 18:40
>>> meta-oe-local
>>> >drwxrwxr-x 19 sujith sujith 4096 Jul 24 18:04
>>> meta-openembedded-local
>>> >drwxrwxr-x 8 sujith sujith 4096 Jul 24 18:02
>>> meta-qt5-local
>>> >drwxrwxr-x 11 sujith sujith 4096 Jul 27 12:07 poky
>>> >drwxrwxr-x 2 sujith sujith 4096 Jul 27 12:08
>>> toaster_build_artifacts
>>> >-rw-r--r-- 1 sujith sujith 5277696 Jul 27 12:19
>>> toaster.sqlite
>>> >drwxrwxr-x 6 sujith sujith 4096 Jul 24 16:25 venv
>>> >sujith at kdekid:~/MEL/homework$
>>> >
>>>
>>> Right, I've managed to reproduce this. Looking at the browser
>>> console, it
>>> might be a problem with the javascript doing the layer name
>>> validation. If
>>> you change the layer name to something completely random
>>> that does not
>>> exist in the Toaster database (something like meta-xyz),
>>> can you
>>> import
>>> the layer?
>>>
>>>
>>> Am bit new to the web world. So I gave a try with firebug to
>>> debug which script ( Javascript or any ) call happens
>>> when I click "Import and add to project" button. Even after
>>> changing meta-oe repo to meta-xyz as per suggestion,
>>> the result remains same. But this is the output I see in the
>>> firebug console:
>>> |{"current_id": 5, "current_url":
>>> "git://git.openembedded.org/meta-openembedded
>>> <http://git.openembedded.org/meta-openembedded>
>>> <http://git.openembedded.org/meta-openembedded>", "error":
>>> "hint-layer-exists-with-different-url"||}|
>>> hint-layer-exists-with-different-url
>>>
>>> Also attaching the screenshot of the same ( to get more clarity
>>> ).
>>>
>>>
>>> Thanks for this, I noticed this wasn't working properly last week,
>>> and rolled a couple of patches to fix these regressions.
>>>
>>>
>>>
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=0181c56dd608427c0a7bd986df75bf7a1189e064
>>>
>>> and
>>>
>>>
>>>
>>> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=michaelw/toaster/wip-nav-project-changes&id=aa5b023f03f5465ea22318a1f21199ce434eb700
>>>
>>> I have a few other things to fix on this branch as I have been
>>> fixing a number of things to allow me to test the new project
>>> page, I'm intending to roll a separate branch for review on it.
>>>
>>> You've highlighted that we need a unit test which does a layer
>>> import using the back end API calls, which although it wouldn't
>>> have caught this error would be really good to have, if you're
>>> interested in helping with that?
>>>
>>>
>>> It would be my pleasure to help :) I might need some assistance as I am
>>> learning Django. May be some hint like where to start with or so.
>>>
>>>
>> This is the best place to start
>> https://docs.djangoproject.com/en/1.6/topics/testing/overview/
>>
>> In ./bitbake <
>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake>/lib <
>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib>/toaster
>> <https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster>/toastergui
>> <
>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui>/tests.py
>> <
>> https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/toaster/toastergui/tests.py
>> >
>>
>> We can add something like
>>
>> class ImportLayerTestCase(|ProvisionedLayersProjectTestCase|):
>> ....
>> ...
>> def test_import_layer(self):
>> client.post(reverse('xhr_importlayer',.....
>>
>> ...
>>
>> We can then use the JSON response from the client to help validate the
>> data coming back as well as checking the import layer actually entered the
>> database.
>>
>> There are a few examples in the yocto error-report-web project too that
>> might be useful to look at e.g.
>>
>> http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153
>> <
>> http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/tree/Post/test.py#n153
>> >
>>
>> You can run the test by doing running ./manage.py test toastergui
>>
>>
> Thank you Michael for such a detailed step to follow. I have started
> reading the docs from django mentioned in the link and the reference
> mentioned in the mail.
>
I wrote a small piece of code in bitbake/lib/toaster/toastergui/tests.py.
Below is the code ( since I have written a small code, I thought to share
here. Kindly let me know if there is any problem sharing small code in the
mailing list ):
----------
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
import json
class ImportLayerTestCase(TestCase):
def test_import_layers(self):
client = Client()
json_string = json.dumps({'name':'meta-oe',
'vcs-url':'/home/sujith/MEL/homework/meta-xyz',
'git_ref':'c12b9596afd236116b25ce26dbe0d793de9dc7ce',
'dir_path':'/home/sujith/MEL/homework/meta-xyz/meta-oe',
'project_id':'1', 'layer_deps':'1'})
response = client.post(reverse('xhr_importlayer'),
{'data':json_string},
'json',
HTTP_X_REQUESTED_WITH='XMLHttpRequest')
-------------
Let me know if I am in the right track. After following your mail and bit
of google, helped me in writing this code. My query here is when I try to
print response, it prints an html as follows:
------------
Content-Type: text/html; charset=utf-8
<!DOCTYPE html>
<html lang="en">
<head>
<title>Toaster</title>
<link rel="stylesheet" href="/static/css/bootstrap.min.css"
type="text/css"/>
<link rel="stylesheet" href="/static/css/bootstrap-responsive.min.css"
type='text/css'/>
<link rel="stylesheet" href="/static/css/font-awesome.min.css"
type='text/css'/>
<link rel="stylesheet" href="/static/css/prettify.css" type='text/css'/>
<link rel="stylesheet" href="/static/css/default.css" type='text/css'/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<script src="/static/js/jquery-2.0.3.min.js">
</script>
<script src="/static/js/jquery.cookie.js">
</script>
<script src="/static/js/bootstrap.min.js">
</script>
<script src="/static/js/prettify.js">
</script>
<script src="/static/js/libtoaster.js">
</script>
<script>
libtoaster.debug = true;
</script>
<script src="/static/js/base.js"></script>
<script>
</script>
</head>
<body style="height: 100%">
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<a class="brand logo" href="#"><img src="/static/img/logo.png"
class="" alt="Yocto logo project"/></a>
<span class="brand">
<a href="/">Toaster</a>
<i class="icon-info-sign" title="<strong>Toaster
version information</strong>" data-content="<dl><dt>Branch</dt><dd>fido
</dd><dt>Revision</dt><dd>08d32590411568e7bf11612ac695a6e9c6df6286
</dd><dt>Mode</dt><dd>Analysis</dd></dl>"></i>
</span>
<a class="pull-right manual" target="_blank" href="
http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html">
<i class="icon-book"></i>
Toaster manual
</a>
</div>
</div>
<div class="container-fluid">
<div class="container-fluid">
<div class="row-fluid">
<!-- Empty - no build module -->
<div class="page-header top-air">
<h1>
This page only works with Toaster in 'Build' mode
</h1>
</div>
<div class="alert alert-info lead">
<p">
The 'Build' mode allows you to configure and run your Yocto Project
builds from Toaster.
<ul>
<li><a href="
http://www.yoctoproject.org/docs/latest/toaster-manual/toaster-manual.html#intro-modes
">
Read about the 'Build' mode
</a></li>
<li><a href="/">
View your builds
</a></li>
</ul>
</p>
</div>
</div>
</div>
</body>
</html>
------------
My query here is whether the arguments passed to client.post is correct?
And if so any hint how to use this response to get the error which we were
getting from importlayer.js?
Sorry if my query is really stupid :)
Thanks,
Sujith H
--
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/toaster/attachments/20150731/b3f7f06e/attachment-0001.html>
More information about the toaster
mailing list