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
=== modified file 'src/main.cpp'
--- src/main.cpp 2014-07-25 11:29:56 +0000
+++ src/main.cpp 2014-07-31 10:52:44 +0000
@@ -25,6 +25,7 @@
25#include <QtQml/QQmlContext>25#include <QtQml/QQmlContext>
26#include <QLibrary>26#include <QLibrary>
27#include <QDebug>27#include <QDebug>
28#include <csignal>
28#include <libintl.h>29#include <libintl.h>
2930
30// local31// local
@@ -140,6 +141,12 @@
140 view->setSource(source);141 view->setSource(source);
141 QObject::connect(view->engine(), SIGNAL(quit()), application, SLOT(quit()));142 QObject::connect(view->engine(), SIGNAL(quit()), application, SLOT(quit()));
142143
144 if (!isMirServer && qEnvironmentVariableIsSet("UNITY_MIR_EMITS_SIGSTOP")) {
145 // Emit SIGSTOP as expected by upstart, under Mir it's qtmir that will raise it.
146 // see http://upstart.ubuntu.com/cookbook/#expect-stop
147 raise(SIGSTOP);
148 }
149
143 if (isMirServer || parser.isSet(fullscreenOption)) {150 if (isMirServer || parser.isSet(fullscreenOption)) {
144 view->showFullScreen();151 view->showFullScreen();
145 } else {152 } else {
146153
=== modified file 'tests/autopilot/unity8/shell/tests/test_upstart.py'
--- tests/autopilot/unity8/shell/tests/test_upstart.py 2014-07-22 21:07:44 +0000
+++ tests/autopilot/unity8/shell/tests/test_upstart.py 2014-07-31 10:52:44 +0000
@@ -25,7 +25,8 @@
25import subprocess25import subprocess
26import time26import time
2727
28from testtools.matchers._basic import Equals28import fixtures
29from testtools.matchers import Equals, MismatchError
29from autopilot.matchers import Eventually30from autopilot.matchers import Eventually
30from autopilot.introspection import get_proxy_object_for_existing_process31from autopilot.introspection import get_proxy_object_for_existing_process
3132
@@ -100,8 +101,21 @@
100 emulator_base=UnityEmulatorBase,))101 emulator_base=UnityEmulatorBase,))
101102
102 def test_no_sigstop(self):103 def test_no_sigstop(self):
103 self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "")104 self.useFixture(
105 fixtures.EnvironmentVariable(
106 'UNITY_MIR_EMITS_SIGSTOP', newvalue=None))
104 self._launch_unity()107 self._launch_unity()
108
109 try:
110 self.assertThat(
111 lambda: os.WIFSTOPPED(self._get_status()),
112 Eventually(Equals(True)))
113 except MismatchError:
114 pass
115 else:
116 self.process.send_signal(signal.SIGCONT)
117 self.fail('Unity8 raised SIGSTOP')
118
105 self._set_proxy()119 self._set_proxy()
106120
107 logger.debug("Unity started, waiting for it to be ready.")121 logger.debug("Unity started, waiting for it to be ready.")
@@ -109,7 +123,8 @@
109 logger.debug("Unity loaded and ready.")123 logger.debug("Unity loaded and ready.")
110124
111 def test_expect_sigstop(self):125 def test_expect_sigstop(self):
112 self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "1")126 self.useFixture(
127 fixtures.EnvironmentVariable('UNITY_MIR_EMITS_SIGSTOP', '1'))
113 self._launch_unity()128 self._launch_unity()
114 self.assertThat(129 self.assertThat(
115 lambda: os.WIFSTOPPED(self._get_status()),130 lambda: os.WIFSTOPPED(self._get_status()),

Subscribers

People subscribed via source and target branches