Merge lp:~mterry/unity8/robustify-tutorial-qmltests into lp:unity8

Proposed by Michael Terry
Status: Merged
Approved by: Michael Terry
Approved revision: 2443
Merged at revision: 2480
Proposed branch: lp:~mterry/unity8/robustify-tutorial-qmltests
Merge into: lp:unity8
Prerequisite: lp:~mterry/unity8/tutorial-fixups
Diff against target: 104 lines (+18/-21)
1 file modified
tests/qmltests/Tutorial/tst_Tutorial.qml (+18/-21)
To merge this branch: bzr merge lp:~mterry/unity8/robustify-tutorial-qmltests
Reviewer Review Type Date Requested Status
Albert Astals Cid Pending
Unity8 CI Bot continuous-integration Pending
Review via email: mp+297070@code.launchpad.net

This proposal supersedes a proposal from 2016-06-09.

Commit message

Make tutorial qmltests more robust.

Use the tutorial Loader objects instead of the tutorial objects themselves when checking that the tutorial objects are hidden or shown.

Individual tutorial objects are unloaded when they have been completed and their hide animations are done running. But their loaders are always available.

Individual tutorial objects used to always be available. But when I refactored things a little while ago, I changed that and didn't update the tests because I didn't notice the race I had created.

The race happens because when the tests do "swipe to dismiss tutorial" and then check that the tutorial is !shown, if we finish the hide animation first and unload the object, the check will fail.

So instead, check the loaders for shown/hidden state.

Description of the change

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

 * Did you perform an exploratory manual test run of your code change and any related functionality?
 Yes, ran it in a loop for a while under heavy load.

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 NA

 * If you changed the UI, has there been a design review?
 NA

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

FAILED: Continuous integration, rev:2442
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1454/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/1932
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/992
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/992
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/992
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1958
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1893
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1893
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1893
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1884/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

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

* Did CI run pass?
No totally but fail not related to this code.

review: Approve
Revision history for this message
Michael Terry (mterry) wrote :

I rebased on tutorial-fixups. Re-top-approving.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/qmltests/Tutorial/tst_Tutorial.qml'
2--- tests/qmltests/Tutorial/tst_Tutorial.qml 2016-06-10 14:47:12 +0000
3+++ tests/qmltests/Tutorial/tst_Tutorial.qml 2016-06-10 14:47:12 +0000
4@@ -528,10 +528,10 @@
5 // Test that we skip the tutorial if user uses top edge themselves
6
7 var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
8- var tutorialTop = findChild(shell, "tutorialTop");
9+ var tutorialTopLoader = findChild(shell, "tutorialTopLoader");
10 AccountsService.demoEdgesCompleted = ["left"];
11 tryCompare(tutorialLeftLoader, "active", false);
12- verify(!tutorialTop.shown);
13+ verify(!tutorialTopLoader.shown);
14
15 touchFlick(shell, halfWidth, 0, halfWidth, shell.height);
16 tryCompare(AccountsService, "demoEdgesCompleted", ["left", "top"]);
17@@ -584,8 +584,8 @@
18 function test_tutorialRightDelay() {
19 // Test that if we exit the top tutorial, we don't immediately
20 // jump into right tutorial.
21- var tutorialRight = findChild(shell, "tutorialRight");
22- var tutorialRightTimer = findInvisibleChild(tutorialRight, "tutorialRightTimer");
23+ var tutorialRightLoader = findChild(shell, "tutorialRightLoader");
24+ var tutorialRightTimer = findInvisibleChild(tutorialRightLoader, "tutorialRightTimer");
25
26 openTutorialTop();
27 ApplicationManager.startApplication("gallery-app");
28@@ -595,9 +595,9 @@
29
30 AccountsService.demoEdgesCompleted = ["left", "top", "left-long"];
31 verify(tutorialRightTimer.running);
32- verify(!tutorialRight.shown);
33+ verify(!tutorialRightLoader.shown);
34 tutorialRightTimer.interval = 1;
35- tryCompare(tutorialRight, "shown", true);
36+ tryCompare(tutorialRightLoader, "shown", true);
37 }
38
39 function test_tutorialRightAutoSkipped() {
40@@ -691,25 +691,25 @@
41 function test_desktopTutorialRightFinish() {
42 loadShell("desktop");
43
44- var tutorialRight = findChild(shell, "tutorialRight");
45- var tutorialRightTimer = findInvisibleChild(tutorialRight, "tutorialRightTimer");
46+ var tutorialRightLoader = findChild(shell, "tutorialRightLoader");
47+ var tutorialRightTimer = findInvisibleChild(tutorialRightLoader, "tutorialRightTimer");
48 tutorialRightTimer.interval = 1;
49 ApplicationManager.startApplication("dialer-app");
50 ApplicationManager.startApplication("camera-app");
51 ApplicationManager.startApplication("facebook-webapp");
52- tryCompare(tutorialRight, "shown", true);
53+ tryCompare(tutorialRightLoader, "shown", true);
54
55 var stage = findChild(shell, "stage");
56 mouseMove(shell, shell.width, shell.height / 2);
57 stage.pushRightEdge(units.gu(8));
58- tryCompare(tutorialRight, "shown", false);
59+ tryCompare(tutorialRightLoader, "shown", false);
60
61 tryCompare(AccountsService, "demoEdges", false);
62 }
63
64 function test_oskDoesNotHideTutorial() {
65- var tutorialLeft = findChild(shell, "tutorialLeft");
66- verify(tutorialLeft.shown);
67+ var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
68+ verify(tutorialLeftLoader.shown);
69
70 var surface = SurfaceManager.inputMethodSurface;
71 surface.setState(Mir.RestoredState);
72@@ -717,7 +717,7 @@
73 var inputMethod = findInvisibleChild(shell, "inputMethod");
74 tryCompare(inputMethod, "state", "shown");
75
76- verify(tutorialLeft.shown);
77+ verify(tutorialLeftLoader.shown);
78 }
79
80 function test_oskDelaysTutorial() {
81@@ -777,18 +777,15 @@
82 }
83
84 function test_accountsServiceSettings() {
85- var tutorialLeft = findChild(shell, "tutorialLeft");
86- verify(tutorialLeft != null);
87- verify(tutorialLeft.shown);
88+ var tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
89+ verify(tutorialLeftLoader.shown);
90
91 AccountsService.demoEdges = false;
92- verify(findChild(shell, "tutorialLeft") == null);
93+ verify(findChild(shell, "tutorialLeftLoader") == null);
94
95 AccountsService.demoEdges = true;
96- tutorialLeft = findChild(shell, "tutorialLeft");
97- verify(tutorialLeft != null);
98-
99- var tutorialLeftTimer = findChild(tutorialLeft, "tutorialLeftTimer");
100+ tutorialLeftLoader = findChild(shell, "tutorialLeftLoader");
101+ var tutorialLeftTimer = findChild(tutorialLeftLoader, "tutorialLeftTimer");
102 verify(tutorialLeftTimer.running);
103 }
104 }

Subscribers

People subscribed via source and target branches