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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Lukáš Tinkl
Approved revision: 2114
Merged at revision: 2146
Proposed branch: lp:~aacid/unity8/card_test_precision
Merge into: lp:unity8
Diff against target: 25 lines (+3/-5)
1 file modified
tests/qmltests/Dash/tst_Card.qml (+3/-5)
To merge this branch: bzr merge lp:~aacid/unity8/card_test_precision
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity8 CI Bot continuous-integration Pending
Review via email: mp+282425@code.launchpad.net

Commit message

Card test: Limit the precision we ask for doubles to be equal

The test that dividies by 0.7 was failing on i386 because
       Actual (): 434.2858326192127
       Expected (): 434.28571428571433
we don't need that much precision on pixels, so limit that test to 2 decimals, which is more than enough really

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?
N/A

 * Did you make sure that your branch does not contain spurious tags?
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
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2114
http://jenkins.qa.ubuntu.com/job/unity8-ci/7052/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6004
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/467/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1757
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/460
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1652
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1652
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/459
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/458
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4639
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6015
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6015/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26601
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/215/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/465
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/465/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26602

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7052/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

LGTM, fixes the test here locally

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

Yes

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

No regressions

* Did you make sure that the branch does not contain spurious tags?

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_Card.qml'
2--- tests/qmltests/Dash/tst_Card.qml 2015-11-06 11:51:17 +0000
3+++ tests/qmltests/Dash/tst_Card.qml 2016-01-13 11:43:03 +0000
4@@ -306,8 +306,8 @@
5 { tag: "Medium", width: units.gu(18), fill: Image.PreserveAspectCrop, index: 0 },
6 { tag: "Small", width: units.gu(12), index: 1 },
7 { tag: "Large", width: units.gu(38), index: 2 },
8- { tag: "Wide", height: units.gu(19), size: "large", index: 3 },
9- { tag: "Tall", height: units.gu(38) / 0.7, size: "large", width: units.gu(38), index: 4 },
10+ { tag: "Wide", height: function() { return units.gu(19) }, size: "large", index: 3 },
11+ { tag: "Tall", height: function() { return units.gu(38) / 0.7 }, size: "large", width: units.gu(38), index: 4 },
12 { tag: "VerticalWidth", width: function() { return headerRow.width + units.gu(1) }, index: 0 },
13 { tag: "HorizontalHeight", height: function() { return headerRow.height + units.gu(1) * 2 }, index: 5 },
14 { tag: "HorizontalWidth", width: function() { return headerRow.x - units.gu(1) }, index: 5 },
15@@ -336,9 +336,7 @@
16 }
17
18 if (data.hasOwnProperty("height")) {
19- if (typeof data.height === "function") {
20- tryCompareFunction(function() { return art.height === data.height() }, true);
21- } else tryCompare(art, "height", data.height);
22+ tryCompareFunction(function() { return art.height.toFixed(2) === data.height().toFixed(2) }, true);
23 }
24
25 if (data.hasOwnProperty("fill")) {

Subscribers

People subscribed via source and target branches