mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-03 02:25:35 +00:00
fix(ci): build tests-integration lib with meta-srv/mock (#9299)
* fix(ci): build tests-integration lib with meta-srv/mock tests-integration's lib code (src/cluster.rs) uses meta_srv::mocks, but the dependency carrying the mock feature sits in [dev-dependencies]. Builds that only touch the lib, such as the apidoc job's cargo doc --workspace, resolve meta-srv without mock and fail with E0432. --all-targets builds unify dev-dependency features, which is why check, clippy and nextest stayed green. Move the mock-enabled meta-srv entry back to [dependencies]. The other testing features moved out in #9072 are not needed by the lib and stay in [dev-dependencies]. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> * test(repartition): split per-case repartition tests test_repartition_metric ran four format/primary-key-encoding cases in a single test function, and test_repartition_mito ran two format cases. Each case builds its own 3-datanode cluster and runs a full repartition plus GC cycle, so on S3 the metric test took 165-178s against the 180s nextest terminate-after. Merge queue runs failed on it at random. Split each case into its own test. Cases were already independent, so they now run in parallel and each stays far inside the timeout, and a failure points at one encoding instead of four. Signed-off-by: Dennis Zhuang <killme2008@gmail.com> --------- Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
This commit is contained in:
@@ -65,7 +65,7 @@ hyper-util = { workspace = true, features = ["tokio"] }
|
||||
log-query = { workspace = true }
|
||||
loki-proto.workspace = true
|
||||
meta-client.workspace = true
|
||||
meta-srv.workspace = true
|
||||
meta-srv = { workspace = true, features = ["mock"] }
|
||||
mito2.workspace = true
|
||||
object-store.workspace = true
|
||||
operator.workspace = true
|
||||
@@ -111,7 +111,6 @@ hex.workspace = true
|
||||
http.workspace = true
|
||||
itertools.workspace = true
|
||||
jsonb.workspace = true
|
||||
meta-srv = { workspace = true, features = ["mock"] }
|
||||
mito2 = { workspace = true, features = ["test", "test-shared-fs-region-migration"] }
|
||||
mysql_async = { version = "0.37", default-features = false, features = [
|
||||
"time",
|
||||
|
||||
@@ -45,15 +45,25 @@ macro_rules! repartition_tests {
|
||||
$(
|
||||
paste::item! {
|
||||
mod [<integration_repartition_ $service:lower _test>] {
|
||||
// Every case below builds its own cluster and runs a full repartition plus
|
||||
// GC cycle, which takes around a minute on object-store backends. Keep one
|
||||
// case per test so a case stays well inside the nextest slow timeout and
|
||||
// cases run in parallel; do not fold several cases back into one test.
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn [< test_repartition_mito >]() {
|
||||
async fn [< test_repartition_mito_flat >]() {
|
||||
let store_type = tests_integration::test_util::StorageType::$service;
|
||||
if store_type.test_on() {
|
||||
common_telemetry::init_default_ut_logging();
|
||||
// Cover both storage formats for repartition behavior.
|
||||
// for flat format
|
||||
$crate::repartition::test_repartition_mito(store_type, true).await;
|
||||
// for primary key format
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn [< test_repartition_mito_primary_key >]() {
|
||||
let store_type = tests_integration::test_util::StorageType::$service;
|
||||
if store_type.test_on() {
|
||||
common_telemetry::init_default_ut_logging();
|
||||
$crate::repartition::test_repartition_mito(store_type, false).await;
|
||||
}
|
||||
}
|
||||
@@ -95,19 +105,41 @@ macro_rules! repartition_tests {
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn [< test_repartition_metric >]() {
|
||||
async fn [< test_repartition_metric_flat_sparse >]() {
|
||||
let store_type = tests_integration::test_util::StorageType::$service;
|
||||
if store_type.test_on() {
|
||||
use store_api::codec::PrimaryKeyEncoding;
|
||||
common_telemetry::init_default_ut_logging();
|
||||
// Exercise format + primary key encoding matrix for metric engine.
|
||||
// for flat format with sparse primary key encoding
|
||||
$crate::repartition::test_repartition_metric(store_type, true, PrimaryKeyEncoding::Sparse).await;
|
||||
// for flat format with dense primary key encoding
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn [< test_repartition_metric_flat_dense >]() {
|
||||
let store_type = tests_integration::test_util::StorageType::$service;
|
||||
if store_type.test_on() {
|
||||
use store_api::codec::PrimaryKeyEncoding;
|
||||
common_telemetry::init_default_ut_logging();
|
||||
$crate::repartition::test_repartition_metric(store_type, true, PrimaryKeyEncoding::Dense).await;
|
||||
// for primary key format with sparse primary key encoding
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn [< test_repartition_metric_primary_key_sparse >]() {
|
||||
let store_type = tests_integration::test_util::StorageType::$service;
|
||||
if store_type.test_on() {
|
||||
use store_api::codec::PrimaryKeyEncoding;
|
||||
common_telemetry::init_default_ut_logging();
|
||||
$crate::repartition::test_repartition_metric(store_type, false, PrimaryKeyEncoding::Sparse).await;
|
||||
// for primary key format with dense primary key encoding
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn [< test_repartition_metric_primary_key_dense >]() {
|
||||
let store_type = tests_integration::test_util::StorageType::$service;
|
||||
if store_type.test_on() {
|
||||
use store_api::codec::PrimaryKeyEncoding;
|
||||
common_telemetry::init_default_ut_logging();
|
||||
$crate::repartition::test_repartition_metric(store_type, false, PrimaryKeyEncoding::Dense).await;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user