add simple test rig for service runner
ClosedPublic

Authored by sitter on Dec 16 2016, 3:43 PM.

Details

Summary
  • make sure that chrome apps have lower relevance than chrome itself
  • makes sure that konsole has higher relevance than yakuake (latter only references onsole in the comment entry)
Test Plan
  • it passes and at a glance doesn't seem to break my production sycoca

Would be cool if @dfaure could take a look at the ksycoca setup to make sure the test doesn't negatively impact the production cache.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sitter updated this revision to Diff 9088.Dec 16 2016, 3:43 PM
sitter retitled this revision from to add simple test rig for service runner.
sitter updated this object.
sitter edited the test plan for this revision. (Show Details)
sitter added reviewers: broulik, dfaure.
sitter added subscribers: plasma-devel, dfaure.
Restricted Application added a project: Plasma. · View Herald TranscriptDec 16 2016, 3:43 PM
dfaure requested changes to this revision.Dec 16 2016, 9:44 PM
dfaure edited edge metadata.
dfaure added inline comments.
runners/services/autotests/servicerunnertest.cpp
6

Is LGPL-v2-only on purpose here?

39

Why futile? What is futile is the fear of breaking the user's cache ;)

You don't need any of this.

Since my big ksycoca refactoring a year ago, ksycoca's filename includes a SHA1 of the data dirs (see KSycoca::absoluteFilePath(), see also the filenames in your ~/.cache).
So QStandardPaths::setTestModeEnabled(true); is already enough, given that it changes the local data home dir, so it changes the sha1.

See also e.g. kservice/autotests/kservicetest.cpp which doesn't change any env vars.

As a benefit it's also more portable to non-xdg platforms.

This revision now requires changes to proceed.Dec 16 2016, 9:44 PM
sitter updated this revision to Diff 9153.Dec 19 2016, 10:45 AM
sitter edited edge metadata.
sitter marked an inline comment as done.

drop excessive code to isolate ksyscoca. setting qstandardpaths into testing mode is enough to isolate this

runners/services/autotests/servicerunnertest.cpp
6

Not particularly. It's the same as the existing source file though, to have the same license restrictions apply to both. Is it worth changing it to gpgl2+kdev considering that?

39

Awesome. Thanks!

I would say yes, it's worth using LGPL v2+ or v2+v3 or v2+v3+e.V., whichever you prefer, for any new code. Otherwise it's even more work the day we want to relicense away from v2 only (I know because I've been trying to do that for some code for a very long time, and there are some contributors I can't reach anymore...)

dfaure added inline comments.Dec 19 2016, 12:51 PM
runners/services/autotests/servicerunnertest.cpp
60

BTW if this is necessary then there's a bug in ksycoca :-)

You can leave it (it helps getting the debug output from ksycoca in the right method) but if it fails without this line, then please tell me.

sitter updated this revision to Diff 9164.Dec 19 2016, 1:13 PM
sitter edited edge metadata.

switch to lgpl-2-3-ev as suggested in review

runners/services/autotests/servicerunnertest.cpp
60

It's only there for debug output and explicitness. Nothing to worry about ^^

dfaure accepted this revision.Dec 22 2016, 9:02 PM
dfaure edited edge metadata.
dfaure added inline comments.
runners/services/autotests/servicerunnertest.cpp
50

Use QVERIFY rather than Q_ASSERT in unittests.

(better integrated with the framework, and works even in a release build)

(replace all Q_ASSERTs in this file, there are others)

55

QVERIFY2

This revision is now accepted and ready to land.Dec 22 2016, 9:02 PM
This revision was automatically updated to reflect the committed changes.