Merge lp:~renatofilho/qtorganizer5-eds/fix-unit-test into lp:qtorganizer5-eds

Proposed by Renato Araujo Oliveira Filho
Status: Needs review
Proposed branch: lp:~renatofilho/qtorganizer5-eds/fix-unit-test
Merge into: lp:qtorganizer5-eds
Diff against target: 174 lines (+55/-4)
8 files modified
CMakeLists.txt (+3/-0)
tests/unittest/CMakeLists.txt (+1/-1)
tests/unittest/eds-base-test.cpp (+37/-1)
tests/unittest/eds-base-test.h (+2/-0)
tests/unittest/event-test.cpp (+4/-1)
tests/unittest/fetchitem-test.cpp (+1/-1)
tests/unittest/recurrence-test.cpp (+5/-0)
tests/unittest/run-eds-test.sh (+2/-0)
To merge this branch: bzr merge lp:~renatofilho/qtorganizer5-eds/fix-unit-test
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Needs Fixing
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+265752@code.launchpad.net

Commit message

Make sure that all views disappear from dbus before exit test case.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:84
https://jenkins.canonical.com/system-apps/job/lp-qtorganizer5-eds-ci/3/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/689/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/689
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/646
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/646
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/646
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/638/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/638/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/638/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/638/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/638/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/638/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/638/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/638/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/638/console

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-qtorganizer5-eds-ci/3/rebuild

review: Needs Fixing (continuous-integration)

Unmerged revisions

84. By Renato Araujo Oliveira Filho

