Files
greptimedb/tests-integration/AGENTS.md
T
dennis zhuangandWenyXu 69623e000b refactor(tests-integration): drop duplicated harness code and tests (#10856)
* refactor(tests-integration): extract datanode RPC transport

Signed-off-by: WenyXu <wenymedia@gmail.com>

* refactor(tests-integration): share cluster startup orchestration

Signed-off-by: WenyXu <wenymedia@gmail.com>

* refactor(tests-integration): share migration and repartition scenarios

Signed-off-by: WenyXu <wenymedia@gmail.com>

* refactor(tests-integration): clarify shared cluster helper APIs

Signed-off-by: WenyXu <wenymedia@gmail.com>

* test(repartition): check partition metadata as soon as ALTER returns

The synchronous ALTER waits for its procedure and invalidates the local frontend cache before returning. Query the same frontend immediately to exercise that guarantee.

Signed-off-by: WenyXu <wenymedia@gmail.com>

* fix(tests-integration): bound datanode registration by a configurable timeout

Signed-off-by: WenyXu <wenymedia@gmail.com>

* refactor(tests-integration): build slow-query and histogram PG/MySQL servers through the shared helpers

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor(tests-integration): drop instance tests covered by sqlness and table-drive COPY and external table cases

test_execute_insert_by_select and test_execute_query are covered by insert_select.sql and sum.sql, which assert the same rows and error messages in both modes; test_execute_insert and test_execute_create only checked affected rows. The four cloud COPY tests share one body, and the parquet and CSV external table fixtures hold the same rows.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor(tests-integration): share the Kafka cluster setup of region migration tests

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor(tests-integration): fold the OTel Arrow exemplar tests into one and share the metrics payload

test_otel_arrow_exemplars_without_metric_engine and test_exemplar_otel_arrow_skips_non_metric_source checked the same skip; the surviving test now also verifies decoding and a following histogram batch in both deployments.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor(tests-integration): share the GC garbage setup and checks across GC trigger tests

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor(tests-integration): share submitted procedure lookup across event tests

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(tests-integration): box the metasrv startup future to fit the default test stack

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor(tests-integration): require a boxed metasrv future and tidy cluster docs

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: WenyXu <wenymedia@gmail.com>
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Co-authored-by: WenyXu <wenymedia@gmail.com>
2026-12-03 05:18:08 +00:00

2.3 KiB

tests-integration — Agent & Contributor Guide

Integration test modules are registered in tests/main.rs (autotests = false). Shared instance and storage helpers live in src/instance.rs and src/test_util.rs. Cluster setup lives in src/cluster.rs, with datanode registration checks in src/cluster/registration.rs. Datanode RPC serving, the duplex and TCP paths, and DoGet accounting live in src/cluster/transport.rs. Shared migration and partition scenarios live in src/cluster/migration.rs and src/cluster/partition.rs. See README.md for external-service setup.

Import/export portability

Import/export and COPY tests must work on Windows as well as Linux/macOS. #9227 records export tests failing because native Windows paths were compared with /-separated COPY locations.

  • Keep native filesystem paths (Path/PathBuf), file URIs, and /-separated object-store keys distinct. Compare filesystem paths as paths; for COPY location assertions, normalize both sides to the defined location format. Do not compare native PathBuf::join().display() strings directly with /-separated export locations.
  • Build filesystem fixtures with temporary directories and convert absolute paths to file URIs with Url::from_file_path; do not hard-code /tmp or concatenate file:// with native paths. Close file handles before rename or cleanup, including import-state writes.
  • Linux Nightly Build runs tests as root in dev-builder; chmod/read-only permissions cannot reliably force I/O failures. For storage error propagation tests, reuse object_store::layers::mock to inject deterministic failures rather than relying on execution-user permissions.

Validation

Run focused cases from the repository root:

cargo nextest run -p tests-integration --test main -E 'test(<test-name>)'

For import/export changes, run affected tests on Windows. The reference job is test-on-windows in Nightly CI (cargo nextest run -F dashboard). Linux/macOS success does not establish Windows compatibility. If Windows execution is unavailable, explicitly report that gap and inspect platform-specific paths and file operations.