influxdb/query_tests/Cargo.toml

39 lines
1.3 KiB
TOML
Raw Normal View History

[package]
name = "query_tests"
version = "0.1.0"
authors = ["Andrew Lamb <andrew@nerdnetworks.org>"]
2021-10-25 08:45:44 +00:00
edition = "2021"
description = "Tests of the query engine against different database configurations"
[dependencies]
arrow = { version = "13", features = ["prettyprint"] }
async-trait = "0.1"
backoff = { path = "../backoff" }
2022-05-05 19:29:24 +00:00
data_types = { path = "../data_types" }
2021-09-16 19:02:18 +00:00
datafusion = { path = "../datafusion" }
dml = { path = "../dml" }
futures = "0.3"
generated_types = { path = "../generated_types" }
influxdb_iox_client = { path = "../influxdb_iox_client" }
ingester = { path = "../ingester" }
iox_catalog = { path = "../iox_catalog" }
iox_tests = { path = "../iox_tests" }
itertools = "0.10"
mutable_batch = { path = "../mutable_batch" }
mutable_batch_lp = { path = "../mutable_batch_lp" }
once_cell = { version = "1.10.0", features = ["parking_lot"] }
2021-09-16 19:02:18 +00:00
predicate = { path = "../predicate" }
refactor: dyn-typed DB for `query_tests` (#4053) To test the `db::Db` as well as the `querier` with the same test framework, they require a shared interface. Ideally this interface is dynamically typed instead of static dispatched via generics because: - `query_tests` already take ages to compile - we often hold a list of scenarios and a single scenario should (in a future PR) be able to represent both OG as well as NG The vision here is that we basically keep the whole test setup but add new scenarios which are NG-specific later on. Now the issue w/ many query-related types is that they are NOT object-safe because methods that don't take `&self` or they have associated types that we cannot specify in general for OG and NG at the same time. So we need a bunch of wrappers that make dynamic dispatch possible. They mostly call to an internal "interface" crate which is the actual `dyn` part. The interface is currently only implemented for OG. The scenarios currently also only contain OG databases. However, creating a dynamic interface that can be used in all `query_tests` is already a huge step. Note that there are two places where we downcast the dynamic/abstract database to `db::Db` again: 1. To create one scenario based on another and where we need to manipulate `db::Db` with OG-specific semantics. 2. `server_benchmarks`. These contain OG databases only and there is no point in benchmarking throw the dynamic dispatch interface because prod (`influxdb_ioxd`) also uses static dispatch. Ref #3934. Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-03-18 10:11:17 +00:00
schema = { path = "../schema" }
querier = { path = "../querier" }
query = { path = "../query" }
pretty_assertions = "1.2.1"
workspace-hack = { path = "../workspace-hack"}
[dev-dependencies]
arrow = { version = "13", features = ["prettyprint"] }
arrow_util = { path = "../arrow_util" }
2022-01-11 19:22:36 +00:00
snafu = "0.7"
test: ensure that query tests don't rebuild all the time Beforehand: ```text ❯ env CARGO_LOG=cargo::core::compiler::fingerprint=info cargo test -p query_tests [2021-07-05T08:52:13Z INFO cargo::core::compiler::fingerprint] stale: changed "/home/mneumann/src/influxdb_iox/query_tests/cases" [2021-07-05T08:52:13Z INFO cargo::core::compiler::fingerprint] (vs) "/home/mneumann/src/influxdb_iox/target/debug/build/query_tests-0e8f741dfb84437f/output" [2021-07-05T08:52:13Z INFO cargo::core::compiler::fingerprint] FileTime { seconds: 1625474716, nanos: 436081357 } != FileTime { seconds: 1625474752, nanos: 52625167 } [2021-07-05T08:52:13Z INFO cargo::core::compiler::fingerprint] fingerprint error for query_tests v0.1.0 (/home/mneumann/src/influxdb_iox/query_tests)/Test/TargetInner { ..: lib_target("query_tests", ["lib"], "/home/mneumann/src/influxdb_iox/query_tests/src/lib.rs", Edition2018) } [2021-07-05T08:52:13Z INFO cargo::core::compiler::fingerprint] err: current filesystem status shows we're outdated [2021-07-05T08:52:13Z INFO cargo::core::compiler::fingerprint] fingerprint error for query_tests v0.1.0 (/home/mneumann/src/influxdb_iox/query_tests)/RunCustomBuild/TargetInner { ..: custom_build_target("build-script-build", "/home/mneumann/src/influxdb_iox/query_tests/build.rs", Edition2018) } [2021-07-05T08:52:13Z INFO cargo::core::compiler::fingerprint] err: current filesystem status shows we're outdated [2021-07-05T08:52:13Z INFO cargo::core::compiler::fingerprint] fingerprint error for query_tests v0.1.0 (/home/mneumann/src/influxdb_iox/query_tests)/Build/TargetInner { ..: lib_target("query_tests", ["lib"], "/home/mneumann/src/influxdb_iox/query_tests/src/lib.rs", Edition2018) } [2021-07-05T08:52:13Z INFO cargo::core::compiler::fingerprint] err: current filesystem status shows we're outdated Compiling query_tests v0.1.0 (/home/mneumann/src/influxdb_iox/query_tests) ``` The issue is that both the input and the test output files are located under `cases/`. `build.rs` used `cargo:rerun-if-changed=cases` which per Cargo doc will scan ALL files in that directory. Note that the normal `exclude` directive in `Cargo.toml` does NOT work, see https://github.com/rust-lang/cargo/issues/4587 . So we need to split input and output files into separate directories (`cases/{in,out}`).
2021-07-05 09:48:50 +00:00
tempfile = "3.1.0"
test_helpers = { path = "../test_helpers" }
tokio = { version = "1.18", features = ["macros", "parking_lot", "rt-multi-thread", "time"] }