Merge lp:~mzanetti/unity8/make-xvfbtestSomething into lp:unity8
- make-xvfbtestSomething
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Albert Astals Cid |
Approved revision: | 785 |
Merged at revision: | 813 |
Proposed branch: | lp:~mzanetti/unity8/make-xvfbtestSomething |
Merge into: | lp:unity8 |
Prerequisite: | lp:~mzanetti/unity8/make-single-testfunction |
Diff against target: |
208 lines (+72/-43) 7 files modified
build (+1/-0) cmake/modules/QmlTest.cmake (+64/-19) tests/CMakeLists.txt (+2/-2) tests/plugins/Ubuntu/Gestures/CMakeLists.txt (+2/-11) tests/qmltests/CMakeLists.txt (+0/-1) tests/qmltests/Components/CMakeLists.txt (+2/-10) tests/qmltests/Components/tst_LazyImage.qml (+1/-0) |
To merge this branch: | bzr merge lp:~mzanetti/unity8/make-xvfbtestSomething |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Albert Astals Cid (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Michał Sawicz | Needs Fixing | ||
Andrea Cimitan | Pending | ||
Review via email: mp+211573@code.launchpad.net |
This proposal supersedes a proposal from 2014-03-18.
Commit message
add "make xvfbtestSomething" target to run qml tests in xvfb
Description of the change
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
Andrea Cimitan (cimi) wrote : Posted in a previous version of this proposal | # |
I think we need to make xvfb optional in ./build, otherwise it might not work on the devices without X (like mobile)
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal | # |
> I think we need to make xvfb optional in ./build, otherwise it might not work
> on the devices without X (like mobile)
this is only installed with ./build -s. For running on the device you should use ./run_on_device -s
Andrea Cimitan (cimi) : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:779
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:780
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Michał Sawicz (saviq) wrote : | # |
You need NO_ADD_TEST for non-ui tests:
11/26 Test #11: testUnityTest .......
12/26 Test #12: xvfbtestUnityTest .......
/usr/bin/env: xvfb-run: No such file or directory
Michał Sawicz (saviq) wrote : | # |
LD_PRELOAD=
Ah, this won't work outside of amd64... Not sure if we should try and make it work across the board or just warn about it somewhere.
Michał Sawicz (saviq) wrote : | # |
set(xfvbtestCom
- 781. By Michael Zanetti
-
always add NO_ADD_TEST to xvfb target
- 782. By Michael Zanetti
-
abstract binary qml test targets into add_binary_qml_test macro
- 783. By Michael Zanetti
-
make it a bit more generic
Michael Zanetti (mzanetti) wrote : | # |
> You need NO_ADD_TEST for non-ui tests:
>
> 11/26 Test #11: testUnityTest .......
> sec
> 12/26 Test #12: xvfbtestUnityTest .......
> sec
> /usr/bin/env: xvfb-run: No such file or directory
fixed
Michael Zanetti (mzanetti) wrote : | # |
> LD_PRELOAD=
>
> Ah, this won't work outside of amd64... Not sure if we should try and make it
> work across the board or just warn about it somewhere.
fixed. Calling gcc -dumpmachine to determine arch-triplet.
Michael Zanetti (mzanetti) wrote : | # |
> set(xfvbtestCom
ack. abstracted into add_binary_qmltest macro
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:781
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:783
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 784. By Michael Zanetti
-
set LD_LIBRARY_PATH conditionally, depending on the availability of gcc
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:784
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Text conflict in tests/qmltests/
- 785. By Michael Zanetti
-
merge trunk
Michael Zanetti (mzanetti) wrote : | # |
> Text conflict in tests/qmltests/
fixed
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:785
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:785
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
We have now lost the hability to run all qmluitests without xvfb, previously you achieved that by doing
make qmluitests
but that now runs the xvfb variants, i wonder if it would make sense to keep the behaviour of
make qmluitests as it was
and then introduce
make xvfbqmluitests
that runs the xvfb variant
Michał Sawicz (saviq) wrote : | # |
I think it's fine as is, we don't want to encourage running them outside of xvfb, other than for debugging, when you run only one test/suite at a time.
We'll be running them under xvfb during CI as well, so that we have as close an env locally.
Albert Astals Cid (aacid) wrote : | # |
Ok :-)
* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes, tests, run
* Did CI run pass? If not, please explain why.
No, some tests are broken, being fixed in a different MR
Preview Diff
1 | === modified file 'build' |
2 | --- build 2014-04-01 22:56:02 +0000 |
3 | +++ build 2014-04-02 12:13:20 +0000 |
4 | @@ -54,6 +54,7 @@ |
5 | unity-scope-home \ |
6 | unity-lens-applications \ |
7 | unity-plugin-scopes \ |
8 | + xvfb \ |
9 | || exit 5 |
10 | } |
11 | |
12 | |
13 | === modified file 'cmake/modules/QmlTest.cmake' |
14 | --- cmake/modules/QmlTest.cmake 2014-03-28 00:32:46 +0000 |
15 | +++ cmake/modules/QmlTest.cmake 2014-04-02 12:13:20 +0000 |
16 | @@ -65,6 +65,7 @@ |
17 | cmake_parse_arguments(qmltest "${options}" "" "${multi_value_keywords}" ${ARGN}) |
18 | |
19 | set(qmltest_TARGET test${COMPONENT_NAME}) |
20 | + set(qmltest_xvfb_TARGET xvfbtest${COMPONENT_NAME}) |
21 | set(qmltest_FILE ${SUBPATH}/tst_${COMPONENT_NAME}) |
22 | |
23 | set(qmltestrunner_imports "") |
24 | @@ -82,24 +83,69 @@ |
25 | |
26 | string(TOLOWER "${CMAKE_GENERATOR}" cmake_generator_lower) |
27 | if(cmake_generator_lower STREQUAL "unix makefiles") |
28 | - set(qmltest_command |
29 | - env ${qmltest_ENVIRONMENT} |
30 | - ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml |
31 | - ${qmltestrunner_imports} |
32 | - -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml |
33 | - -o -,txt |
34 | - $(FUNCTION) |
35 | - ) |
36 | + set(function_ARGS $(FUNCTION)) |
37 | else() |
38 | - set(qmltest_command |
39 | - env ${qmltest_ENVIRONMENT} |
40 | - ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml |
41 | - ${qmltestrunner_imports} |
42 | - -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml |
43 | - -o -,txt |
44 | - ) |
45 | - endif() |
46 | - |
47 | + set(function_ARGS "") |
48 | + endif() |
49 | + |
50 | + set(qmltest_command |
51 | + env ${qmltest_ENVIRONMENT} |
52 | + ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml |
53 | + ${qmltestrunner_imports} |
54 | + -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml |
55 | + -o -,txt |
56 | + ${function_ARGS} |
57 | + ) |
58 | + find_program( HAVE_GCC gcc ) |
59 | + if (NOT ${HAVE_GCC} STREQUAL "") |
60 | + exec_program( gcc ARGS "-dumpmachine" OUTPUT_VARIABLE ARCH_TRIPLET ) |
61 | + set(LD_PRELOAD_PATH "LD_PRELOAD=/usr/lib/${ARCH_TRIPLET}/mesa/libGL.so.1") |
62 | + endif() |
63 | + set(qmltest_xvfb_command |
64 | + env ${qmltest_ENVIRONMENT} ${LD_PRELOAD_PATH} |
65 | + xvfb-run --server-args "-screen 0 1024x768x24" --auto-servernum |
66 | + ${qmltestrunner_exe} -input ${CMAKE_CURRENT_SOURCE_DIR}/${qmltest_FILE}.qml |
67 | + ${qmltestrunner_imports} |
68 | + -o ${CMAKE_BINARY_DIR}/${qmltest_TARGET}.xml,xunitxml |
69 | + -o -,txt |
70 | + ${function_ARGS} |
71 | + ) |
72 | + |
73 | + add_qmltest_target(${qmltest_TARGET} "${qmltest_command}" TRUE ${qmltest_NO_ADD_TEST}) |
74 | + add_qmltest_target(${qmltest_xvfb_TARGET} "${qmltest_xvfb_command}" ${qmltest_NO_TARGETS} TRUE) |
75 | + add_manual_qml_test(${SUBPATH} ${COMPONENT_NAME} ${ARGN}) |
76 | +endmacro(add_qml_test) |
77 | + |
78 | +macro(add_binary_qml_test CLASS_NAME LD_PATH DEPS) |
79 | + set(testCommand |
80 | + LD_LIBRARY_PATH=${LD_PATH} |
81 | + ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_NAME}TestExec |
82 | + -o ${CMAKE_BINARY_DIR}/${CLASSNAME}Test.xml,xunitxml |
83 | + -o -,txt) |
84 | + |
85 | + add_qmltest_target(test${CLASS_NAME} "${testCommand}" FALSE TRUE) |
86 | + add_dependencies(test${CLASS_NAME} ${CLASS_NAME}TestExec ${DEPS}) |
87 | + |
88 | + find_program( HAVE_GCC gcc ) |
89 | + if (NOT ${HAVE_GCC} STREQUAL "") |
90 | + exec_program( gcc ARGS "-dumpmachine" OUTPUT_VARIABLE ARCH_TRIPLET ) |
91 | + set(LD_PRELOAD_PATH "LD_PRELOAD=/usr/lib/${ARCH_TRIPLET}/mesa/libGL.so.1") |
92 | + endif() |
93 | + set(xvfbtestCommand |
94 | + ${LD_PRELOAD_PATH} |
95 | + LD_LIBRARY_PATH=${LD_PATH} |
96 | + xvfb-run --server-args "-screen 0 1024x768x24" --auto-servernum |
97 | + ${CMAKE_CURRENT_BINARY_DIR}/${CLASS_NAME}TestExec |
98 | + -o ${CMAKE_BINARY_DIR}/${CLASS_NAME}Test.xml,xunitxml |
99 | + -o -,txt) |
100 | + |
101 | + add_qmltest_target(xvfbtest${CLASS_NAME} "${xvfbtestCommand}" FALSE TRUE) |
102 | + add_dependencies(qmluitests xvfbtest${CLASS_NAME}) |
103 | + |
104 | + add_manual_qml_test(. ${CLASS_NAME} IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins) |
105 | +endmacro(add_binary_qml_test) |
106 | + |
107 | +macro(add_qmltest_target qmltest_TARGET qmltest_command qmltest_NO_TARGETS qmltest_NO_ADD_TEST) |
108 | add_custom_target(${qmltest_TARGET} ${qmltest_command}) |
109 | |
110 | if(NOT "${qmltest_PROPERTIES}" STREQUAL "") |
111 | @@ -130,5 +176,4 @@ |
112 | endif() |
113 | endif("${qmltest_NO_TARGETS}" STREQUAL "FALSE") |
114 | |
115 | - add_manual_qml_test(${SUBPATH} ${COMPONENT_NAME} ${ARGN}) |
116 | -endmacro(add_qml_test) |
117 | +endmacro(add_qmltest_target) |
118 | |
119 | === modified file 'tests/CMakeLists.txt' |
120 | --- tests/CMakeLists.txt 2013-07-04 14:47:47 +0000 |
121 | +++ tests/CMakeLists.txt 2014-04-02 12:13:20 +0000 |
122 | @@ -1,7 +1,7 @@ |
123 | -# QML tests that do not require graphical capabitlies. |
124 | +# QML tests that do not require graphical capabilities. |
125 | add_custom_target(qmlunittests) |
126 | |
127 | -# QML tests that require graphical capabitlies. |
128 | +# QML tests that require graphical capabilities. |
129 | add_custom_target(qmluitests) |
130 | |
131 | add_custom_target(qmltests) |
132 | |
133 | === modified file 'tests/plugins/Ubuntu/Gestures/CMakeLists.txt' |
134 | --- tests/plugins/Ubuntu/Gestures/CMakeLists.txt 2013-12-17 14:56:25 +0000 |
135 | +++ tests/plugins/Ubuntu/Gestures/CMakeLists.txt 2014-04-02 12:13:20 +0000 |
136 | @@ -15,20 +15,11 @@ |
137 | add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins") |
138 | |
139 | macro(add_gesture_ui_test CLASSNAME) |
140 | - set(testCommand |
141 | - LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures |
142 | - ${CMAKE_CURRENT_BINARY_DIR}/${CLASSNAME}TestExec |
143 | - -o ${CMAKE_BINARY_DIR}/${CLASSNAME}Test.xml,xunitxml |
144 | - -o -,txt) |
145 | - |
146 | - add_custom_target(test${CLASSNAME} ${testCommand}) |
147 | - add_dependencies(qmluitests test${CLASSNAME}) |
148 | - add_dependencies(test${CLASSNAME} ${CLASSNAME}TestExec UbuntuGesturesTestQmlFiles) |
149 | - |
150 | add_executable(${CLASSNAME}TestExec tst_${CLASSNAME}.cpp GestureTest.cpp) |
151 | qt5_use_modules(${CLASSNAME}TestExec Test Core Qml Gui Quick) |
152 | target_link_libraries(${CLASSNAME}TestExec UbuntuGestureQml) |
153 | - add_manual_qml_test(. ${CLASSNAME} IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins) |
154 | + |
155 | + add_binary_qml_test(${CLASSNAME} ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures UbuntuGesturesTestQmlFiles) |
156 | endmacro(add_gesture_ui_test) |
157 | |
158 | macro(add_gesture_test CLASSNAME) |
159 | |
160 | === modified file 'tests/qmltests/CMakeLists.txt' |
161 | --- tests/qmltests/CMakeLists.txt 2014-04-01 22:55:28 +0000 |
162 | +++ tests/qmltests/CMakeLists.txt 2014-04-02 12:13:20 +0000 |
163 | @@ -21,7 +21,6 @@ |
164 | |
165 | add_qml_test(. Shell IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks |
166 | ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/LightDM/single") |
167 | -add_manual_qml_test(Components DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins) |
168 | add_qml_test(Components Carousel) |
169 | add_qml_test(Components DraggingArea) |
170 | add_qml_test(Components EdgeDemoOverlay) |
171 | |
172 | === modified file 'tests/qmltests/Components/CMakeLists.txt' |
173 | --- tests/qmltests/Components/CMakeLists.txt 2013-12-17 14:56:25 +0000 |
174 | +++ tests/qmltests/Components/CMakeLists.txt 2014-04-02 12:13:20 +0000 |
175 | @@ -6,19 +6,11 @@ |
176 | ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
177 | ) |
178 | |
179 | -set(testCommand |
180 | - LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures |
181 | - ${CMAKE_CURRENT_BINARY_DIR}/DragHandleTestExec |
182 | - -o ${CMAKE_BINARY_DIR}/DragHandleTest.xml,xunitxml |
183 | - -o -,txt) |
184 | - |
185 | -add_custom_target(testDragHandle ${testCommand}) |
186 | -add_dependencies(qmluitests testDragHandle) |
187 | -add_dependencies(testDragHandle DragHandleTestExec) |
188 | - |
189 | add_executable(DragHandleTestExec tst_DragHandle.cpp) |
190 | qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick) |
191 | target_link_libraries(DragHandleTestExec UbuntuGestureQml) |
192 | |
193 | +add_binary_qml_test(DragHandle ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures "") |
194 | + |
195 | add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins") |
196 | add_definitions(-DTEST_DIR="${CMAKE_CURRENT_LIST_DIR}") |
197 | |
198 | === modified file 'tests/qmltests/Components/tst_LazyImage.qml' |
199 | --- tests/qmltests/Components/tst_LazyImage.qml 2014-03-21 10:48:42 +0000 |
200 | +++ tests/qmltests/Components/tst_LazyImage.qml 2014-04-02 12:13:20 +0000 |
201 | @@ -152,6 +152,7 @@ |
202 | |
203 | function test_lazyimage(data) { |
204 | data.func(); |
205 | + waitForRendering(baseRect); |
206 | |
207 | if (data.transition) { |
208 | // wait for the transition to complete |
FAILED: Continuous integration, rev:775 jenkins. qa.ubuntu. com/job/ unity8- ci/2537/ jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty/ 4022/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty- touch/3607/ console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- trusty/ 1407/console jenkins. qa.ubuntu. com/job/ unity8- trusty- amd64-ci/ 1058/console jenkins. qa.ubuntu. com/job/ unity8- trusty- armhf-ci/ 1062/console jenkins. qa.ubuntu. com/job/ unity8- trusty- i386-ci/ 1058/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- amd64/4063/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/3609/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/2537/ rebuild
http://