2012/3/29 Patrick Ohly <[email protected]>:
> On Thu, 2012-03-29 at 10:44 +0200, Krzesimir Nowak wrote:
>> 2012/3/27 Patrick Ohly <[email protected]>:
>> > For example, running a command line operation is not tested. Support for
>> > it is implemented, but only without the output handling. Before adding
>> > that, the tests from the Cmdline unit tests should be incorporated into
>> > test-dbus.py. That way it can be verified that the tests work (because
>> > they fail initially with the new branch) and developing the feature
>> > becomes easier (because testing doesn't have to be manual).
>>
>> I started working on it yesterday. Just to be sure - do all of the
>> tests from syncevo/Cmdline.cpp have to be ported?
>
> Some might be genuine unit tests (exercise the Cmdline class and not so
> much the implementation behind it), those can stay in Cmdline.cpp.
> Everything which does real, functional testing of more than just the
> Cmdline class (and I think most of the tests fall into that category)
> should be extracted so that it can run with --disable-unittests and
> exercises the entire system, like a normal user would.
>

Ok, before I port more tests I would like you to just have a look on
one I have ported (testSetupScheduleWorld).
https://meego.gitorious.org/~krnowak/meego-middleware/krnowaks-syncevolution/commits/cmdline-tests

I guess that you will want it to be done differently.

>> Also, I guess that I can pass any value to be under 0th index of args
>> parameter for session.Execute()? I have seen "client-test" to be
>> passed in TestCmdline class, but it seems to be used nowhere in
>> Cmdline anyway.
>
> Careful here. The main goal is to have real tests involving
> syncevolution as frontend and syncevo-dbus-server as backend. That means
> the test driver needs to invoke the syncevolution binary. Unit tests are
> useful to check for specific corner cases quickly, but in general I
> prefer to have realistic integration tests which include the corner
> cases.

Oh, I thought that we are going to call Session.Execute() here. That
is what I have done in my port. For now it ends with following errors:


GConf Error: Configuration server couldn't be contacted: D-BUS error:
Method "GetDatabase" with signature "s" on interface
"org.gnome.GConf.Server" doesn't exist

GConf Error: Configuration server couldn't be contacted: D-BUS error:
Method "GetDatabase" with signature "s" on interface
"org.gnome.GConf.Server" doesn't exist

GConf Error: Configuration server couldn't be contacted: D-BUS error:
Method "GetDatabase" with signature "s" on interface
"org.gnome.GConf.Server" doesn't exist

GConf Error: Configuration server couldn't be contacted: D-BUS error:
Method "GetDatabase" with signature "s" on interface
"org.gnome.GConf.Server" doesn't exist

GConf Error: Configuration server couldn't be contacted: D-BUS error:
Method "GetDatabase" with signature "s" on interface
"org.gnome.GConf.Server" doesn't exist

GConf Error: Configuration server couldn't be contacted: D-BUS error:
Method "GetDatabase" with signature "s" on interface
"org.gnome.GConf.Server" doesn't exist

GConf Error: Configuration server couldn't be contacted: D-BUS error:
Method "GetDatabase" with signature "s" on interface
"org.gnome.GConf.Server" doesn't exist

GConf Error: Configuration server couldn't be contacted: D-BUS error:
Method "GetDatabase" with signature "s" on interface
"org.gnome.GConf.Server" doesn't exist

GConf Error: Configuration server couldn't be contacted: D-BUS error:
Method "GetDatabase" with signature "s" on interface
"org.gnome.GConf.Server" doesn't exist

[WARNING syncevo-dbus-helper 00:00:00] e-data-server: Could not update
"/apps/evolution/addressbook/sources": Configuration server couldn't
be contacted: D-BUS error: Method "GetDatabase" with signature "s" on
interface "org.gnome.GConf.Server" doesn't exist

GConf Error: Configuration server couldn't be contacted: D-BUS error:
Method "GetDatabase" with signature "s" on interface
"org.gnome.GConf.Server" doesn't exist

GConf Error: Configuration server couldn't be contacted: D-BUS error:
Method "GetDatabase" with signature "s" on interface
"org.gnome.GConf.Server" doesn't exist

[DEBUG syncevo-dbus-helper 00:00:00] exception thrown at
../../../projekty/cxx/syncevolution/src/syncevo/DevNullConfigNode.h:46
[ERROR syncevo-dbus-helper 00:00:00] : virtual read-only configuration
node, cannot write property sync = two-way
[DEBUG syncevo-dbus-helper 00:00:00] terminating as requested by operation
[INFO syncevo-dbus-helper 00:00:00] terminating normally
[DEBUG 00:00:01] execute() helper call completed,
org.syncevolution.Server: : virtual read-only configuration node,
cannot write property sync = two-way
[ERROR 00:00:01] : virtual read-only configuration node, cannot write
property sync = two-way
[DEBUG 00:00:01] session failed: remember 10500 error
[DEBUG 00:00:01] session
/org/syncevolution/Session/3840802061333016421 done, config , not
modified, result 10500

> Putting this into test-dbus.py has the advantage that there is quite a
> bit of infrastructure for setting up and monitoring syncevo-dbus-server
> and for creating the right environment (XDG env variables, content of
> these directories - see @property("snapshot")).
>
> Invoking and monitoring an executable instead of making D-Bus calls will
> require some plumbing.
>
> --
> Best Regards
>
> Patrick Ohly
> Senior Software Engineer
>
> Intel GmbH
> Open Source Technology Center
> Pützstr. 5                              Phone: +49-228-2493652
> 53129 Bonn
> Germany
>
_______________________________________________
SyncEvolution mailing list
[email protected]
http://lists.syncevolution.org/listinfo/syncevolution

Reply via email to