Run "kiofilewidgets-kfileplacesmodeltest" make sure that "testRemoteUrls" is passing
Details
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Hmm, still seems to fail here:
$ ctest -R kfileplacesmodeltest Test project /home/elvis/dev/kde/kio/local-build Start 50: kiofilewidgets-kfileplacesmodeltest 1/1 Test #50: kiofilewidgets-kfileplacesmodeltest ...***Failed 0.60 sec ********* Start testing of KFilePlacesModelTest ********* Config: Using QtTest library 5.11.0, Qt 5.11.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.1.0) QDEBUG : KFilePlacesModelTest::initTestCase() void Solid::Backends::Fake::FakeManager::parseMachineFile() Parsing fake computer XML: "/home/elvis/dev/kde/kio/autotests/fakecomputer.xml" PASS : KFilePlacesModelTest::initTestCase() FAIL! : KFilePlacesModelTest::testInitialState() Compared values are not the same Actual (m_places->rowCount()): 6 Expected (4) : 4 Loc: [../autotests/kfileplacesmodeltest.cpp(200)] QDEBUG : KFilePlacesModelTest::testInitialList() Expected: ("/home/elvis", "/", "trash:/", "remote:/", "/media/nfs", "/foreign", "/media/floppy0", "/media/XO-Y4", "/media/cdrom") QDEBUG : KFilePlacesModelTest::testInitialList() Got: ("/home/elvis", "/home/elvis/Desktop", "/home/elvis/Downloads", "/", "trash:/", "remote:/") FAIL! : KFilePlacesModelTest::testInitialList() Compared lists have different sizes. Actual (placesUrls()) size: 6 Expected (urls) size: 9 Loc: [../autotests/kfileplacesmodeltest.cpp(236)]
That's a different test (from the same file). That part of the test assumes that you have a clean home directory. I run this tests with a wrapper, something like:
HOMETMP=$(mktemp -d)
trap 'rm -rf $HOMETMP' EXIT
export HOME="$HOMETMP"
xvfb-run -a dbus-run-session -- obj-x86_64-linux-gnu/bin/kfileplacesmodeltest
The complete version can be seen here:
https://salsa.debian.org/qt-kde-team/kde/kio/tree/master/debian/tests
That's after applying the patches:
https://salsa.debian.org/qt-kde-team/kde/kio/tree/master/debian/patches
The Debian test results can be seen here:
https://ci.debian.net/data/autopkgtest/unstable/amd64/k/kio/342727/log.gz
There is an error in a different part of this test, it seems that kio strips the -full part of the trash icon name but not always. (see src/filewidgets/kfileplacesitem.cpp : 418)
kiofilewidgets-kfileplacesmodeltest still fails for me with this patch:
grep 'FAIL! : KFilePlacesModelTest' -A 3 Testing/Temporary/LastTest.log FAIL! : KFilePlacesModelTest::testInitialState() Compared values are not the same Actual (m_places->rowCount()): 6 Expected (4) : 4 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(200)] -- FAIL! : KFilePlacesModelTest::testInitialList() Compared lists have different sizes. Actual (placesUrls()) size: 6 Expected (urls) size: 9 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(236)] -- FAIL! : KFilePlacesModelTest::testReparse() Compared lists have different sizes. Actual (placesUrls()) size: 7 Expected (urls) size: 10 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(252)] -- FAIL! : KFilePlacesModelTest::testMove() Compared lists have different sizes. Actual (placesUrls()) size: 7 Expected (urls) size: 9 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(396)] -- FAIL! : KFilePlacesModelTest::testPlacesLifecycle() Compared lists have different sizes. Actual (placesUrls()) size: 8 Expected (urls) size: 10 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(552)] -- FAIL! : KFilePlacesModelTest::testDevicePlugging() Compared lists differ at index 1. Actual (placesUrls()): "/home/dev/Downloads" Expected (urls): "/" Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(665)] -- FAIL! : KFilePlacesModelTest::testDragAndDrop() Compared lists have different sizes. Actual (placesUrls()) size: 8 Expected (urls) size: 9 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(472)] FAIL! : KFilePlacesModelTest::testDeviceSetupTeardown() Compared values are not the same Actual (spy_changed.count()): 0 Expected (1) : 1 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(786)] -- FAIL! : KFilePlacesModelTest::testRemoteUrls(Ftp) Compared lists have different sizes. Actual (placesUrls()) size: 9 Expected (urls) size: 10 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(853)] -- FAIL! : KFilePlacesModelTest::testRemoteUrls(Samba) Compared lists differ at index 2. Actual (placesUrls()): "/home/dev/Downloads" Expected (urls): "trash:/" Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(853)] -- FAIL! : KFilePlacesModelTest::testRemoteUrls(Sftp) Compared lists have different sizes. Actual (placesUrls()) size: 11 Expected (urls) size: 10 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(853)] -- FAIL! : KFilePlacesModelTest::testRemoteUrls(Fish) Compared lists have different sizes. Actual (placesUrls()) size: 12 Expected (urls) size: 10 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(853)] -- FAIL! : KFilePlacesModelTest::testRemoteUrls(Webdav) Compared lists have different sizes. Actual (placesUrls()) size: 13 Expected (urls) size: 10 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(853)] -- FAIL! : KFilePlacesModelTest::testIconRole(Places - Trash) 'index.data(KFilePlacesModel::IconNameRole).toString().startsWith(expectedIconName)' returned FALSE. () Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(999)] FAIL! : KFilePlacesModelTest::testIconRole(Remote - Network) 'index.data(KFilePlacesModel::IconNameRole).toString().startsWith(expectedIconName)' returned FALSE. () Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(999)] FAIL! : KFilePlacesModelTest::testIconRole(Devices - Nfs) 'index.data(KFilePlacesModel::IconNameRole).toString().startsWith(expectedIconName)' returned FALSE. () Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(999)] FAIL! : KFilePlacesModelTest::testIconRole(Devices - foreign) 'index.data(KFilePlacesModel::IconNameRole).toString().startsWith(expectedIconName)' returned FALSE. () Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(999)] FAIL! : KFilePlacesModelTest::testIconRole(Devices - Floppy) 'index.data(KFilePlacesModel::IconNameRole).toString().startsWith(expectedIconName)' returned FALSE. () Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(999)] FAIL! : KFilePlacesModelTest::testIconRole(Devices - cdrom) 'index.data(KFilePlacesModel::IconNameRole).toString().startsWith(expectedIconName)' returned FALSE. () Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(999)] FAIL! : KFilePlacesModelTest::testMoveFunction() Compared lists have different sizes. Actual (placesUrls()) size: 13 Expected (urls) size: 9 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(1016)] -- FAIL! : KFilePlacesModelTest::testPlaceGroupHidden() Compared lists have different sizes. Actual (placesUrls()) size: 13 Expected (urls) size: 9 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(1090)] -- FAIL! : KFilePlacesModelTest::testPlaceGroupHiddenAndShownWithHiddenChild() Compared lists have different sizes. Actual (placesUrls()) size: 13 Expected (urls) size: 9 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(1157)] FAIL! : KFilePlacesModelTest::testPlaceGroupHiddenGroupIndexesIntegrity() Compared values are not the same Actual (m_places->groupIndexes(KFilePlacesModel::PlacesType).count()): 7 Expected (initialListOfPlaces().count()) : 3 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(1193)] -- FAIL! : KFilePlacesModelTest::testPlaceGroupHiddenRole() Compared values are not the same Actual (index.data(KFilePlacesModel::GroupHiddenRole).toBool()): 1 Expected (false) : 0 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(1241)] -- FAIL! : KFilePlacesModelTest::testFilterWithAlternativeApplicationName() Compared lists have different sizes. Actual (placesUrls()) size: 13 Expected (urls) size: 9 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(1282)] FAIL! : KFilePlacesModelTest::testSupportedSchemes() Compared lists have different sizes. Actual (placesUrls()) size: 17 Expected (initialListOfUrls()) size: 9 Loc: [/home/dev/repos/kio/autotests/kfileplacesmodeltest.cpp(1295)]
as maximilianocuria said, before run the tests you need to create a temporary home path:
HOMETMP=$(mktemp -d)
trap 'rm -rf $HOMETMP' EXIT
export HOME="$HOMETMP"
this test expect an empty home path.
Shouldn't that be a part of the test itself? I don't think it's reasonable to require that testers and testing platforms manually run that every time.
I am not sure, this is how this test works, I never changed that. Maybe ask the maintainers guys.
Shouldn't this be handled by:
http://doc.qt.io/qt-5/qstandardpaths.html#setTestModeEnabled
this is different "setTestModeEnabled" sets the XDG_* dirs but the KIO tests expects an empty home dir without subfolders like Downloads, Documents, etc..