Merge lp:~aacid/unity8/tests_wait_time_step into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Josh Arenson
Approved revision: 2698
Merged at revision: 2730
Proposed branch: lp:~aacid/unity8/tests_wait_time_step
Merge into: lp:unity8
Diff against target: 79 lines (+11/-10)
3 files modified
tests/qmltests/Dash/tst_Dash.qml (+4/-3)
tests/qmltests/Launcher/tst_Launcher.qml (+3/-3)
tests/utils/modules/Unity/Test/UnityTestCase.qml (+4/-4)
To merge this branch: bzr merge lp:~aacid/unity8/tests_wait_time_step
Reviewer Review Type Date Requested Status
Josh Arenson Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+311383@code.launchpad.net

Commit message

Use timeStep as delay time

Passing iterations / speed didn't make much sense since that parameter is a delay in milliseconds and the default parameters would give a value of 5 / units.gu(10) that is smaller than 1 millisecond.

Qt 5.7 calculation for velocity was very unhappy if we moved things so fast in less than 1ms and ignored the movements, so this also makes tests pass on Qt 5.7

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

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

 * 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/A

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2697
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2518/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3323
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1901
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1901
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/1901
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3351
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3203
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3203/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3203
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3203/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3203
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3203/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3203
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3203/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3203
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3203/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3203
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3203/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3203
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3203/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3203
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3203/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3203
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3203/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2518/rebuild

review: Needs Fixing (continuous-integration)
2698. By Albert Astals Cid

Need this for the tests to pass locally after new chnage

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2698
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2519/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3324
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1902
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1902
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/1902
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3352
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3204
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3204/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3204
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3204/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3204
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3204/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3204
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3204/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3204
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3204/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3204
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3204/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3204
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3204/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3204
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3204/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3204
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3204/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2519/rebuild

review: Approve (continuous-integration)
Revision history for this message
Josh Arenson (josharenson) wrote :

LGTM, but I want to test with 5.7 still...

Revision history for this message
Josh Arenson (josharenson) wrote :

* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes, tests fail on Qt 5.7 without this patch

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

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
2--- tests/qmltests/Dash/tst_Dash.qml 2016-09-22 10:33:39 +0000
3+++ tests/qmltests/Dash/tst_Dash.qml 2016-11-21 14:10:49 +0000
4@@ -310,8 +310,9 @@
5 var stopX = units.gu(1)
6 var stopY = startY;
7 waitForRendering(dashContentList)
8- mouseFlick(dash, startX, startY, stopX, stopY);
9- mouseFlick(dash, startX, startY, stopX, stopY);
10+ mouseFlick(dash, startX, startY, stopX, stopY, true, true, units.gu(200));
11+ compare(dashContentList.currentIndex, 1, "Could not flick to scope id 1");
12+ mouseFlick(dash, startX, startY, stopX, stopY, units.gu(200));
13 compare(dashContentList.currentIndex, 2, "Could not flick to scope id 2");
14 var dashCommunicatorService = findInvisibleChild(dash, "dashCommunicatorService");
15 dashCommunicatorService.mockSetCurrentScope(0, true, false);
16@@ -411,7 +412,7 @@
17 compare(dashContentList.currentItem.scopeId, "clickscope");
18
19 // Move to second scope
20- mouseFlick(dash, dash.width / 2, units.gu(2), dash.width / 5, units.gu(2));
21+ mouseFlick(dash, dash.width / 2, units.gu(2), dash.width / 5, units.gu(2), true, true, units.gu(20));
22 tryCompare(dashContentList, "currentIndex", 1);
23 compare(dashContentList.currentItem.scopeId, "MockScope1");
24 }
25
26=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
27--- tests/qmltests/Launcher/tst_Launcher.qml 2016-10-13 04:26:22 +0000
28+++ tests/qmltests/Launcher/tst_Launcher.qml 2016-11-21 14:10:49 +0000
29@@ -813,7 +813,7 @@
30
31 // Dragging a bit (> 1.5 gu)
32 newMouseX -= units.gu(2)
33- mouseFlick(launcher, currentMouseX, currentMouseY, newMouseX, newMouseY, false, false, 100)
34+ mouseFlick(launcher, currentMouseX, currentMouseY, newMouseX, newMouseY, false, false)
35 currentMouseX = newMouseX
36
37 // Other items need to expand and become 0.6 opaque
38@@ -821,8 +821,8 @@
39 tryCompare(item0, "itemOpacity", 0.6)
40
41 // Dragging a bit more
42- newMouseY += initialItemHeight * 1.5
43- mouseFlick(launcher, currentMouseX, currentMouseY, newMouseX, newMouseY, false, false, 100)
44+ newMouseY += initialItemHeight * 1.25
45+ mouseFlick(launcher, currentMouseX, currentMouseY, newMouseX, newMouseY, false, false)
46 currentMouseY = newMouseY
47
48 tryCompare(findChild(draggedItem, "dropIndicator"), "opacity", 1)
49
50=== modified file 'tests/utils/modules/Unity/Test/UnityTestCase.qml'
51--- tests/utils/modules/Unity/Test/UnityTestCase.qml 2016-05-27 13:54:07 +0000
52+++ tests/utils/modules/Unity/Test/UnityTestCase.qml 2016-11-21 14:10:49 +0000
53@@ -163,9 +163,9 @@
54 if (i === iterations - 1) {
55 // Avoid any rounding errors by making the last move be at precisely
56 // the point specified
57- mouseMove(item, toX, toY, iterations / speed)
58+ mouseMove(item, toX, toY, timeStep)
59 } else {
60- mouseMove(item, x + (i + 1) * diffX, y + (i + 1) * diffY, iterations / speed)
61+ mouseMove(item, x + (i + 1) * diffX, y + (i + 1) * diffY, timeStep)
62 }
63 }
64 if (releaseMouse) {
65@@ -346,12 +346,12 @@
66 if (i === iterations - 1) {
67 // Avoid any rounding errors by making the last move be at precisely
68 // the point specified
69- wait(iterations / speed)
70+ wait(timeStep)
71 var event = touchEvent(item)
72 event.move(0 /* touchId */, rootTo.x, rootTo.y)
73 event.commit()
74 } else {
75- wait(iterations / speed)
76+ wait(timeStep)
77 var event = touchEvent(item)
78 event.move(0 /* touchId */, rootFrom.x + (i + 1) * diffX, rootFrom.y + (i + 1) * diffY)
79 event.commit()

Subscribers

People subscribed via source and target branches