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

Subscribers

People subscribed via source and target branches