Merge lp:~mzanetti/unity8/improve-bzr-hook into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Mirco Müller
Approved revision: 61
Merged at revision: 65
Proposed branch: lp:~mzanetti/unity8/improve-bzr-hook
Merge into: lp:unity8
Diff against target: 41 lines (+17/-7)
2 files modified
.bazaar/plugins/makecheck_unity_phablet.py (+16/-7)
.bzrignore (+1/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/improve-bzr-hook
Reviewer Review Type Date Requested Status
Mirco Müller (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+172146@code.launchpad.net

Commit message

improve the bzr commit hook

- don't run qmltests in here, it takes too long
- don't abort commit on failed tests, its too annoying
- instead, print a fat warning and backup the commit message to be reused after uncommitting and fixing the tests

Description of the change

to install, run:

cd .bazaar && make install

To post a comment you must log in.
lp:~mzanetti/unity8/improve-bzr-hook updated
61. By Michael Zanetti

adjust old print

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Mirco Müller (macslow) wrote :

Very handy tool.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bazaar/plugins/makecheck_unity_phablet.py'
2--- .bazaar/plugins/makecheck_unity_phablet.py 2013-06-05 22:03:08 +0000
3+++ .bazaar/plugins/makecheck_unity_phablet.py 2013-06-28 21:08:23 +0000
4@@ -23,12 +23,21 @@
5
6 os.chdir(local_path_from_url(master_branch.base))
7
8- print "Executing 'make check'.."
9- if (subprocess.call("make check", shell=True) != 0):
10- raise errors.BzrError("Unit tests failed, fix them before committing!")
11-
12- print "Executing 'make qmluitests'.."
13- if (subprocess.call("make qmluitests", shell=True) != 0):
14- raise errors.BzrError("QML UI tests failed, fix them before committing!")
15+ print "Executing 'make -C builddir test'.."
16+ os.environ['CTEST_OUTPUT_ON_FAILURE'] = "1"
17+ if (subprocess.call("make -C builddir test", shell=True) != 0):
18+
19+ print("\n\n*** Warning ***\n\nBasic tests failed. This commit will not pass continuous integration.")
20+
21+ branch = local_branch or master_branch
22+ revision = branch.repository.get_revision(future_revision_id)
23+ msg_file = open('message.txt', 'w')
24+ msg_file.write(revision.message)
25+ msg_file.close()
26+
27+ print("\n\nSaved commit message to $SRC_DIR/message.txt.")
28+ print("You can uncommit this revision, fix the tests and reuse your message running:\n\nbzr commit -F message.txt\n\n")
29+ elif os.path.isfile("message.txt"):
30+ os.remove("message.txt")
31
32 branch.Branch.hooks.install_named_hook('pre_commit', execute_makecheck, 'make check pre-commit')
33
34=== modified file '.bzrignore'
35--- .bzrignore 2013-06-05 22:03:08 +0000
36+++ .bzrignore 2013-06-28 21:08:23 +0000
37@@ -7,3 +7,4 @@
38 /.cproject
39 /.settings
40 /.pydevproject
41+message.txt

Subscribers

People subscribed via source and target branches