openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #26389
[Merge] lp:~raoul-snyman/openlp/fix-ci into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/fix-ci into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/fix-ci/+merge/251503
Fix jenkins_script.py to work with the new version of jenkins-webapi which allows us to suppress SSL certificate verification (so that we can use our self-signed certificate).
Add this to your merge proposal:
--------------------------------
lp:~raoul-snyman/openlp/fix-ci (revision 2520)
[SUCCESS] https//ci.openlp.io/job/Branch-01-Pull/988/
[SUCCESS] https//ci.openlp.io/job/Branch-02-Functional-Tests/911/
[SUCCESS] https//ci.openlp.io/job/Branch-03-Interface-Tests/853/
[SUCCESS] https//ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/742/
[SUCCESS] https//ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/341/
[SUCCESS] https//ci.openlp.io/job/Branch-05a-Code_Analysis/478/
[SUCCESS] https//ci.openlp.io/job/Branch-05b-Test_Coverage/349/
--
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/fix-ci into lp:openlp.
=== modified file 'scripts/jenkins_script.py'
--- scripts/jenkins_script.py 2015-01-22 18:40:12 +0000
+++ scripts/jenkins_script.py 2015-03-02 19:29:22 +0000
@@ -32,21 +32,25 @@
You can look up the token in the Branch-01-Pull job configuration or ask in IRC.
"""
-from optparse import OptionParser
import re
-from requests.exceptions import HTTPError
-from subprocess import Popen, PIPE
import sys
import time
+from optparse import OptionParser
+from subprocess import Popen, PIPE
+import warnings
+from requests.exceptions import HTTPError
from jenkins import Jenkins
-JENKINS_URL = 'http://ci.openlp.org/'
+JENKINS_URL = 'https://ci.openlp.io/'
REPO_REGEX = r'(.*/+)(~.*)'
# Allows us to black list token. So when we change the token, we can display a proper message to the user.
OLD_TOKENS = []
+# Disable the InsecureRequestWarning we get from urllib3, because we're not verifying our own self-signed certificate
+warnings.simplefilter('ignore')
+
class OpenLPJobs(object):
"""
@@ -75,15 +79,19 @@
class JenkinsTrigger(object):
+ """
+ A class to trigger builds on Jenkins and print the results.
+
+ :param token: The token we need to trigger the build. If you do not have this token, ask in IRC.
+ """
+
def __init__(self, token):
"""
Create the JenkinsTrigger instance.
-
- :param token: The token we need to trigger the build. If you do not have this token, ask in IRC.
"""
self.token = token
self.repo_name = get_repo_name()
- self.jenkins_instance = Jenkins(JENKINS_URL)
+ self.jenkins_instance = Jenkins(JENKINS_URL, verify=False)
def trigger_build(self):
"""
@@ -94,8 +102,8 @@
# We just want the name (not the email).
name = ' '.join(raw_output.decode().split()[:-1])
cause = 'Build triggered by %s (%s)' % (name, self.repo_name)
- self.jenkins_instance.job(OpenLPJobs.Branch_Pull).build(
- {'BRANCH_NAME': self.repo_name, 'cause': cause}, token=self.token)
+ self.jenkins_instance.job(OpenLPJobs.Branch_Pull).build({'BRANCH_NAME': self.repo_name, 'cause': cause},
+ token=self.token)
def print_output(self):
"""
=== modified file 'tests/functional/openlp_plugins/songs/test_editsongform.py'
--- tests/functional/openlp_plugins/songs/test_editsongform.py 2014-12-22 17:34:43 +0000
+++ tests/functional/openlp_plugins/songs/test_editsongform.py 2015-03-02 19:29:22 +0000
@@ -1,3 +1,24 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###############################################################################
+# OpenLP - Open Source Lyrics Projection #
+# --------------------------------------------------------------------------- #
+# Copyright (c) 2008-2015 OpenLP Developers #
+# --------------------------------------------------------------------------- #
+# This program is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU General Public License as published by the Free #
+# Software Foundation; version 2 of the License. #
+# #
+# This program is distributed in the hope that it will be useful, but WITHOUT #
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
+# more details. #
+# #
+# You should have received a copy of the GNU General Public License along #
+# with this program; if not, write to the Free Software Foundation, Inc., 59 #
+# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
+###############################################################################
"""
This module contains tests for the lib submodule of the Songs plugin.
"""
=== modified file 'tests/functional/openlp_plugins/songs/test_editverseform.py'
--- tests/functional/openlp_plugins/songs/test_editverseform.py 2015-02-27 19:33:49 +0000
+++ tests/functional/openlp_plugins/songs/test_editverseform.py 2015-03-02 19:29:22 +0000
@@ -1,3 +1,24 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###############################################################################
+# OpenLP - Open Source Lyrics Projection #
+# --------------------------------------------------------------------------- #
+# Copyright (c) 2008-2015 OpenLP Developers #
+# --------------------------------------------------------------------------- #
+# This program is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU General Public License as published by the Free #
+# Software Foundation; version 2 of the License. #
+# #
+# This program is distributed in the hope that it will be useful, but WITHOUT #
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
+# more details. #
+# #
+# You should have received a copy of the GNU General Public License along #
+# with this program; if not, write to the Free Software Foundation, Inc., 59 #
+# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
+###############################################################################
"""
This module contains tests for the editverseform of the Songs plugin.
"""
@@ -38,12 +59,12 @@
"""
# GIVEN some input values
self.edit_verse_form.has_single_verse = True
- self.edit_verse_form.verse_type_combo_box.currentIndex = MagicMock(return_value = 0)
- self.edit_verse_form.verse_text_edit.toPlainText = MagicMock(return_value = 'Text')
+ self.edit_verse_form.verse_type_combo_box.currentIndex = MagicMock(return_value=0)
+ self.edit_verse_form.verse_text_edit.toPlainText = MagicMock(return_value='Text')
self.edit_verse_form.verse_number_box.setValue(3)
-
+
# WHEN the method is called
self.edit_verse_form.update_suggested_verse_number()
-
+
# THEN the verse number must not be changed
self.assertEqual(3, self.edit_verse_form.verse_number_box.value(), 'The verse number should be 3')
Follow ups