Re-enable all tests
ClosedPublic

Authored by rkflx on May 7 2017, 8:42 PM.

Details

Summary

documenttest: Port away from obsolete API.
documenttest: only compile when KDcraw is found
thumbnailprovidertest: Port to QUrl.
thumbnailprovidertest, documenttest: count remote tests as skipped when unavailable, instead of silently ignoring them (also: no more SkipSingle in Qt5)

Depends on D5749

Test Plan

documenttest:

  • Run documenttest: no failures, 5 skipped tests.
  • With GV_REMOTE_TESTS_BASE_URL set: ./gwenview-remote-tests/test.png created on remote host, no failures, 3 skipped tests.
  • Execute ./fetch_testing_raw.sh: no failures, 0 skipped tests.
  • Uninstall libkdcraw-devel: cmake mentions optional package not being found, documenttest not compiled.

thumbnailprovidertest:

  • Run thumbnailprovidertest: no failures, 1 skipped test.
  • With GV_REMOTE_TESTS_BASE_URL set: 0 skipped tests.

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rkflx created this revision.May 7 2017, 8:42 PM
ltoscano requested changes to this revision.May 10 2017, 9:37 PM
ltoscano added inline comments.
tests/auto/documenttest.cpp
30

Due to this include, this test should be compiled only if KDcraw is found

This revision now requires changes to proceed.May 10 2017, 9:37 PM
rkflx updated this revision to Diff 14421.May 11 2017, 7:31 PM
rkflx edited edge metadata.
rkflx edited the summary of this revision. (Show Details)
rkflx edited the test plan for this revision. (Show Details)

@ltoscano: Good catch (although nobody complained about it in the KDE4-version).

Diff was updated to:

  • only compile the documenttest when KDcraw is found
  • (NEW) count remote tests as skipped when unavailable, instead of silently ignoring them

Also: more detailed test plan.

rkflx marked an inline comment as done.May 11 2017, 7:33 PM
ltoscano accepted this revision.May 11 2017, 9:44 PM
In D5751#108858, @rkflx wrote:

@ltoscano: Good catch (although nobody complained about it in the KDE4-version).

Eh, it happens.

Thanks!

This revision is now accepted and ready to land.May 11 2017, 9:44 PM
ltoscano requested changes to this revision.May 11 2017, 10:00 PM

I do apologize, I thought that I tested this with libkdcraw this time, but I didn't. documenttest is failing for me, and specifically here:

FAIL! : DocumentTest::testMetaInfoBmp() Compared values are not the same

Actual   (value)        : "200\u00D7100"
Expected (expectedValue): "200x100"
Loc: [/home/devel/git.kde.org/kde/kdegraphics/gwenview/tests/auto/documenttest.cpp(603)]

Few tests are skipped with " Not running this test: failed to get image. Try running ./fetch_testing_raw.sh in the tests/data directory and then rerun the tests", but this is a separate issues and not a regression, I'm reporting it just for the record but I'd say that it's out of scope for this change.

This revision now requires changes to proceed.May 11 2017, 10:00 PM

FAIL! : DocumentTest::testMetaInfoBmp() Compared values are not the same

Actual   (value)        : "200\u00D7100"
Expected (expectedValue): "200x100"
Loc: [/home/devel/git.kde.org/kde/kdegraphics/gwenview/tests/auto/documenttest.cpp(603)]

Works for me™ – just tested again with current gwenview git master + this diff on both of these platforms:

  • AMD64 Tumbleweed (Qt 5.7.1)
  • i386 Ubuntu 16.04 (Qt 5.6.1)

Therefore unlikely a problem with the patch, rather a more serious problem with an underlying library.

What platform are you on? Can you open BMP files with Gwenview? Not sure ATM what library Qt is using for BMP handling, which might explain the difference (in the test, metadata.bmp is created through creating an QImage and saving it to disk). KDE's CI [1] seems to be on Qt 5.7.0.

[1] https://build.kde.org/job/gwenview%20master%20kf5-qt5/lastBuild/PLATFORM=Linux,compiler=gcc/testReport/(root)/TestSuite/

Few tests are skipped with " Not running this test: failed to get image. Try running ./fetch_testing_raw.sh in the tests/data directory and then rerun the tests", but this is a separate issues and not a regression, I'm reporting it just for the record but I'd say that it's out of scope for this change.

That's kind of expected. The script (to be run manually after setting up the git repo locally) will download three rather large (~27MB) RAW images, which surely do not belong in the git repo. As I understand it, they are meant as an optional test (similarly to the remote tests). Note: Running the script as ./tests/data/*.sh does not work, it has to be ./*.sh as stated in the warning message.

ltoscano accepted this revision.May 13 2017, 9:12 AM

Uhm, really strange. I had consistently failures. After reapplying the patch, recompiling and retrying, documenttest consistently works!
The environment was/is a current Debian testing (stretch), so Qt 5.7.1.

This revision is now accepted and ready to land.May 13 2017, 9:12 AM
This revision was automatically updated to reflect the committed changes.
rkflx added a comment.May 13 2017, 7:34 PM

To be on the safe side (and out of curiosity…), I looked into this some more:

You got "\u00D7" (unicode character for the multiplication sign, aka "×") instead of a normal lower-case letter "x" supposed to be created by the line of gwenview code in [2]. In this regard, the comment about Qt's BMP handling turns out to be more of a red herring. As your Qt version is the same as mine and you probably didn't change your KF5 version, those are also not likely to affect the propagation of the character from the call of i18nc() to the actual test.

Next, let's assume there was no compiler bug (version kept constant between runs) and no hardware issue (large hamming distance between bit representations of both characters, different length too – 2 vs. 1 byte). The only plausible explanation left is direct modification of [2], e.g. a stale patch or a search-and-replace job gone wild.

Anyway, glad you got it sorted out!

[2] https://phabricator.kde.org/source/gwenview/browse/master/lib/imagemetainfomodel.cpp;7dc3595d8c452f5342775e7daa83e39a0503ce6c$336