Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit test for programs that uses influxdb

How could i write unit tests for an application that uses influx db as database without installing influxDB on system.

I want an embedded influxDB to start before tests, tests run, and close after tests.

like image 363
Arman Avatar asked Oct 29 '25 10:10

Arman


2 Answers

You could simply use a Docker image such as tutum/influxdb. Only dependency in this setup is installing Docker.

like image 173
Michael Hausenblas Avatar answered Oct 31 '25 12:10

Michael Hausenblas


I know this is an old question but I tackle the same issue while developing integration tests on a project.

I created a library for this purpose available on Maven Central (the sources are available on github).

It enables to download and control an InfluxDB server directly from java.

Hope it helps.

like image 22
aveuiller Avatar answered Oct 31 '25 10:10

aveuiller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!