mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-03 18:45:35 +00:00
* test: cut integration test time and make the storage matrix meaningful
tests-integration is ~85% of workspace test CPU, and 81% of that is the
S3/S3WithCache variants of the HTTP and gRPC suites. Those suites do not
touch the object store: of the 70 matrix HTTP tests only one flushed and
read back an SST, so the matrix was paying real AWS round trips to
re-prove protocol parsing.
- Point the PR CI object-store matrix at the MinIO already started by
tests-integration/fixtures. Three GT_S3_* consumers did not read
GT_S3_ENDPOINT_URL and would have hit real AWS with MinIO credentials;
they now do.
- Add a nightly Linux job against real AWS S3, and pass GT_S3_* into the
release integration-test container. The release previously ran every
remote-backend case as a skip and only exercised the file backend.
- Give each S3WithCache test its own read cache directory. They shared
/tmp/greptimedb_cache, which the datanode wipes on startup, so a
starting test deleted the read cache of a running one.
- Add flush -> read-back assertions to the tests whose columns have a
non-trivial SST representation: JSON/JSON2 columns, native histograms,
metric-engine logical tables, and tables carrying fulltext or skipping
indexes whose puffin files only exist after a flush.
- Move eight tests that create no table out of the storage matrix.
- Make the event recorder flush interval a constructor parameter and
shorten it in the event tests, which otherwise wait a 5s window per DDL
they assert on. It is skipped by serde and never reaches config files.
- Drop duplicates: test_grpc_zstd_compression was a verbatim copy of
test_grpc_message_size_ok and is now rewritten to assert the negotiated
grpc-encoding; test_execute_copy_to_{s3,oss,gcs,azblob} were strict
prefixes of their copy_from siblings; two standalone/distributed event
test pairs shared one assertion body.
- Fix and un-ignore stddev_by_label. stddev_pop merges partial aggregates
in a parallelism-dependent order, so its last digits are unstable; the
test now compares values with a tolerance.
- Rebase the jaeger v1 fixture on the current instant. It carries
ttl=7d with 2025 timestamps, so its rows were only readable as long as
they stayed in the memtable.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test: address review — wire nightly real-S3 job into check-status, keep the short event interval
The nightly `check-status` job did not depend on the new real-S3 job, so a
failure there would not have reached the status or Slack notification.
In database_ddl_event the short interval was set by a first
`with_event_recorder_options` call and then overwritten by the pre-existing
one, which carries `..Default::default()`. Merged into a single call.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
290 lines
10 KiB
YAML
290 lines
10 KiB
YAML
on:
|
|
schedule:
|
|
- cron: "0 15 * * 1-5"
|
|
merge_group:
|
|
pull_request:
|
|
types: [ opened, synchronize, reopened, ready_for_review ]
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- 'config/**'
|
|
- '**.md'
|
|
- '.dockerignore'
|
|
- 'docker/**'
|
|
- '.gitignore'
|
|
- 'grafana/**'
|
|
- 'Makefile'
|
|
workflow_dispatch:
|
|
inputs:
|
|
ci_command:
|
|
description: Internal comment-command marker
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
name: Rust CI
|
|
|
|
env:
|
|
CARGO_UDEPS_VERSION: "0.1.61"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
fmt:
|
|
if: ${{ github.repository == 'GreptimeTeam/greptimedb' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
|
|
name: Rustfmt
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: arduino/setup-protoc@v3
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
components: rustfmt
|
|
- name: Check format
|
|
run: make fmt-check
|
|
|
|
clippy:
|
|
if: ${{ github.repository == 'GreptimeTeam/greptimedb' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
|
|
name: Clippy
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: arduino/setup-protoc@v3
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
components: clippy
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
# Shares across multiple jobs
|
|
# Shares with `Check` job
|
|
shared-key: "check-lint"
|
|
cache-all-crates: "true"
|
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
- name: Run cargo clippy
|
|
run: make clippy
|
|
|
|
check-udeps:
|
|
if: ${{ github.repository == 'GreptimeTeam/greptimedb' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
|
|
name: Check Unused Dependencies
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: arduino/setup-protoc@v3
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: "check-udeps"
|
|
cache-all-crates: "true"
|
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
- name: Install cargo-udeps
|
|
uses: taiki-e/install-action@v2
|
|
with:
|
|
tool: cargo-udeps@${{ env.CARGO_UDEPS_VERSION }}
|
|
fallback: none
|
|
- name: Check unused dependencies
|
|
run: make check-udeps
|
|
|
|
check-riscv64:
|
|
if: ${{ github.repository == 'GreptimeTeam/greptimedb' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
|
|
name: Check riscv64 build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 90
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: arduino/setup-protoc@v3
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Install riscv64 cross toolchain
|
|
run: sudo apt-get update && sudo apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
- name: Add riscv64 target
|
|
run: rustup target add riscv64gc-unknown-linux-gnu
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: "check-riscv64"
|
|
cache-all-crates: "true"
|
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
- name: Run cargo check for riscv64
|
|
run: cargo check --locked --workspace --all-targets --features servers/dashboard --target riscv64gc-unknown-linux-gnu
|
|
|
|
check-windows:
|
|
if: ${{ github.repository == 'GreptimeTeam/greptimedb' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
|
|
name: Check Windows build
|
|
runs-on: windows-2022
|
|
timeout-minutes: 60
|
|
steps:
|
|
- run: git config --global core.autocrlf false
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: ./.github/actions/setup-cyborg
|
|
- uses: arduino/setup-protoc@v3
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: KyleMayes/install-llvm-action@v1
|
|
with:
|
|
version: "14.0"
|
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: "check-windows"
|
|
cache-all-crates: "true"
|
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
- name: Run cargo check for Windows
|
|
run: cargo check --locked --workspace --all-targets
|
|
env:
|
|
RUSTFLAGS: "-D warnings"
|
|
|
|
conflict-check:
|
|
if: ${{ github.repository == 'GreptimeTeam/greptimedb' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
|
|
name: Check for conflict
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- name: Merge Conflict Finder
|
|
uses: olivernybroe/action-conflict-finder@v4.0
|
|
|
|
test:
|
|
if: ${{ github.repository == 'GreptimeTeam/greptimedb' && github.event_name != 'merge_group' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
|
|
runs-on: ubuntu-22.04-arm
|
|
timeout-minutes: 60
|
|
needs: [conflict-check, clippy, fmt, check-udeps]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: arduino/setup-protoc@v3
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: rui314/setup-mold@v1
|
|
- name: Install toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
cache: false
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
# Shares cross multiple jobs
|
|
shared-key: "coverage-test"
|
|
cache-all-crates: "true"
|
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
- name: Install latest nextest release
|
|
uses: taiki-e/install-action@nextest
|
|
|
|
- name: Setup external services
|
|
working-directory: tests-integration/fixtures
|
|
run: ../../.github/scripts/pull-test-deps-images.sh && docker compose up -d --wait
|
|
|
|
- name: Run nextest cases
|
|
run: cargo nextest run --workspace -F dashboard -F pg_kvbackend -F mysql_kvbackend -F vector_index -F ai_functions
|
|
env:
|
|
CARGO_BUILD_RUSTFLAGS: "-C link-arg=-fuse-ld=mold"
|
|
RUST_BACKTRACE: 1
|
|
RUST_MIN_STACK: 8388608 # 8MB
|
|
CARGO_INCREMENTAL: 0
|
|
# Runs the object-store matrix against the local MinIO from
|
|
# tests-integration/fixtures. Real AWS S3 is covered by the nightly
|
|
# jobs and by the release build.
|
|
GT_S3_BUCKET: greptime
|
|
GT_S3_ACCESS_KEY_ID: superpower_ci_user
|
|
GT_S3_ACCESS_KEY: superpower_password
|
|
GT_S3_REGION: us-west-2
|
|
GT_S3_ENDPOINT_URL: http://127.0.0.1:9000
|
|
GT_ETCD_TLS_ENDPOINTS: https://127.0.0.1:2378
|
|
GT_ETCD_ENDPOINTS: http://127.0.0.1:2379
|
|
GT_POSTGRES_ENDPOINTS: postgres://greptimedb:admin@127.0.0.1:5432/postgres
|
|
GT_POSTGRES15_ENDPOINTS: postgres://test_user:test_password@127.0.0.1:5433/postgres
|
|
GT_POSTGRES15_SCHEMA: test_schema
|
|
GT_MYSQL_ENDPOINTS: mysql://greptimedb:admin@127.0.0.1:3306/mysql
|
|
GT_KAFKA_ENDPOINTS: 127.0.0.1:9092
|
|
GT_KAFKA_SASL_ENDPOINTS: 127.0.0.1:9093
|
|
UNITTEST_LOG_DIR: "__unittest_logs"
|
|
|
|
coverage:
|
|
if: ${{ github.repository == 'GreptimeTeam/greptimedb' && github.event_name == 'merge_group' }}
|
|
runs-on: ubuntu-22.04-8-cores
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- uses: arduino/setup-protoc@v3
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: rui314/setup-mold@v1
|
|
- name: Install toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
components: llvm-tools
|
|
cache: false
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
# Shares cross multiple jobs
|
|
shared-key: "coverage-test"
|
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
- name: Install latest nextest release
|
|
uses: taiki-e/install-action@nextest
|
|
- name: Install cargo-llvm-cov
|
|
uses: taiki-e/install-action@cargo-llvm-cov
|
|
|
|
- name: Setup external services
|
|
working-directory: tests-integration/fixtures
|
|
run: ../../.github/scripts/pull-test-deps-images.sh && docker compose up -d --wait
|
|
|
|
- name: Run nextest cases
|
|
run: cargo llvm-cov nextest --workspace --lcov --output-path lcov.info -F dashboard -F pg_kvbackend -F mysql_kvbackend -F vector_index -F ai_functions
|
|
env:
|
|
CARGO_BUILD_RUSTFLAGS: "-C link-arg=-fuse-ld=mold"
|
|
RUST_BACKTRACE: 1
|
|
CARGO_INCREMENTAL: 0
|
|
# Runs the object-store matrix against the local MinIO from
|
|
# tests-integration/fixtures. Real AWS S3 is covered by the nightly
|
|
# jobs and by the release build.
|
|
GT_S3_BUCKET: greptime
|
|
GT_S3_ACCESS_KEY_ID: superpower_ci_user
|
|
GT_S3_ACCESS_KEY: superpower_password
|
|
GT_S3_REGION: us-west-2
|
|
GT_S3_ENDPOINT_URL: http://127.0.0.1:9000
|
|
GT_ETCD_TLS_ENDPOINTS: https://127.0.0.1:2378
|
|
GT_ETCD_ENDPOINTS: http://127.0.0.1:2379
|
|
GT_POSTGRES_ENDPOINTS: postgres://greptimedb:admin@127.0.0.1:5432/postgres
|
|
GT_POSTGRES15_ENDPOINTS: postgres://test_user:test_password@127.0.0.1:5433/postgres
|
|
GT_POSTGRES15_SCHEMA: test_schema
|
|
GT_MYSQL_ENDPOINTS: mysql://greptimedb:admin@127.0.0.1:3306/mysql
|
|
GT_KAFKA_ENDPOINTS: 127.0.0.1:9092
|
|
GT_KAFKA_SASL_ENDPOINTS: 127.0.0.1:9093
|
|
UNITTEST_LOG_DIR: "__unittest_logs"
|
|
- name: Codecov upload
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: ./lcov.info
|
|
flags: rust
|
|
fail_ci_if_error: false
|
|
verbose: true
|