Make TestInProcess skip out-of-process tests if D-Bus service uninstalled
ClosedPublic

Authored by kossebau on Jul 3 2018, 5:23 PM.

Details

Summary

With the movement to support running unittests pre-installation and KDE CI
having adapted to that for some build setups, this currently breaks tests
which rely on subject-under-test D-Bus services being auto-started from
D-Bus service files, given the D-Bus daemon does not see the uninstalled
ones.

One solution might be to catch that situation and do the start of the D-Bus
service ourselves, but I failed to get this done quickly. So as intermediate
solution, to at least have the in-process tests no longer being covered by
the out-of-process ones failing, this patch will just skip the
out-of-process tests if the D-Bus service could not be started.
That follows the current behaviour of e.g. the KGlobalShortcutTest from
KF5's kglobalaccel.

Test Plan

TestInProcess no longer fails if the org.kde.KScreen D-Bus service cannot be
autostarted.

Diff Detail

Repository
R110 KScreen Library
Branch
makeTestSkipDBusTettsIfNotFound
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1218
Build 1232: arc lint + arc unit
kossebau created this revision.Jul 3 2018, 5:23 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 3 2018, 5:23 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Jul 3 2018, 5:23 PM

Initial draft version of the patch for principal review.

Blocks should be indented surely.

Perhaps the test methods should be also separated each into in-orocess and out-of-process , so the out-of-process ones could get a QSKIP at the begin, for improved logging in the test result of the skipped test variants?

Looks good, please finish up cleanup/indentation and I'll accept.

autotests/testinprocess.cpp
139–140

Please indent.

kossebau updated this revision to Diff 38504.Jul 26 2018, 12:28 PM

Complete the indentation

Other sketched changes like splitting out into own test case methods not
continued here, needs bigger work with more understanding of the tested
stuff

gladhorn accepted this revision.Jul 27 2018, 8:08 AM
This revision is now accepted and ready to land.Jul 27 2018, 8:08 AM
This revision was automatically updated to reflect the committed changes.