Make sure that all views disappear from dbus before exit test case.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2015-03-30 17:59:13 +0000
+++ CMakeLists.txt 2015-07-24 01:20:29 +0000
@@ -8,6 +8,9 @@
88
99
10find_package(Qt5Core REQUIRED)10find_package(Qt5Core REQUIRED)
11find_package(Qt5DBus REQUIRED)
12find_package(Qt5Xml REQUIRED)
13
11add_definitions(-DQT_NO_KEYWORDS)14add_definitions(-DQT_NO_KEYWORDS)
12add_definitions(-std=c++11)15add_definitions(-std=c++11)
1316
1417
=== modified file 'tests/unittest/CMakeLists.txt'
--- tests/unittest/CMakeLists.txt 2015-05-08 20:01:32 +0000
+++ tests/unittest/CMakeLists.txt 2015-07-24 01:20:29 +0000
@@ -4,7 +4,7 @@
4 eds-base-test.cpp4 eds-base-test.cpp
5 eds-base-test.h5 eds-base-test.h
6 )6 )
7 qt5_use_modules(${TESTNAME} Core Organizer Test)7 qt5_use_modules(${TESTNAME} Core Organizer DBus Xml Test)
88
9 if(TEST_XML_OUTPUT)9 if(TEST_XML_OUTPUT)
10 set(TEST_ARGS -p -xunitxml -p -o -p test_${testname}.xml)10 set(TEST_ARGS -p -xunitxml -p -o -p test_${testname}.xml)
1111
=== modified file 'tests/unittest/eds-base-test.cpp'
--- tests/unittest/eds-base-test.cpp 2015-04-09 14:00:57 +0000
+++ tests/unittest/eds-base-test.cpp 2015-07-24 01:20:29 +0000
@@ -22,6 +22,8 @@
2222
23#include <QtCore>23#include <QtCore>
24#include <QtTest>24#include <QtTest>
25#include <QtDBus>
26#include <QtXml>
2527
26#include <libecal/libecal.h>28#include <libecal/libecal.h>
2729
@@ -60,7 +62,8 @@
6062
61void EDSBaseTest::initTestCase()63void EDSBaseTest::initTestCase()
62{64{
63 QTest::qWait(1000);65 // wait for the interface to appear on dbus
66 QTRY_COMPARE_WITH_TIMEOUT(listObjects().size(), 5, 30000);
64}67}
6568
6669
@@ -72,6 +75,39 @@
72{75{
73}76}
7477
78void EDSBaseTest::cleanupTestCase()
79{
80 // wait for all views dissapear from dbus
81 QTRY_COMPARE_WITH_TIMEOUT(listObjects().size(), 5, 30000);
82}
83
84QStringList EDSBaseTest::listObjects(const QString &path)
85{
86 QStringList result;
87 // make a low-level call, to avoid introspecting the Introspectable interface
88 QDBusMessage call = QDBusMessage::createMethodCall(EVOLUTION_CALENDAR_SERVICE,
89 path.isEmpty() ? QLatin1String("/") : path,
90 QLatin1String("org.freedesktop.DBus.Introspectable"),
91 QLatin1String("Introspect"));
92 QDBusReply<QString> xml = QDBusConnection::sessionBus().call(call);
93
94 QDomDocument doc;
95 doc.setContent(xml);
96 QDomElement node = doc.documentElement();
97 QDomElement child = node.firstChildElement();
98 while (!child.isNull()) {
99 if (child.tagName() == QLatin1String("node")) {
100 QString sub = path + QLatin1Char('/') + child.attribute(QLatin1String("name"));
101 result += sub;
102 result += listObjects(sub);
103 }
104 child = child.nextSiblingElement();
105 }
106
107 return result;
108}
109
110
75QString EDSBaseTest::getEventFromEvolution(const QOrganizerItemId &id,111QString EDSBaseTest::getEventFromEvolution(const QOrganizerItemId &id,
76 const QOrganizerCollectionId &collectionId)112 const QOrganizerCollectionId &collectionId)
77{113{
78114
=== modified file 'tests/unittest/eds-base-test.h'
--- tests/unittest/eds-base-test.h 2015-04-09 00:03:01 +0000
+++ tests/unittest/eds-base-test.h 2015-07-24 01:20:29 +0000
@@ -33,6 +33,7 @@
3333
34protected:34protected:
35 virtual void initTestCase();35 virtual void initTestCase();
36 virtual void cleanupTestCase();
36 virtual void init();37 virtual void init();
37 virtual void cleanup();38 virtual void cleanup();
3839
@@ -40,6 +41,7 @@
40 QString getEventFromEvolution(const QtOrganizer::QOrganizerItemId &id,41 QString getEventFromEvolution(const QtOrganizer::QOrganizerItemId &id,
41 const QtOrganizer::QOrganizerCollectionId &collectionId = QtOrganizer::QOrganizerCollectionId());42 const QtOrganizer::QOrganizerCollectionId &collectionId = QtOrganizer::QOrganizerCollectionId());
42 QString uniqueCollectionName() const;43 QString uniqueCollectionName() const;
44 QStringList listObjects(const QString &path = QString());
43};45};
4446
45#endif47#endif
4648
=== modified file 'tests/unittest/event-test.cpp'
--- tests/unittest/event-test.cpp 2015-04-13 21:30:00 +0000
+++ tests/unittest/event-test.cpp 2015-07-24 01:20:29 +0000
@@ -23,6 +23,9 @@
2323
24#include <QtOrganizer>24#include <QtOrganizer>
2525
26#include <libecal/libecal.h>
27
28
26#include "qorganizer-eds-engine.h"29#include "qorganizer-eds-engine.h"
27#include "eds-base-test.h"30#include "eds-base-test.h"
2831
@@ -65,7 +68,7 @@
65 void cleanupTestCase()68 void cleanupTestCase()
66 {69 {
67 delete m_engine;70 delete m_engine;
68 EDSBaseTest::cleanup();71 EDSBaseTest::cleanupTestCase();
69 }72 }
7073
71 void init()74 void init()
7275
=== modified file 'tests/unittest/fetchitem-test.cpp'
--- tests/unittest/fetchitem-test.cpp 2014-10-06 14:46:49 +0000
+++ tests/unittest/fetchitem-test.cpp 2015-07-24 01:20:29 +0000
@@ -89,7 +89,7 @@
89 delete m_engine;89 delete m_engine;
90 m_engine = 0;90 m_engine = 0;
9191
92 EDSBaseTest::cleanup();92 EDSBaseTest::cleanupTestCase();
93 }93 }
9494
95 void testFetchById()95 void testFetchById()
9696
=== modified file 'tests/unittest/recurrence-test.cpp'
--- tests/unittest/recurrence-test.cpp 2015-02-26 17:30:35 +0000
+++ tests/unittest/recurrence-test.cpp 2015-07-24 01:20:29 +0000
@@ -103,6 +103,11 @@
103 EDSBaseTest::cleanup();103 EDSBaseTest::cleanup();
104 }104 }
105105
106 void cleanupTestCase()
107 {
108 EDSBaseTest::cleanupTestCase();
109 }
110
106 void testCreateDailyEvent()111 void testCreateDailyEvent()
107 {112 {
108 static QString displayLabelValue = QStringLiteral("Daily test");113 static QString displayLabelValue = QStringLiteral("Daily test");
109114
=== modified file 'tests/unittest/run-eds-test.sh'
--- tests/unittest/run-eds-test.sh 2015-04-09 19:05:11 +0000
+++ tests/unittest/run-eds-test.sh 2015-07-24 01:20:29 +0000
@@ -32,6 +32,8 @@
32export EDS_TESTING=132export EDS_TESTING=1
33export QORGANIZER_EDS_DEBUG=On33export QORGANIZER_EDS_DEBUG=On
34export GIO_USE_VFS=local # needed to ensure GVFS shuts down cleanly after the test is over34export GIO_USE_VFS=local # needed to ensure GVFS shuts down cleanly after the test is over
35export GSETTINGS_BACKEND=memory
36export GSETTINGS_SCHEMA_DIR=${TEST_TMP_DIR}
3537
36echo HOMEDIR=${HOME}38echo HOMEDIR=${HOME}
37rm -rf ${XDG_DATA_HOME}39rm -rf ${XDG_DATA_HOME}

Subscribers

People subscribed via source and target branches