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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michael Zanetti
Approved revision: 2494
Merged at revision: 2523
Proposed branch: lp:~aacid/unity8/rework_tst_PreviewRatingDisplayCreationRanges
Merge into: lp:unity8
Diff against target: 116 lines (+55/-19)
1 file modified
tests/qmltests/Dash/Previews/tst_PreviewRatingDisplayCreationRanges.qml (+55/-19)
To merge this branch: bzr merge lp:~aacid/unity8/rework_tst_PreviewRatingDisplayCreationRanges
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
Unity8 CI Bot continuous-integration Needs Fixing
Review via email: mp+298130@code.launchpad.net

Commit message

Rework tst_PreviewRatingDisplayCreationRanges

Remove the time comparison and actually check that only a small amount of items is being created

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
Michael Zanetti (mzanetti) wrote :

test passing locally here. makes sense to me

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

FAILED: Continuous integration, rev:2493
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1592/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2117
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1112
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1112
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1112
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2145
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2055
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2055
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2055
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2046
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2046/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2046
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2046/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2046
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2046/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2046
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2046/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2046
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2046/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2046
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2046/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2046
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2046/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2046
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2046/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2046
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2046/artifact/output/*zip*/output.zip

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

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

Don't check for an exact number but for <= 20 delegates created

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

FAILED: Continuous integration, rev:2494
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1599/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2126
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1118
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1118
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1118
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2154
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2063
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2063
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2063
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2054
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2054/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2054
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2054/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2054
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2054/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2054
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2054/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2054
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2054/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2054
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2054/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2054
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2054/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2054
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2054/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2054
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2054/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

ok. this test passing in jenkins now too. top-approving

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewRatingDisplayCreationRanges.qml'
--- tests/qmltests/Dash/Previews/tst_PreviewRatingDisplayCreationRanges.qml 2015-11-27 08:12:46 +0000
+++ tests/qmltests/Dash/Previews/tst_PreviewRatingDisplayCreationRanges.qml 2016-06-23 08:20:54 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2014,2015 Canonical Ltd.2 * Copyright 2014-2016 Canonical Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by5 * it under the terms of the GNU General Public License as published by
@@ -42,6 +42,8 @@
42 parentFlickable: root42 parentFlickable: root
43 }43 }
4444
45 property int createdDelegates: 0
46
45 Component.onCompleted: {47 Component.onCompleted: {
46 for (var i = 0; i < 500; ++i) {48 for (var i = 0; i < 500; ++i) {
47 widgetData500.reviews.push({ author: "Some dude", review: "Very cool app" + i });49 widgetData500.reviews.push({ author: "Some dude", review: "Very cool app" + i });
@@ -49,37 +51,68 @@
49 factory.widgetData = widgetData500;51 factory.widgetData = widgetData500;
50 }52 }
5153
54 Component {
55 id: countingPreviewRatingSingleDisplayComponent
56 PreviewRatingSingleDisplay {
57 objectName: "reviewItem" + index
58
59 anchors { left: parent.left; right: parent.right; }
60
61 rating: modelData["rating"] || -1
62 author: modelData["author"] || ""
63 review: modelData["review"] || ""
64 Component.onCompleted: root.createdDelegates++;
65 }
66 }
67
52 UT.UnityTestCase {68 UT.UnityTestCase {
53 name: "PreviewRatingDisplayTest"69 name: "PreviewRatingDisplayCreationRangesTest"
54 when: windowShown70 when: windowShown
5571
56 function test_creation_speed() {72 function initTestCase() {
73 var lists = findChildsByType(factory, "QQuickListView");
74 compare(lists.length, 1)
75 lists[0].delegate = countingPreviewRatingSingleDisplayComponent;
76 }
77
78 function test_check_delegate_creation_range() {
79 // Clear the reviews
80 factory.widgetData = reviewsEmpty;
81 waitForRendering(root);
82
83 // Unset parentFlickable this disables the creation range code
57 factory.parentFlickable = null;84 factory.parentFlickable = null;
58 factory.widgetData = reviewsEmpty;85 root.createdDelegates = 0;
59 waitForRendering(root);
6086
61 var start = new Date().getTime();87 // Set the 500 reviews data
62 factory.widgetData = widgetData500;88 factory.widgetData = widgetData500;
63 waitForRendering(root);89 waitForRendering(root);
64 var end = new Date().getTime();90
65 var time500 = end - start;91 // Check we have created 500 delegates
6692 compare(root.createdDelegates, 500);
93
94 // Check review 499 has been created
95 var reviewItem499 = findChild(factory, "reviewItem499");
96 verify(reviewItem499 !== null);
97
98 // Clear the reviews
67 factory.widgetData = reviewsEmpty;99 factory.widgetData = reviewsEmpty;
68 waitForRendering(root);100 waitForRendering(root);
69101
102 // set parentFlickable to enable the creation ranges code
70 factory.parentFlickable = root;103 factory.parentFlickable = root;
71 start = new Date().getTime();104 root.createdDelegates = 0;
105
106 // Set the 500 reviews data
72 factory.widgetData = widgetData500;107 factory.widgetData = widgetData500;
73 waitForRendering(root);108 waitForRendering(root);
74 end = new Date().getTime();109
75 var timeRanges500 = end - start;110 // Check we have only created a few delegates
76111 // For some reason xenial and yaketti we get 16 and on vivid 15 so
77 // Measurements show it's usually like 20 times faster112 // settle for <= 20
78 // but we set the range at 8 times fast to make sure it's not an unstable test113 expectFailContinue("", "Should not create more than 20 delegates when using ranges");
79 verify(timeRanges500 * 8 < time500);114 tryCompareFunction(function() { return root.createdDelegates > 20 }, true);
80 }115
81
82 function test_check_indexes() {
83 // Check that item 499 isn't there on startup but if we scroll down116 // Check that item 499 isn't there on startup but if we scroll down
84 // it will be there117 // it will be there
85 var reviewItem499 = findChild(factory, "reviewItem499");118 var reviewItem499 = findChild(factory, "reviewItem499");
@@ -89,6 +122,9 @@
89122
90 var reviewItem499 = findChild(factory, "reviewItem499");123 var reviewItem499 = findChild(factory, "reviewItem499");
91 verify(reviewItem499 !== null);124 verify(reviewItem499 !== null);
125
126 // Check we have created 500 delegates
127 compare(root.createdDelegates, 500);
92 }128 }
93 }129 }
94}130}

Subscribers

People subscribed via source and target branches