2021-02-24 21:52:18 +00:00
|
|
|
# Testing
|
|
|
|
|
|
|
|
This document covers details that are only relevant if you are developing IOx and running the tests.
|
|
|
|
|
|
|
|
## Object storage
|
|
|
|
|
|
|
|
### To run the tests or not run the tests
|
|
|
|
|
|
|
|
If you are testing integration with some or all of the object storage options, you'll have more
|
|
|
|
setup to do.
|
|
|
|
|
2021-02-25 20:52:52 +00:00
|
|
|
By default, `cargo test -p object_store` does not run any tests that actually contact
|
|
|
|
any cloud services: tests that do contact the services will silently pass.
|
2021-02-24 21:52:18 +00:00
|
|
|
|
|
|
|
To ensure you've configured object storage integration testing correctly, you can run
|
2021-02-25 20:52:52 +00:00
|
|
|
`TEST_INTEGRATION=1 cargo test -p object_store`, which will run the tests that contact the cloud
|
2021-02-24 21:52:18 +00:00
|
|
|
services and fail them if the required environment variables aren't set.
|
|
|
|
|
|
|
|
If you don't specify the `TEST_INTEGRATION` environment variable but you do configure some or all
|
|
|
|
of the object stores, the relevant tests will run.
|
|
|
|
|
|
|
|
### Configuration differences when running the tests
|
|
|
|
|
2021-03-12 17:30:49 +00:00
|
|
|
When running `influxdb_iox run`, you can pick one object store to use. When running the tests,
|
2021-02-24 21:52:18 +00:00
|
|
|
you can run them against all the possible object stores. There's still only one
|
|
|
|
`INFLUXDB_IOX_BUCKET` variable, though, so that will set the bucket name for all configured object
|
|
|
|
stores. Use the same bucket name when setting up the different services.
|
2021-02-25 20:52:52 +00:00
|
|
|
|
|
|
|
Other than possibly configuring multiple object stores, configuring the tests to use the object
|
|
|
|
store services is the same as configuring the server to use an object store service. See the output
|
2021-03-12 17:30:49 +00:00
|
|
|
of `influxdb_iox run --help` for instructions.
|
2021-03-25 19:22:51 +00:00
|
|
|
|
|
|
|
## InfluxDB 2 Client
|
|
|
|
|
|
|
|
The `influxdb2_client` crate may be used by people using InfluxDB 2.0 OSS, and should be compatible
|
2021-04-15 20:58:27 +00:00
|
|
|
with both that and IOx. If you have `docker` in your path, the integration tests for the
|
|
|
|
`influxdb2_client` crate will run integration tests against `influxd` running in a Docker
|
|
|
|
container. If you do not have `docker`, by default, those tests will not be run and will silently
|
|
|
|
pass.
|
|
|
|
|
|
|
|
If you do not have and do not want to have Docker locally, but you do have `influxd` for InfluxDB
|
|
|
|
2.0 locally, you can use that instead by running the tests with the environment variable `LOCAL=1`.
|
2021-03-25 19:22:51 +00:00
|
|
|
|
|
|
|
To ensure you're running the `influxdb2_client` integration tests, you can run `TEST_INTEGRATION=1
|
2021-04-15 20:58:27 +00:00
|
|
|
cargo test -p influxdb2_client`, which will fail the tests if `docker` (or `influxd`, if `LOCAL=1`
|
|
|
|
is set) is not available.
|