Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id D97A6E00C3C; Tue, 6 Oct 2015 04:22:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.115 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 3C3F8E00D98 for ; Tue, 6 Oct 2015 04:21:43 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 06 Oct 2015 04:21:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,643,1437462000"; d="scan'208";a="820419361" Received: from blynch-mobl1.ger.corp.intel.com (HELO lp.ger.corp.intel.com) ([10.252.3.31]) by orsmga002.jf.intel.com with ESMTP; 06 Oct 2015 04:21:41 -0700 From: Elliot Smith To: toaster@yoctoproject.org Date: Tue, 6 Oct 2015 12:21:17 +0100 Message-Id: <1444130481-25705-9-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1444130481-25705-1-git-send-email-elliot.smith@intel.com> References: <1444130481-25705-1-git-send-email-elliot.smith@intel.com> Subject: [review-request][PATCH 06/10] toaster: Show tooltip next to cli builds project name in all builds X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2015 11:22:06 -0000 In the all builds page, show an icon with tooltip next to the command line builds project name. [YOCTO #8231] Signed-off-by: Elliot Smith --- .../lib/toaster/toastergui/templates/builds.html | 11 ++++--- .../toaster/toastergui/templates/mrb_section.html | 2 +- bitbake/lib/toaster/toastergui/tests.py | 37 +++++++++++++++++++--- 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/templates/builds.html b/bitbake/lib/toaster/toastergui/templates/builds.html index 6fbaf98..566c279 100644 --- a/bitbake/lib/toaster/toastergui/templates/builds.html +++ b/bitbake/lib/toaster/toastergui/templates/builds.html @@ -63,10 +63,10 @@ {% include "basetable_top.html" %} {% for build in objects %} - + - {%if build.outcome == build.SUCCEEDED%}{%elif build.outcome == build.FAILED%}{%else%}{%endif%}   - + {%if build.outcome == build.SUCCEEDED%}{%elif build.outcome == build.FAILED%}{%else%}{%endif%}   + {% for t in build.target_set.all %} @@ -104,8 +104,11 @@ {{fstypes|get_dict_value:build.id}} {% endif %} - + {{build.project.name}} + {% if build.project.is_default %} + + {% endif %} diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html index 53f40d0..55687a1 100644 --- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html +++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html @@ -22,7 +22,7 @@ {% endif %}
{% for build in mru %} -
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py index 0d56ab2..1e67d1a 100644 --- a/bitbake/lib/toaster/toastergui/tests.py +++ b/bitbake/lib/toaster/toastergui/tests.py @@ -760,7 +760,7 @@ class AllBuildsPageTests(TestCase): """ Task should be shown as suffix on build name """ build = Build.objects.create(**self.project1_build_success) Target.objects.create(build=build, target='bash', task='clean') - url = reverse("all-builds") + url = reverse('all-builds') response = self.client.get(url, follow=True) result = re.findall('bash:clean', response.content, re.MULTILINE) self.assertEqual(len(result), 3) @@ -768,17 +768,44 @@ class AllBuildsPageTests(TestCase): def test_no_run_again_for_cli_build(self): """ "Run again" button should not be shown for command-line builds """ build = Build.objects.create(**self.default_project_build_success) - url = reverse("all-builds") + url = reverse('all-builds') response = self.client.get(url, follow=True) soup = BeautifulSoup(response.content) - element_id = 'build-result-%d' % build.id + attrs = {'data-latest-build-result': build.id} + result = soup.find('div', attrs=attrs) # shouldn't see a run again button for command-line builds - run_again_button = soup.select('#%s button' % element_id) + run_again_button = result.select('button') self.assertEqual(len(run_again_button), 0) # should see a help icon for command-line builds - help_icon = soup.select('#%s i.get-help-green' % element_id) + help_icon = result.select('i.get-help-green') self.assertEqual(len(help_icon), 1) + def test_tooltips_on_project_name(self): + """ + A tooltip should be present next to the command line + builds project name in the all builds page, but not for + other projects + """ + build1 = Build.objects.create(**self.project1_build_success) + default_build = Build.objects.create(**self.default_project_build_success) + + url = reverse('all-builds') + response = self.client.get(url, follow=True) + soup = BeautifulSoup(response.content) + + # no help icon on non-default project name + result = soup.find('tr', attrs={'data-table-build-result': build1.id}) + name = result.select('td.project-name')[0] + icons = name.select('i.get-help') + self.assertEqual(len(icons), 0, + 'should not be a help icon for non-cli builds name') + + # help icon on default project name + result = soup.find('tr', attrs={'data-table-build-result': default_build.id}) + name = result.select('td.project-name')[0] + icons = name.select('i.get-help') + self.assertEqual(len(icons), 1, + 'should be a help icon for cli builds name') -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.