Merge lp:~mzanetti/unity/phablet-make-check-hook into lp:unity/phablet

Proposed by Michael Zanetti
Status: Merged
Approved by: Albert Astals Cid
Approved revision: no longer in the source branch.
Merged at revision: 548
Proposed branch: lp:~mzanetti/unity/phablet-make-check-hook
Merge into: lp:unity/phablet
Diff against target: 51 lines (+40/-0)
2 files modified
.bazaar/Makefile (+6/-0)
.bazaar/plugins/makecheck_unity_phablet.py (+34/-0)
To merge this branch: bzr merge lp:~mzanetti/unity/phablet-make-check-hook
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michał Sawicz Needs Fixing
Albert Astals Cid (community) Approve
Review via email: mp+153868@code.launchpad.net

Commit message

added a bzr hook to execute tests on comitting and pushing

to install:
cd .bazaar
make install

Description of the change

added a bzr hook to execute tests on comitting and pushing

to install:
cd .bazaar
make install

To post a comment you must log in.
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
Albert Astals Cid (aacid) wrote :

Is the extra verbosity there on purpose?

Maybe you want to add a "print "Execute 'make qmluitests'.."" too?

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

tsdgeos_work@xps:~/phablet/lalalal/.bazaar$ make install
make: *** No rule to make target `install'. Stop.

Missing Makefile so that make install does anything?

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Doesn't seem to working here, any idea?

tsdgeos_work@xps:~/phablet/lalala$ ls ~/.bazaar/plugins/makecheck_unity_phablet.py
/home/tsdgeos_work/.bazaar/plugins/makecheck_unity_phablet.py
tsdgeos_work@xps:~/phablet/lalala$ vi build
tsdgeos_work@xps:~/phablet/lalala$ bzr commit
Committing to: /home/tsdgeos_work/phablet/lalala/
modified build
Committed revision 491.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Doesn't work with colocated branches :/

review: Needs Fixing
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
Albert Astals Cid (aacid) wrote :

It works for me now, but to be honest even knowing something was going to happen i ended up finding it a bit weird to see all those windows starting to pop out after doing a bzr commit.

review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

Actually, needs fixing.

The make uninstall ahs to remove the pyc file too, otherwise the thing keeps executing :D

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Ok, so approve with comments, as said in https://code.launchpad.net/~mzanetti/unity/phablet-make-check-hook/+merge/153868/comments/337211 not sure it's something we want, but it does what it says it does.

I'll leave to someone else to decided if we want it in or not

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :
review: Needs Fixing
Revision history for this message
Michał Sawicz (saviq) wrote :

Please resolve conflicts.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory '.bazaar'
2=== added file '.bazaar/Makefile'
3--- .bazaar/Makefile 1970-01-01 00:00:00 +0000
4+++ .bazaar/Makefile 2013-04-05 08:27:22 +0000
5@@ -0,0 +1,6 @@
6+install:
7+ mkdir -p ~/.bazaar/plugins
8+ cp plugins/* ~/.bazaar/plugins
9+
10+uninstall:
11+ rm ~/.bazaar/plugins/makecheck_unity_phablet.py*
12
13=== added directory '.bazaar/plugins'
14=== added file '.bazaar/plugins/makecheck_unity_phablet.py'
15--- .bazaar/plugins/makecheck_unity_phablet.py 1970-01-01 00:00:00 +0000
16+++ .bazaar/plugins/makecheck_unity_phablet.py 2013-04-05 08:27:22 +0000
17@@ -0,0 +1,34 @@
18+#!/usr/bin/python
19+# Copyright 2013 Canonical Ltd.
20+#
21+# This program is free software; you can redistribute it and/or modify
22+# it under the terms of the GNU Lesser General Public License as published by
23+# the Free Software Foundation; version 3.
24+#
25+# This program is distributed in the hope that it will be useful,
26+# but WITHOUT ANY WARRANTY; without even the implied warranty of
27+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28+# GNU Lesser General Public License for more details.
29+#
30+# You should have received a copy of the GNU Lesser General Public License
31+# along with this program. If not, see <http://www.gnu.org/licenses/>.
32+
33+import os, subprocess
34+from bzrlib import branch, errors
35+from bzrlib.urlutils import dirname, local_path_from_url
36+
37+def execute_makecheck(local_branch, master_branch, old_revision_number, old_revision_id, future_revision_number, future_revision_id, tree_delta, future_tree):
38+ if not master_branch.basis_tree().has_filename("Shell.qml"):
39+ return
40+
41+ os.chdir(local_path_from_url(master_branch.base))
42+
43+ print "Executing 'make check'.."
44+ if (subprocess.call("make check", shell=True) != 0):
45+ raise errors.BzrError("Unit tests failed, fix them before committing!")
46+
47+ print "Executing 'make qmluitests'.."
48+ if (subprocess.call("make qmluitests", shell=True) != 0):
49+ raise errors.BzrError("QML UI tests failed, fix them before committing!")
50+
51+branch.Branch.hooks.install_named_hook('pre_commit', execute_makecheck, 'make check pre-commit')

Subscribers

People subscribed via source and target branches