Skip to content

Unit and integration tests

Juho Inkinen edited this page Nov 15, 2022 · 8 revisions

As part of the continuous integration workflow, Skosmos codebase comes with a set of unit and integration tests under the tests/ directory that exercise most of the code and try to ensure that things keep working. The tests are executed in the GitHub Actions CI environment after every commit. See the ci.yml configuration for details on how the CI has been set up.

Running the tests locally

Prerequisites

You need to install the development dependencies using Composer. Run composer install without the --no-dev parameter.

Starting up Fuseki

The tests need a Fuseki running in the background. Downloading and starting it has been automated:

cd tests
. init_fuseki.sh

The Fuseki process will stay running until you kill it manually.

Running the tests

Under the root directory, run:

vendor/bin/phpunit

You can also run just a specific set of tests:

vendor/bin/phpunit tests/ConceptTest.php

Good to know

It has been noticed that disabling the xdebug feature (if set up) speeds up the local testing process.

Clone this wiki locally