Merge lp:~3v1n0/indicator-sound/tests-environment-fixes into lp:indicator-sound

Proposed by Marco Trevisan (Treviño) on 2018-04-20
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2018-04-20
Approved revision: 563
Merged at revision: 562
Proposed branch: lp:~3v1n0/indicator-sound/tests-environment-fixes
Merge into: lp:indicator-sound
Diff against target: 58 lines (+8/-19)
2 files modified
tests/integration/CMakeLists.txt (+6/-17)
tests/integration/indicator-sound-test-base.cpp (+2/-2)
To merge this branch: bzr merge lp:~3v1n0/indicator-sound/tests-environment-fixes
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve on 2018-04-20
Review via email: mp+343741@code.launchpad.net

Commit message

tests, integration: set environment variables to work headless

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/integration/CMakeLists.txt'
2--- tests/integration/CMakeLists.txt 2017-03-28 14:52:39 +0000
3+++ tests/integration/CMakeLists.txt 2018-04-20 21:42:05 +0000
4@@ -74,25 +74,14 @@
5 gmenuharness-shared
6 )
7
8-####
9-## When building under jenkins, pulseuadio fails to start as there is no
10-## /run/user tree, HOME directory is missing, and similar issues. So here
11-## we check that we are the jenkins user, and avoid the integration tests,
12-## until such time in future when we can run these tests in some different
13-## manner to avoid needing to run pulseaudio in this way.
14-####
15-execute_process(
16- COMMAND whoami
17- OUTPUT_VARIABLE TESTS_USER
18- OUTPUT_STRIP_TRAILING_WHITESPACE
19+add_test(
20+ integration-tests
21+ integration-tests
22 )
23
24-if(NOT "${TESTS_USER}" STREQUAL "jenkins")
25- add_test(
26- integration-tests
27- integration-tests
28- )
29-endif()
30+set_tests_properties(integration-tests PROPERTIES ENVIRONMENT
31+ "DISPLAY='';HOME=/tmp/indicator-test-home;"
32+)
33
34 set(
35 SET-VOLUME-SRC
36
37=== modified file 'tests/integration/indicator-sound-test-base.cpp'
38--- tests/integration/indicator-sound-test-base.cpp 2016-03-16 14:00:47 +0000
39+++ tests/integration/indicator-sound-test-base.cpp 2018-04-20 21:42:05 +0000
40@@ -297,7 +297,7 @@
41 << QString("--load=module-null-sink sink_name=indicator_sound_test_speaker sink_properties=device.bus=%1").arg(getDevicePortString(speakerPort))
42 << QString("--load=module-null-sink sink_name=indicator_sound_test_headphones sink_properties=device.bus=%1").arg(getDevicePortString(headphonesPort))
43 << QString("--load=module-null-sink sink_name=indicator_sound_test_mic")
44- << "--log-target=file:/tmp/pulse-daemon.log"
45+ << "--log-target=file:/tmp/indicator-sound-test-pulse-daemon-desktop.log"
46 << "--load=module-dbus-protocol"
47 << "--load=module-native-protocol-tcp auth-ip-acl=127.0.0.1"
48 ));
49@@ -329,8 +329,8 @@
50 << QString("--load=module-null-sink sink_name=indicator_sound_test_speaker sink_properties=device.bus=%1").arg(getDevicePortString(speakerPort))
51 << QString("--load=module-null-sink sink_name=indicator_sound_test_headphones sink_properties=device.bus=%1").arg(getDevicePortString(headphonesPort))
52 << QString("--load=module-null-sink sink_name=indicator_sound_test_mic")
53- << "--log-target=file:/tmp/pulse-daemon.log"
54 << QString("--load=module-stream-restore restore_device=false restore_muted=false fallback_table=%1").arg(STREAM_RESTORE_TABLE)
55+ << "--log-target=file:/tmp/indicator-sound-test-pulse-daemon-phone.log"
56 << "--load=module-dbus-protocol"
57 << "--load=module-native-protocol-tcp auth-ip-acl=127.0.0.1"
58 ));

Subscribers

People subscribed via source and target branches