[owncloud-devel] Installing App when running unit tests

Bernhard Posselt dev at bernhard-posselt.com
Sat Apr 18 15:28:13 GMT 2015


I see, You're basically writing Integration Tests then ;) Check the
section in the documentation:
https://doc.owncloud.org/server/8.1/developer_manual/app/tutorial.html#integration-tests
which describes how to create an Integration Test. ocdev should
automatically generate a travis.yml (at least for 8 and 8.1) which
installs and enables your app in a way that you can run those tests on
travis, so there is no need to access the private  API to simply install
your app.

On 04/18/2015 04:49 PM, Tobia De Koninck wrote:
> I agree you don not want apps to enable and install or even download
> other apps.
>
> In the unit tests of the Chat app I also test my DataMappers and their
> SQL queries. I use a few special queries which works well now, but
> there were some SQL errors on other DRBMS in the past.
>
> But before these tests can be run, the DB tables have to be created. I
> don't know how to do this without using private methods?
>
> Thanks again!
>
> Op 18-04-15 om 16:02 schreef Bernhard Posselt:
>> Usecase for those methods? App installer/enabling an app utterly
>> confusing and is scattered in multiple places in core; it needs to be
>> cleaned up at some point. Relying on that private api feature will
>> likely break your app in future releases.
>>
>> On 04/18/2015 03:44 PM, Tobia De Koninck wrote:
>>> Hey! Thanks for the answer.
>>>
>>> Problem is \OCP\App doesn't have an enable/install method
>>> (https://github.com/owncloud/core/blob/master/lib/public/app.php) and
>>> AppManager only enables the app, it doesn't install it. (i.e. creating
>>> database tables)
>>>
>>> Op 18-04-15 om 15:34 schreef Bernhard Posselt:
>>>> OC_Hook and OC_App both have public interface counterparts, use
>>>> them ;)
>>>>
>>>> On 04/18/2015 03:32 PM, Tobia De Koninck wrote:
>>>>> Hi
>>>>>
>>>>> The Chat app doesn't pass the code check in 8.1 (refs
>>>>> https://github.com/owncloud/chat/issues/219).
>>>>> To be able to run DB unit tests, I have to install (not only enable)
>>>>> the app before the unit tests are run. However the only method to
>>>>> this
>>>>> is   OC_App::enable('chat'); . Of course this doesn't pass the code
>>>>> check.
>>>>>
>>>>> How should I enable the app?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Tobia (LEDfan)
>>>>>
>>>>> _______________________________________________
>>>>> Devel mailing list
>>>>> Devel at owncloud.org
>>>>> http://mailman.owncloud.org/mailman/listinfo/devel
>>>> _______________________________________________
>>>> Devel mailing list
>>>> Devel at owncloud.org
>>>> http://mailman.owncloud.org/mailman/listinfo/devel
>>>
>>> _______________________________________________
>>> Devel mailing list
>>> Devel at owncloud.org
>>> http://mailman.owncloud.org/mailman/listinfo/devel
>> _______________________________________________
>> Devel mailing list
>> Devel at owncloud.org
>> http://mailman.owncloud.org/mailman/listinfo/devel
>
>
> _______________________________________________
> Devel mailing list
> Devel at owncloud.org
> http://mailman.owncloud.org/mailman/listinfo/devel




More information about the Devel mailing list