diff options
author | Elliot Smith <elliot.smith@intel.com> | 2015-09-30 14:53:12 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-10-16 14:59:59 +0100 |
commit | ef6fc2bc1a4eeafdf5eda112ffb72bfed24b85d5 (patch) | |
tree | b68bc4a1d3253a2db1dbb8c15bfd3030ab74894d /bitbake/lib/toaster/toastergui/tests.py | |
parent | 7467b6802d64e12710510d8e4653da15d12d7089 (diff) | |
download | poky-ef6fc2bc1a4eeafdf5eda112ffb72bfed24b85d5.tar.gz |
bitbake: toaster: Replace "Run again" button with help text for cli builds
It's not possible to run a command-line build again, as Toaster
doesn't have access to the data used for that build.
Replace the "Run again" button with an icon which pops up some
help text to that effect.
Add test to check that the run again button is hidden and the
help icon displayed instead for command-line builds.
[YOCTO #8231]
(Bitbake rev: b67ac9e7cbab50951847dd1a63b12f41bb345dbb)
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/tests.py')
-rw-r--r-- | bitbake/lib/toaster/toastergui/tests.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/tests.py b/bitbake/lib/toaster/toastergui/tests.py index d278d63aa1..c725fc827d 100644 --- a/bitbake/lib/toaster/toastergui/tests.py +++ b/bitbake/lib/toaster/toastergui/tests.py | |||
@@ -38,6 +38,7 @@ import json | |||
38 | import re | 38 | import re |
39 | 39 | ||
40 | PROJECT_NAME = "test project" | 40 | PROJECT_NAME = "test project" |
41 | CLI_BUILDS_PROJECT_NAME = 'Command line builds' | ||
41 | 42 | ||
42 | class ViewTests(TestCase): | 43 | class ViewTests(TestCase): |
43 | """Tests to verify view APIs.""" | 44 | """Tests to verify view APIs.""" |
@@ -658,6 +659,12 @@ class AllBuildsPageTests(TestCase): | |||
658 | bitbake_version=bbv) | 659 | bitbake_version=bbv) |
659 | self.project1 = Project.objects.create_project(name=PROJECT_NAME, | 660 | self.project1 = Project.objects.create_project(name=PROJECT_NAME, |
660 | release=release) | 661 | release=release) |
662 | self.default_project = Project.objects.create_project( | ||
663 | name=CLI_BUILDS_PROJECT_NAME, | ||
664 | release=release | ||
665 | ) | ||
666 | self.default_project.is_default = True | ||
667 | self.default_project.save() | ||
661 | 668 | ||
662 | # parameters for builds to associate with the projects | 669 | # parameters for builds to associate with the projects |
663 | now = timezone.now() | 670 | now = timezone.now() |
@@ -669,6 +676,13 @@ class AllBuildsPageTests(TestCase): | |||
669 | "outcome": Build.SUCCEEDED | 676 | "outcome": Build.SUCCEEDED |
670 | } | 677 | } |
671 | 678 | ||
679 | self.default_project_build_success = { | ||
680 | "project": self.default_project, | ||
681 | "started_on": now, | ||
682 | "completed_on": now, | ||
683 | "outcome": Build.SUCCEEDED | ||
684 | } | ||
685 | |||
672 | def test_show_tasks_in_allbuilds(self): | 686 | def test_show_tasks_in_allbuilds(self): |
673 | """ Task should be shown as suffix on build name """ | 687 | """ Task should be shown as suffix on build name """ |
674 | build = Build.objects.create(**self.project1_build_success) | 688 | build = Build.objects.create(**self.project1_build_success) |
@@ -678,6 +692,23 @@ class AllBuildsPageTests(TestCase): | |||
678 | result = re.findall('bash:clean', response.content, re.MULTILINE) | 692 | result = re.findall('bash:clean', response.content, re.MULTILINE) |
679 | self.assertEqual(len(result), 3) | 693 | self.assertEqual(len(result), 3) |
680 | 694 | ||
695 | def test_no_run_again_for_cli_build(self): | ||
696 | """ "Run again" button should not be shown for command-line builds """ | ||
697 | build = Build.objects.create(**self.default_project_build_success) | ||
698 | url = reverse("all-builds") | ||
699 | response = self.client.get(url, follow=True) | ||
700 | soup = BeautifulSoup(response.content) | ||
701 | |||
702 | element_id = 'build-result-%d' % build.id | ||
703 | |||
704 | # shouldn't see a run again button for command-line builds | ||
705 | run_again_button = soup.select('#%s button' % element_id) | ||
706 | self.assertEqual(len(run_again_button), 0) | ||
707 | |||
708 | # should see a help icon for command-line builds | ||
709 | help_icon = soup.select('#%s i.get-help-green' % element_id) | ||
710 | self.assertEqual(len(help_icon), 1) | ||
711 | |||
681 | class ProjectPageTests(TestCase): | 712 | class ProjectPageTests(TestCase): |
682 | """ Test project data at /project/X/ is displayed correctly """ | 713 | """ Test project data at /project/X/ is displayed correctly """ |
683 | CLI_BUILDS_PROJECT_NAME = 'Command line builds' | 714 | CLI_BUILDS_PROJECT_NAME = 'Command line builds' |
@@ -707,3 +738,5 @@ class ProjectPageTests(TestCase): | |||
707 | response = self.client.get(url, follow=True) | 738 | response = self.client.get(url, follow=True) |
708 | 739 | ||
709 | self.assertEqual(response.status_code, 200) | 740 | self.assertEqual(response.status_code, 200) |
741 | |||
742 | |||