Merge lp:~raoul-snyman/openlp/dont-test-uno-on-macos into lp:openlp

Proposed by Raoul Snyman
Status: Merged
Merged at revision: 2792
Proposed branch: lp:~raoul-snyman/openlp/dont-test-uno-on-macos
Merge into: lp:openlp
Diff against target: 120 lines (+27/-12)
3 files modified
scripts/jenkins_script.py (+16/-6)
tests/functional/openlp_core/common/test_i18n.py (+3/-0)
tests/functional/openlp_plugins/songs/test_openoffice.py (+8/-6)
To merge this branch: bzr merge lp:~raoul-snyman/openlp/dont-test-uno-on-macos
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Review via email: mp+334625@code.launchpad.net

Description of the change

Fix up and skip some of the tests that don't run on macOS, and add a new parameter to the Jenkins script to continue despite failure.

Add this to your merge proposal:
--------------------------------------------------------------------------------
lp:~raoul-snyman/openlp/dont-test-uno-on-macos (revision 2797)
https://ci.openlp.io/job/Branch-01-Pull/2325/ [SUCCESS]
https://ci.openlp.io/job/Branch-02-Functional-Tests/2226/ [SUCCESS]
https://ci.openlp.io/job/Branch-03-Interface-Tests/2102/ [SUCCESS]
https://ci.openlp.io/job/Branch-04a-Code_Analysis/1428/ [SUCCESS]
https://ci.openlp.io/job/Branch-04b-Test_Coverage/1250/ [SUCCESS]
https://ci.openlp.io/job/Branch-04c-Code_Analysis2/380/ [SUCCESS]
https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/209/ [FAILURE]
https://ci.openlp.io/job/Branch-07-macOS-Tests/21/ [SUCCESS]

Failed builds:
 - Branch-05-AppVeyor-Tests #209: https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/209/console

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/jenkins_script.py'
2--- scripts/jenkins_script.py 2017-11-10 17:51:42 +0000
3+++ scripts/jenkins_script.py 2017-12-02 00:53:41 +0000
4@@ -63,9 +63,10 @@
5 Branch_Coverage = 'Branch-04b-Test_Coverage'
6 Branch_Pylint = 'Branch-04c-Code_Analysis2'
7 Branch_AppVeyor = 'Branch-05-AppVeyor-Tests'
8+ Branch_macOS = 'Branch-07-macOS-Tests'
9
10 Jobs = [Branch_Pull, Branch_Functional, Branch_Interface, Branch_PEP, Branch_Coverage, Branch_Pylint,
11- Branch_AppVeyor]
12+ Branch_AppVeyor, Branch_macOS]
13
14
15 class Colour(object):
16@@ -115,7 +116,7 @@
17 self.fetch_jobs()
18 self.server.build_job(OpenLPJobs.Branch_Pull, {'BRANCH_NAME': self.repo_name, 'cause': cause})
19
20- def print_output(self):
21+ def print_output(self, can_continue=False):
22 """
23 Print the status information of the build triggered.
24 """
25@@ -126,13 +127,21 @@
26 revno = raw_output.decode().strip()
27 print('%s (revision %s)' % (get_repo_name(), revno))
28
29+ failed_builds = []
30 for job in OpenLPJobs.Jobs:
31 if not self.__print_build_info(job):
32 if self.current_build:
33- print('Stopping after failure, see {}console for more details'.format(self.current_build['url']))
34- else:
35+ failed_builds.append((self.current_build['fullDisplayName'], self.current_build['url']))
36+ if not can_continue:
37 print('Stopping after failure')
38- break
39+ break
40+ print('')
41+ if failed_builds:
42+ print('Failed builds:')
43+ for build_name, url in failed_builds:
44+ print(' - {}: {}console'.format(build_name, url))
45+ else:
46+ print('All builds passed')
47
48 def open_browser(self):
49 """
50@@ -227,6 +236,7 @@
51 help='Disable coloured output (always disabled on Windows)')
52 parser.add_argument('-u', '--username', required=True, help='Your Jenkins username')
53 parser.add_argument('-p', '--password', required=True, help='Your Jenkins password or personal token')
54+ parser.add_argument('-c', '--always-continue', action='store_true', default=False, help='Continue despite failure')
55 args = parser.parse_args()
56
57 if not get_repo_name():
58@@ -238,7 +248,7 @@
59 if args.open_browser:
60 jenkins_trigger.open_browser()
61 if not args.disable_output:
62- jenkins_trigger.print_output()
63+ jenkins_trigger.print_output(can_continue=args.always_continue)
64
65
66 if __name__ == '__main__':
67
68=== modified file 'tests/functional/openlp_core/common/test_i18n.py'
69--- tests/functional/openlp_core/common/test_i18n.py 2017-11-03 22:52:24 +0000
70+++ tests/functional/openlp_core/common/test_i18n.py 2017-12-02 00:53:41 +0000
71@@ -22,8 +22,10 @@
72 """
73 Package to test the openlp.core.lib.languages package.
74 """
75+from unittest import skipIf
76 from unittest.mock import MagicMock, patch
77
78+from openlp.core.common import is_macosx
79 from openlp.core.common.i18n import LANGUAGES, Language, UiStrings, get_language, get_locale_key, get_natural_key, \
80 translate
81
82@@ -110,6 +112,7 @@
83 assert language is None
84
85
86+@skipIf(is_macosx(), 'This test doesn\'t work on macOS currently')
87 def test_get_locale_key():
88 """
89 Test the get_locale_key(string) function
90
91=== modified file 'tests/functional/openlp_plugins/songs/test_openoffice.py'
92--- tests/functional/openlp_plugins/songs/test_openoffice.py 2017-10-10 02:29:56 +0000
93+++ tests/functional/openlp_plugins/songs/test_openoffice.py 2017-12-02 00:53:41 +0000
94@@ -22,18 +22,20 @@
95 """
96 This module contains tests for the OpenOffice/LibreOffice importer.
97 """
98-from unittest import TestCase, SkipTest
99+from unittest import TestCase, skipIf
100 from unittest.mock import MagicMock, patch
101
102 from openlp.core.common.registry import Registry
103+
104+from tests.helpers.testmixin import TestMixin
105+
106 try:
107 from openlp.plugins.songs.lib.importers.openoffice import OpenOfficeImport
108 except ImportError:
109- raise SkipTest('Could not import OpenOfficeImport probably due to unavailability of uno')
110-
111-from tests.helpers.testmixin import TestMixin
112-
113-
114+ OpenOfficeImport = None
115+
116+
117+@skipIf(OpenOfficeImport is None, 'Could not import OpenOfficeImport probably due to unavailability of uno')
118 class TestOpenOfficeImport(TestCase, TestMixin):
119 """
120 Test the :class:`~openlp.plugins.songs.lib.importer.openoffice.OpenOfficeImport` class