diff options
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/builds.html | 11 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/mrb_section.html | 2 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/tests.py | 40 |
3 files changed, 41 insertions, 12 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/builds.html b/bitbake/lib/toaster/toastergui/templates/builds.html index 6fbaf98ae0..566c279ddd 100644 --- a/bitbake/lib/toaster/toastergui/templates/builds.html +++ b/bitbake/lib/toaster/toastergui/templates/builds.html | |||
@@ -63,10 +63,10 @@ | |||
63 | {% include "basetable_top.html" %} | 63 | {% include "basetable_top.html" %} |
64 | <!-- Table data rows; the order needs to match the order of "tablecols" definitions; and the <td class value needs to match the tablecols clclass value for show/hide buttons to work --> | 64 | <!-- Table data rows; the order needs to match the order of "tablecols" definitions; and the <td class value needs to match the tablecols clclass value for show/hide buttons to work --> |
65 | {% for build in objects %} | 65 | {% for build in objects %} |
66 | <tr class="data"> | 66 | <tr class="data" data-table-build-result="{{ build.id }}"> |
67 | <td class="outcome"> | 67 | <td class="outcome"> |
68 | <a href="{% url "builddashboard" build.id %}">{%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}</a> | 68 | <a href="{% url "builddashboard" build.id %}">{%if build.outcome == build.SUCCEEDED%}<i class="icon-ok-sign success"></i>{%elif build.outcome == build.FAILED%}<i class="icon-minus-sign error"></i>{%else%}{%endif%}</a> |
69 | </td> | 69 | </td> |
70 | <td class="target"> | 70 | <td class="target"> |
71 | {% for t in build.target_set.all %} | 71 | {% for t in build.target_set.all %} |
72 | <a href="{% url "builddashboard" build.id %}"> | 72 | <a href="{% url "builddashboard" build.id %}"> |
@@ -104,8 +104,11 @@ | |||
104 | <a href="{%url "builddashboard" build.id%}#images">{{fstypes|get_dict_value:build.id}}</a> | 104 | <a href="{%url "builddashboard" build.id%}#images">{{fstypes|get_dict_value:build.id}}</a> |
105 | {% endif %} | 105 | {% endif %} |
106 | </td> | 106 | </td> |
107 | <td> | 107 | <td class="project-name"> |
108 | <a href="{% project_url build.project %}">{{build.project.name}}</a> | 108 | <a href="{% project_url build.project %}">{{build.project.name}}</a> |
109 | {% if build.project.is_default %} | ||
110 | <i class="icon-question-sign get-help hover-help" title="" data-original-title="This project shows information about the builds you start from the command line while Toaster is running" style="visibility: hidden;"></i> | ||
111 | {% endif %} | ||
109 | </td> | 112 | </td> |
110 | </tr> | 113 | </tr> |
111 | 114 | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/mrb_section.html b/bitbake/lib/toaster/toastergui/templates/mrb_section.html index 53f40d0f14..55687a16ef 100644 --- a/bitbake/lib/toaster/toastergui/templates/mrb_section.html +++ b/bitbake/lib/toaster/toastergui/templates/mrb_section.html | |||
@@ -22,7 +22,7 @@ | |||
22 | {% endif %} | 22 | {% endif %} |
23 | <div id="latest-builds"> | 23 | <div id="latest-builds"> |
24 | {% for build in mru %} | 24 | {% for build in mru %} |
25 | <div id="build-result-{{ build.id }}" class="alert build-result {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-error{%else%}alert-info{%endif%} | 25 | <div data-latest-build-result="{{ build.id }}" class="alert build-result {%if build.outcome == build.SUCCEEDED%}alert-success{%elif build.outcome == build.FAILED%}alert-error{%else%}alert-info{%endif%} |
26 | {% if mrb_type != 'project' %} | 26 | {% if mrb_type != 'project' %} |
27 | project-name"> | 27 | project-name"> |
28 | <span class="label {%if build.outcome == build.SUCCEEDED%}label-success{%elif build.outcome == build.FAILED%}label-important{%else%}label-info{%endif%}"> | 28 | <span class="label {%if build.outcome == build.SUCCEEDED%}label-success{%elif build.outcome == build.FAILED%}label-important{%else%}label-info{%endif%}"> |
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py index 4b93415e1e..69bbfd43e4 100644 --- a/bitbake/lib/toaster/toastergui/tests.py +++ b/bitbake/lib/toaster/toastergui/tests.py | |||
@@ -760,7 +760,7 @@ class AllBuildsPageTests(TestCase): | |||
760 | """ Task should be shown as suffix on build name """ | 760 | """ Task should be shown as suffix on build name """ |
761 | build = Build.objects.create(**self.project1_build_success) | 761 | build = Build.objects.create(**self.project1_build_success) |
762 | Target.objects.create(build=build, target='bash', task='clean') | 762 | Target.objects.create(build=build, target='bash', task='clean') |
763 | url = reverse("all-builds") | 763 | url = reverse('all-builds') |
764 | response = self.client.get(url, follow=True) | 764 | response = self.client.get(url, follow=True) |
765 | result = re.findall('bash:clean', response.content, re.MULTILINE) | 765 | result = re.findall('bash:clean', response.content, re.MULTILINE) |
766 | self.assertEqual(len(result), 3) | 766 | self.assertEqual(len(result), 3) |
@@ -768,20 +768,48 @@ class AllBuildsPageTests(TestCase): | |||
768 | def test_no_run_again_for_cli_build(self): | 768 | def test_no_run_again_for_cli_build(self): |
769 | """ "Run again" button should not be shown for command-line builds """ | 769 | """ "Run again" button should not be shown for command-line builds """ |
770 | build = Build.objects.create(**self.default_project_build_success) | 770 | build = Build.objects.create(**self.default_project_build_success) |
771 | url = reverse("all-builds") | 771 | url = reverse('all-builds') |
772 | response = self.client.get(url, follow=True) | 772 | response = self.client.get(url, follow=True) |
773 | soup = BeautifulSoup(response.content) | 773 | soup = BeautifulSoup(response.content) |
774 | 774 | ||
775 | element_id = 'build-result-%d' % build.id | 775 | attrs = {'data-latest-build-result': build.id} |
776 | result = soup.find('div', attrs=attrs) | ||
776 | 777 | ||
777 | # shouldn't see a run again button for command-line builds | 778 | # shouldn't see a run again button for command-line builds |
778 | run_again_button = soup.select('#%s button' % element_id) | 779 | run_again_button = result.select('button') |
779 | self.assertEqual(len(run_again_button), 0) | 780 | self.assertEqual(len(run_again_button), 0) |
780 | 781 | ||
781 | # should see a help icon for command-line builds | 782 | # should see a help icon for command-line builds |
782 | help_icon = soup.select('#%s i.get-help-green' % element_id) | 783 | help_icon = result.select('i.get-help-green') |
783 | self.assertEqual(len(help_icon), 1) | 784 | self.assertEqual(len(help_icon), 1) |
784 | 785 | ||
786 | def test_tooltips_on_project_name(self): | ||
787 | """ | ||
788 | A tooltip should be present next to the command line | ||
789 | builds project name in the all builds page, but not for | ||
790 | other projects | ||
791 | """ | ||
792 | build1 = Build.objects.create(**self.project1_build_success) | ||
793 | default_build = Build.objects.create(**self.default_project_build_success) | ||
794 | |||
795 | url = reverse('all-builds') | ||
796 | response = self.client.get(url, follow=True) | ||
797 | soup = BeautifulSoup(response.content) | ||
798 | |||
799 | # no help icon on non-default project name | ||
800 | result = soup.find('tr', attrs={'data-table-build-result': build1.id}) | ||
801 | name = result.select('td.project-name')[0] | ||
802 | icons = name.select('i.get-help') | ||
803 | self.assertEqual(len(icons), 0, | ||
804 | 'should not be a help icon for non-cli builds name') | ||
805 | |||
806 | # help icon on default project name | ||
807 | result = soup.find('tr', attrs={'data-table-build-result': default_build.id}) | ||
808 | name = result.select('td.project-name')[0] | ||
809 | icons = name.select('i.get-help') | ||
810 | self.assertEqual(len(icons), 1, | ||
811 | 'should be a help icon for cli builds name') | ||
812 | |||
785 | class ProjectPageTests(TestCase): | 813 | class ProjectPageTests(TestCase): |
786 | """ Test project data at /project/X/ is displayed correctly """ | 814 | """ Test project data at /project/X/ is displayed correctly """ |
787 | CLI_BUILDS_PROJECT_NAME = 'Command line builds' | 815 | CLI_BUILDS_PROJECT_NAME = 'Command line builds' |
@@ -811,5 +839,3 @@ class ProjectPageTests(TestCase): | |||
811 | response = self.client.get(url, follow=True) | 839 | response = self.client.get(url, follow=True) |
812 | 840 | ||
813 | self.assertEqual(response.status_code, 200) | 841 | self.assertEqual(response.status_code, 200) |
814 | |||
815 | |||