Merge lp:~gerboland/unity8/fix-run.sh-script into lp:unity8

Proposed by Gerry Boland
Status: Merged
Approved by: Michał Sawicz
Approved revision: 1095
Merged at revision: 1104
Proposed branch: lp:~gerboland/unity8/fix-run.sh-script
Merge into: lp:unity8
Diff against target: 71 lines (+25/-3)
2 files modified
src/main.cpp (+7/-0)
tests/autopilot/unity8/shell/tests/test_upstart.py (+18/-3)
To merge this branch: bzr merge lp:~gerboland/unity8/fix-run.sh-script
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Michał Sawicz Approve
Albert Astals Cid (community) Approve
Review via email: mp+228817@code.launchpad.net

Commit message

Fix the run.sh script - pretend to be running with qtmir and emit SIGSTOP at the right time

Description of the change

Fix the run.sh script - pretend to be running with qtmir and emit SIGSTOP at the right time

 * Are there any related MPs required for this MP to build/function as expected? Please list.
N
 * Did you perform an exploratory manual test run of your code change and any related functionality?
Y
 * Did you make sure that your branch does not contain spurious tags?
Y
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
 * If you changed the UI, has there been a design review?
N

To post a comment you must log in.
1092. By Gerry Boland

Use csignal instead of signal.h

1093. By Gerry Boland

Make slightly more readable

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

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass? If not, please explain why.
Waiting

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

FWIW the autopilot tests won't pass with this as it sets the env var to an empty string. Leo is fixing this in lp:~canonical-platform-qa/unity8/dash-as-app-autopilot

1094. By Gerry Boland

Make slightly less readable - revert 1093 - AP bug to unset env vars actually sets them to empty strings

Revision history for this message
Gerry Boland (gerboland) wrote :

Well I reverted the breaking change

1095. By Gerry Boland

AP test to ensure sigstop emitted

Revision history for this message
Michał Sawicz (saviq) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yezz.

 * Did CI run pass? If not, please explain why.
Locally did.

review: Approve
1096. By Gerry Boland

Unrevert the revert

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/main.cpp'
2--- src/main.cpp 2014-07-25 11:29:56 +0000
3+++ src/main.cpp 2014-07-31 10:52:44 +0000
4@@ -25,6 +25,7 @@
5 #include <QtQml/QQmlContext>
6 #include <QLibrary>
7 #include <QDebug>
8+#include <csignal>
9 #include <libintl.h>
10
11 // local
12@@ -140,6 +141,12 @@
13 view->setSource(source);
14 QObject::connect(view->engine(), SIGNAL(quit()), application, SLOT(quit()));
15
16+ if (!isMirServer && qEnvironmentVariableIsSet("UNITY_MIR_EMITS_SIGSTOP")) {
17+ // Emit SIGSTOP as expected by upstart, under Mir it's qtmir that will raise it.
18+ // see http://upstart.ubuntu.com/cookbook/#expect-stop
19+ raise(SIGSTOP);
20+ }
21+
22 if (isMirServer || parser.isSet(fullscreenOption)) {
23 view->showFullScreen();
24 } else {
25
26=== modified file 'tests/autopilot/unity8/shell/tests/test_upstart.py'
27--- tests/autopilot/unity8/shell/tests/test_upstart.py 2014-07-22 21:07:44 +0000
28+++ tests/autopilot/unity8/shell/tests/test_upstart.py 2014-07-31 10:52:44 +0000
29@@ -25,7 +25,8 @@
30 import subprocess
31 import time
32
33-from testtools.matchers._basic import Equals
34+import fixtures
35+from testtools.matchers import Equals, MismatchError
36 from autopilot.matchers import Eventually
37 from autopilot.introspection import get_proxy_object_for_existing_process
38
39@@ -100,8 +101,21 @@
40 emulator_base=UnityEmulatorBase,))
41
42 def test_no_sigstop(self):
43- self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "")
44+ self.useFixture(
45+ fixtures.EnvironmentVariable(
46+ 'UNITY_MIR_EMITS_SIGSTOP', newvalue=None))
47 self._launch_unity()
48+
49+ try:
50+ self.assertThat(
51+ lambda: os.WIFSTOPPED(self._get_status()),
52+ Eventually(Equals(True)))
53+ except MismatchError:
54+ pass
55+ else:
56+ self.process.send_signal(signal.SIGCONT)
57+ self.fail('Unity8 raised SIGSTOP')
58+
59 self._set_proxy()
60
61 logger.debug("Unity started, waiting for it to be ready.")
62@@ -109,7 +123,8 @@
63 logger.debug("Unity loaded and ready.")
64
65 def test_expect_sigstop(self):
66- self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "1")
67+ self.useFixture(
68+ fixtures.EnvironmentVariable('UNITY_MIR_EMITS_SIGSTOP', '1'))
69 self._launch_unity()
70 self.assertThat(
71 lambda: os.WIFSTOPPED(self._get_status()),

Subscribers

People subscribed via source and target branches