specifying database config file path for unit test

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

specifying database config file path for unit test

Johannes Wienke-3
Hi Marcel,

I just noticed that we need a way to specify the configuration file to
use for the database and not always use KStandardDirs. The unit tests
right now also take the config from there which will probably cause
problems if the config is changed and digikam isn't installed before
running the unit tests. I noticed this, because I tried to run the tests
for the first time on my laptop before installing a digikam version
after the database merge.

Do you see a good solution how to do this for the global
DatabaseConfigElementLoader?

Johannes


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel

signature.asc (268 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: specifying database config file path for unit test

Marcel Wiesweg

> Hi Marcel,
>
> I just noticed that we need a way to specify the configuration file to
> use for the database and not always use KStandardDirs. The unit tests
> right now also take the config from there which will probably cause
> problems if the config is changed and digikam isn't installed before
> running the unit tests. I noticed this, because I tried to run the tests
> for the first time on my laptop before installing a digikam version
> after the database merge.
>
> Do you see a good solution how to do this for the global
> DatabaseConfigElementLoader?

You mean dbconfig.xml?
This file should not contain any dynamic settings. It mostly contains SQL,
which is no longer in the .cpp file because it differs for the different db
engines. And additionally some other hardcoded settings per-engine.

Do we store settings to this file?
It's installed to /usr/share so users won't have permission to change anyway,
or so I thought.

Marcel
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: specifying database config file path for unit test

Johannes Wienke-3
Am 06.04.2010 20:01 schrieb Marcel Wiesweg:

>> I just noticed that we need a way to specify the configuration file to
>> use for the database and not always use KStandardDirs. The unit tests
>> right now also take the config from there which will probably cause
>> problems if the config is changed and digikam isn't installed before
>> running the unit tests. I noticed this, because I tried to run the tests
>> for the first time on my laptop before installing a digikam version
>> after the database merge.
>>
>> Do you see a good solution how to do this for the global
>> DatabaseConfigElementLoader?
>
> You mean dbconfig.xml?
> This file should not contain any dynamic settings. It mostly contains SQL,
> which is no longer in the .cpp file because it differs for the different db
> engines. And additionally some other hardcoded settings per-engine.
>
> Do we store settings to this file?
> It's installed to /usr/share so users won't have permission to change anyway,
> or so I thought.
But if I'm only running the unit tests without installing digikam they
won't run. And also code assumed to be static may change in the future.
;) You can get a lot of strange errors if you can't setup an isolated
testing environment as it is right now.

Johannes


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel

signature.asc (270 bytes) Download Attachment