X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/2b11a47a2f03efd93c990c8cc263fb9ea3491075..aaabb46f20bd6189caebf02c1f1a925cbd08a263:/docs/develop/Development-Environment.md diff --git a/docs/develop/Development-Environment.md b/docs/develop/Development-Environment.md index 0334d0f1..b5e5ceba 100644 --- a/docs/develop/Development-Environment.md +++ b/docs/develop/Development-Environment.md @@ -3,11 +3,11 @@ This chapter gives an overview how to set up Nominatim for developement and how to run tests. -!!!Important -This guide assumes that you develop under the latest version of Ubuntu. You -can of course also use your favourite distribution. You just might have to -adapt the commands below slightly, in particular the commands for installing -additional software. +!!! Important + This guide assumes that you develop under the latest version of Ubuntu. You + can of course also use your favourite distribution. You just might have to + adapt the commands below slightly, in particular the commands for installing + additional software. ## Installing Nominatim @@ -25,12 +25,10 @@ following packages should get you started: ## Prerequisites for testing and documentation -The Nominatim tests suite consists of behavioural tests (using behave) and +The Nominatim test suite consists of behavioural tests (using behave) and unit tests (using PHPUnit). It has the following additional requirements: -* [behave test framework](https://github.com/behave/behave) >= 1.2.5 -* [nose](https://nose.readthedocs.org) -* [pytidylib](http://countergram.com/open-source/pytidylib) +* [behave test framework](https://behave.readthedocs.io) >= 1.2.5 * [phpunit](https://phpunit.de) >= 7.3 * [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) @@ -50,7 +48,7 @@ To install all necessary packages run: sudo apt install php-cgi phpunit php-codesniffer \ python3-pip python3-setuptools python3-dev -pip3 install --user behave nose mkdocs +pip3 install --user behave mkdocs ``` The `mkdocs` executable will be located in `.local/bin`. You may have to add @@ -86,7 +84,7 @@ All tests are located in the `\test` directory. Some of the behavioural test expect a test database to be present. You need at least 2GB RAM and 10GB disk space to create the database. -First create a separate directory for the test DB and Fetch the test planet +First create a separate directory for the test DB and fetch the test planet data and the Tiger data for South Dakota: ``` @@ -103,13 +101,20 @@ cmake $USERNAME/Nominatim make ``` -Copy the test settings: +Create a minimal test settings file: ``` -cp $USERNAME/Nominatim/test/testdb/local.php settings/ +tee .env << EOF +NOMINATIM_DATABASE_DSN="pgsql:dbname=test_api_nominatim" +NOMINATIM_USE_US_TIGER_DATA=yes +NOMINATIM_TIGER_DATA_PATH=tiger +NOMINATIM_WIKIPEDIA_DATA_PATH=$USERNAME/Nominatim/test/testdb +EOF ``` Inspect the file to check that all settings are correct for your local setup. +In particular, the wikipedia path should point to the test directory in your +Nominatim source directory. Now you can import the test database: