Adapt PlacesItemModelTest to Tag Places
AbandonedPublic

Authored by elvisangelaccio on May 4 2019, 4:31 PM.

Details

Reviewers
None
Group Reviewers
Dolphin
Baloo
Summary

The Tag Places feature in recent KIO broke this test.

This patch uses a KCoreDirLister to detect whether the user has created
some tags, and adapts the failing tests accordingly.

Test Plan

Run placesitemmodeltest after creating some tags.

Diff Detail

Repository
R318 Dolphin
Branch
Applications/19.04
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11541
Build 11559: arc lint + arc unit
elvisangelaccio created this revision.May 4 2019, 4:31 PM
Restricted Application added a project: Dolphin. · View Herald TranscriptMay 4 2019, 4:31 PM
Restricted Application added a subscriber: kfm-devel. · View Herald Transcript
elvisangelaccio requested review of this revision.May 4 2019, 4:31 PM

@bruns I noticed that KIO's kfileplacesmodeltest ignores user tags. In the test output I see:

tag fetch failed: "Failed to open the database"
"tags:/" list() invalid url

Both dolphin's placesitemmodeltest and KIO's kfileplacesmodeltest use QStandardPaths::setTestModeEnabled(true);, so I'd expect the dolphin test to ignore tag URLs too. Any idea what could be going on here?

Ah, got it. The KIO test uses a QTemporaryDir as $HOME and forks the tag slave:

qputenv("HOME", m_tmpHome.path().toUtf8()); // use a empty home dir
qputenv("KDE_FORK_SLAVES", "yes"); // to avoid a runtime dependency on klauncher

We should probably do the same in dolphin. A test binary should not have access to the user's baloo DB...

bruns added a comment.May 5 2019, 6:30 PM

Whoever had the "brilliant" idea of using the tags ioslave to query the tags ... this is *NOT* API.