Calendar: `Error in bootstrap script: Not installed`

I’d like to set up my environment for development of Calendar. I’ve set up the nextcloud dev env using the docker images provided at GitHub - juliushaertl/nextcloud-docker-dev: Nextcloud development environment using docker-compose as recommended by `composer test` fails due to missing `base.php` - #2 by z4k and git cloned GitHub - nextcloud/calendar: 📆 Calendar app for Nextcloud into nextcloud-docker-dev/workspace/server/apps-extra/, successfully ran composer install in every directory from nextcloud-docker-dev all the way to nextcloud-docker-dev/workspace/server/apps-extra/calendar, but then composer test in the calendar directory fails with:

Error in bootstrap script: Exception:
Not installed
#0 [SOMEWHERE]/nextcloud-docker-dev/workspace/server/lib/base.php(709): OC::checkInstalled()
#1 [SOMEWHERE]/nextcloud-docker-dev/workspace/server/lib/base.php(1200): OC::init()
#2 [SOMEWHERE]/nextcloud-docker-dev/workspace/server/apps-extra/calendar/tests/php/unit/bootstrap.php(26): require_once('...')
#3 [SOMEWHERE]/nextcloud-docker-dev/workspace/server/apps-extra/calendar/vendor-bin/phpunit/vendor/phpunit/phpunit/src/Util/FileLoader.php(66): include_once('...')
#4 [SOMEWHERE]/nextcloud-docker-dev/workspace/server/apps-extra/calendar/vendor-bin/phpunit/vendor/phpunit/phpunit/src/Util/FileLoader.php(49): PHPUnit\Util\FileLoader::load()
#5 [SOMEWHERE]/nextcloud-docker-dev/workspace/server/apps-extra/calendar/vendor-bin/phpunit/vendor/phpunit/phpunit/src/TextUI/Command.php(565): PHPUnit\Util\FileLoader::checkAndLoad()
#6 [SOMEWHERE]/nextcloud-docker-dev/workspace/server/apps-extra/calendar/vendor-bin/phpunit/vendor/phpunit/phpunit/src/TextUI/Command.php(345): PHPUnit\TextUI\Command->handleBootstrap()
#7 [SOMEWHERE]/nextcloud-docker-dev/workspace/server/apps-extra/calendar/vendor-bin/phpunit/vendor/phpunit/phpunit/src/TextUI/Command.php(112): PHPUnit\TextUI\Command->handleArguments()
#8 [SOMEWHERE]/nextcloud-docker-dev/workspace/server/apps-extra/calendar/vendor-bin/phpunit/vendor/phpunit/phpunit/src/TextUI/Command.php(97): PHPUnit\TextUI\Command->run()
#9 [SOMEWHERE]/nextcloud-docker-dev/workspace/server/apps-extra/calendar/vendor-bin/phpunit/vendor/phpunit/phpunit/phpunit(107): PHPUnit\TextUI\Command::main()
#10 [SOMEWHERE]/nextcloud-docker-dev/workspace/server/apps-extra/calendar/vendor/bin/phpunit(120): include('...')
#11 {main}
Script phpunit --configuration phpunit.unit.xml --fail-on-warning handling the test event returned with error code 1

How to make tests run?

From the message, I would say that you have the Nextcloud not installed.

composer install ran just fine though.

No, I am not talking of dependencies but about Nextcloud. So, preparing a database and making the Nextcloud core ready to handle connections.

As you are using Julius’ setup, you can just “up” the corresponding container. That should install it. Some default apps will be needed, though (viewer if I am right).

In the Nextcloud folder, the dependencies are handled via submodule. Just to be sure: you have enabled and updated the submodule?

I’ve already used docker-compose up nextcloud and it worked. In fact, I’ve followed the tutorial of Nextcloud and everything worked, with one hiccup: I tried both with a template app, which worked fine (successfully enabled via the nextcloud web client), but cloning the calendar app in apps-extra didn’t (it displayed a different version from the cloned one).

This can happen, if the cloned version is not found. The occ app:enable script will download the app from the app store if it is not found locally. Check all folders (especially workspace/server/apps-writable) if there is a second version installed.

Check all folders (especially workspace/server/apps-writable) if there is a second version installed.

No luck:

nextcloud-docker-dev git:(master) find . -type d -name calendar

You can use the script ./scripts/occ nextcloud -- app:getpath calendar to get the path inside the container. From there, you can backtrack using the docker server.

Thanks, this fixed the problem! I had to docker exec -it master_nextcloud_1 sh to remove the script from within the container. Then, from within the container, I successfully ran the calendar tests.

By the way, do I have to carry out all calendar development inside the docker exec -it master_nextcloud_1 sh environment? I’d like to avoid it, to take advantage of commandline facilities I’ve set up…

Honestly, I am unsure. I guess for anything related to integration tests and tests with a DB attached, yes, you will most probably need a fully running and installed server.

Can’t you tweak your command line kungfu into the container in some way (I do not know what you have set up exactly)? Just an idea to prefix docker compose exec nextcloud