# Integration Test Runner Dockerfile for RuVector-Postgres # Provides full Rust toolchain and test dependencies FROM rust:1.83-bookworm ARG PG_VERSION=17 # Add PostgreSQL APT repository for client tools RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - # Install dependencies RUN apt-get update && apt-get install -y \ # PostgreSQL client postgresql-client-${PG_VERSION} \ # Build dependencies libclang-dev \ clang \ pkg-config \ libssl-dev \ cmake \ # Test utilities jq \ curl \ netcat-openbsd \ # Performance analysis linux-perf \ && rm -rf /var/lib/apt/lists/* # Install pgrx for PostgreSQL extension testing RUN cargo install cargo-pgrx --version 0.12.6 --locked # Install additional Rust tools for testing RUN cargo install cargo-nextest --locked && \ cargo install cargo-criterion --locked && \ cargo install cargo-llvm-cov --locked # Create app directory WORKDIR /app # Pre-download common dependencies (speeds up subsequent builds) RUN cargo new --lib dummy && \ cd dummy && \ echo 'pgrx = "0.12"' >> Cargo.toml && \ echo 'serde = { version = "1.0", features = ["derive"] }' >> Cargo.toml && \ echo 'serde_json = "1.0"' >> Cargo.toml && \ echo 'rand = "0.8"' >> Cargo.toml && \ cargo fetch && \ cd .. && \ rm -rf dummy # Environment setup ENV RUST_BACKTRACE=1 ENV RUST_LOG=info ENV CARGO_HOME=/usr/local/cargo ENV PATH="${CARGO_HOME}/bin:${PATH}" # Default command runs tests CMD ["cargo", "test", "--release", "--features", "pg_test"]