ci: start the dbus mock server in GN CI
This commit is contained in:
parent
a4f02724bf
commit
00b2d94785
3 changed files with 18 additions and 9 deletions
|
@ -208,7 +208,7 @@ gn-build-steps: &gn-build-steps
|
||||||
ninja -C out/Default electron/build/node:headers
|
ninja -C out/Default electron/build/node:headers
|
||||||
export npm_config_nodedir="$PWD/out/Default/gen/node_headers"
|
export npm_config_nodedir="$PWD/out/Default/gen/node_headers"
|
||||||
(cd electron/spec && npm install)
|
(cd electron/spec && npm install)
|
||||||
./out/Default/electron electron/spec --ci --enable-logging
|
python electron/script/lib/dbus_mock.py ./out/Default/electron electron/spec --ci --enable-logging
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: src/junit
|
path: src/junit
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
|
|
|
@ -6,17 +6,23 @@ import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def cleanup():
|
def stop():
|
||||||
DBusTestCase.stop_dbus(DBusTestCase.system_bus_pid)
|
DBusTestCase.stop_dbus(DBusTestCase.system_bus_pid)
|
||||||
DBusTestCase.stop_dbus(DBusTestCase.session_bus_pid)
|
DBusTestCase.stop_dbus(DBusTestCase.session_bus_pid)
|
||||||
|
|
||||||
|
def start():
|
||||||
|
dbusmock_log = sys.stdout if is_verbose_mode() else open(os.devnull, 'w')
|
||||||
|
|
||||||
atexit.register(cleanup)
|
DBusTestCase.start_system_bus()
|
||||||
|
DBusTestCase.spawn_server_template('logind', None, dbusmock_log)
|
||||||
|
|
||||||
dbusmock_log = sys.stdout if is_verbose_mode() else open(os.devnull, 'w')
|
DBusTestCase.start_session_bus()
|
||||||
|
DBusTestCase.spawn_server_template('notification_daemon', None, dbusmock_log)
|
||||||
|
|
||||||
DBusTestCase.start_system_bus()
|
if __name__ == '__main__':
|
||||||
DBusTestCase.spawn_server_template('logind', None, dbusmock_log)
|
import subprocess
|
||||||
|
start()
|
||||||
DBusTestCase.start_session_bus()
|
try:
|
||||||
DBusTestCase.spawn_server_template('notification_daemon', None, dbusmock_log)
|
subprocess.check_call(sys.argv[1:])
|
||||||
|
finally:
|
||||||
|
stop()
|
||||||
|
|
|
@ -18,6 +18,9 @@ if sys.platform == 'linux2':
|
||||||
# will be picked up by electron.
|
# will be picked up by electron.
|
||||||
try:
|
try:
|
||||||
import lib.dbus_mock
|
import lib.dbus_mock
|
||||||
|
import atexit
|
||||||
|
lib.dbus_mock.start()
|
||||||
|
atexit.register(lib.dbus_mock.stop)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# If not available, the powerMonitor tests will be skipped since
|
# If not available, the powerMonitor tests will be skipped since
|
||||||
# DBUS_SYSTEM_BUS_ADDRESS will not be set
|
# DBUS_SYSTEM_BUS_ADDRESS will not be set
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue