diff --git a/docs/developer/long-tezts.rst b/docs/developer/long-tezts.rst index 89ceb183a963304e71bf53577abf906ce33c5c44..ad8ea1108cb84c8ac3b91bfc5f36b0ca3a0ecf45 100644 --- a/docs/developer/long-tezts.rst +++ b/docs/developer/long-tezts.rst @@ -135,4 +135,71 @@ Please note that the S3 storage root folder is mounted in ``/s3data/``. E.g. if your file is under ``/myfolder/myfile`` in the Amazon bucket, your tests will find it under ``/s3data/myfolder/myfile``. +Testing Your Benchmarks Locally +------------------------------- + +When developing a benchmark depending on the long test framework, it can +be useful to test it using a development database so that your tests does +not impact the production database. + +This section describes how to easily set up an InfluxDB database so that the +framework can operate with it. + +The following steps assume that you already installed Docker and correctly +configured it. For more information on this subject, please refer to: +https://docs.docker.com/engine/install/#desktop + +We will first install and bootstrap an InfluxDB database. This can be done +using the official Docker image: https://hub.docker.com/_/influxdb + +From a terminal, run the following commands:: + + mkdir $HOME/influxdb + + docker run -d -p 8086:8086 \ + -v $HOME/influxdb/data:/var/lib/influxdb2 \ + -v $HOME/influxdb/config:/etc/influxdb2 \ + -e DOCKER_INFLUXDB_INIT_MODE=setup \ + -e DOCKER_INFLUXDB_INIT_USERNAME= \ + -e DOCKER_INFLUXDB_INIT_PASSWORD= \ + -e DOCKER_INFLUXDB_INIT_ORG=my-org \ + -e DOCKER_INFLUXDB_INIT_BUCKET=my-bucket \ + influxdb:1.8 + +This will download an image of the version 1.8 of InfluxDB and start a +container with it. Version 1.8 is mandatory as the framework does not +support newer versions for now. + +Of course, ```` and ```` should be replaced by values of your choice. + +When the container is bootstrapped, you need to create the database +that will be used by the framework. + +Run the following command to connect to the InfluxDB server and create +a database named ``prt``:: + + curl -X POST http://localhost:8086/query\?pretty\=true \ + --user ":" \ + --data-urlencode "q=create database prt" + +After the database is created, you can use the following JSON +configuration to set up the framework with your local database: + +``tezt_config.json``: + +.. code-block:: json + + { + "influxdb": { + "url": "http://localhost:8086", + "database": "prt", + "username": "", + "password": "" + } + } + +For more information about the configuration file, please refer +to the `Long test module API `__. + +