[env] # Force C17 standard to avoid C23 'bool' keyword conflict when building older PostgreSQL versions CFLAGS = "-std=gnu17" [tools] postgres = ["16", "17", "18"] [tasks.configure] run = "cmake -B build --preset default" description = "Configure build with CMake (Debug)" [tasks."configure:release"] run = "cmake -B build --preset release" description = "Configure build with CMake (Release)" # Default build uses PG 18 (required for WaitEventExtensionNew API) [tasks.build] run = "cmake -B build -G Ninja -DPG_CONFIG=$(mise where postgres@18)/bin/pg_config && cmake --build build" description = "Build the extension for PostgreSQL 18" [tasks."build:release"] run = "cmake -B build --preset release && cmake --build build" description = "Build the extension in release mode" [tasks.install] run = "cmake --install build" description = "Install the extension" [tasks.clean] run = "rm -rf build" description = "Clean build artifacts" [tasks.compdb] run = "cp build/compile_commands.json ." description = "Copy compile_commands.json to project root" [tasks.format] run = "fd -e cc -e h . src include | xargs clang-format -i" description = "Format code with clang-format" [tasks.lint] run = "fd -e cc . src | xargs clang-tidy" description = "Run clang-tidy linting" [tasks.installcheck] run = "make -C $(pg_config --sharedir)/.. installcheck REGRESS_OPTS='--inputdir=$(pwd)' || pg_regress --inputdir=$(pwd) --bindir=$(pg_config --bindir) pg_stat_ch" description = "Run regression tests" # Test tasks using scripts/run-tests.sh # Default PG version for tests (requires PG 17+ for WaitEventExtensionNew API) [tasks."test:regress"] run = "./scripts/run-tests.sh 18 regress" depends = ["build", "install"] description = "Run SQL regression tests (PG 18)" [tasks."test:tap"] run = "./scripts/run-tests.sh 18 tap" depends = ["build", "install"] description = "Run TAP tests (PG 18)" [tasks."test:isolation"] run = "./scripts/run-tests.sh 18 isolation" depends = ["build", "install"] description = "Run isolation tests (PG 18)" [tasks."test:stress"] run = "./scripts/run-tests.sh 18 stress" depends = ["build", "install"] description = "Run stress test only (PG 18)" [tasks."test:clickhouse"] run = "./scripts/run-tests.sh 18 clickhouse" depends = ["build", "install"] description = "Run ClickHouse integration tests (requires Docker)" [tasks."clickhouse:start"] run = "docker compose -f docker/docker-compose.test.yml up -d --wait" description = "Start ClickHouse test container" [tasks."clickhouse:stop"] run = "docker compose -f docker/docker-compose.test.yml down -v" description = "Stop ClickHouse test container" [tasks."clickhouse:logs"] run = "docker compose -f docker/docker-compose.test.yml logs -f" description = "View ClickHouse container logs" [tasks."test:unit"] run = "cmake -B build_unit -G Ninja -DPG_CONFIG=$(mise where postgres@18)/bin/pg_config -DPSCH_BUILD_UNIT_TESTS=ON && cmake --build build_unit --target hostname_test && ctest --test-dir build_unit --output-on-failure" description = "Build and run C++ unit tests" [tasks."test:otel"] run = "./scripts/run-tests.sh ../postgres/install_tap otel" description = "Run OTel integration tests (requires Docker + TAP-enabled PG build)" [tasks.perf] run = "./scripts/run-perf.sh" description = "Run OTel throughput benchmark + perf profiling in Docker" [tasks."otel:start"] run = "docker compose -f docker/docker-compose.otel.yml up -d" description = "Start OTel collector test container" [tasks."otel:stop"] run = "docker compose -f docker/docker-compose.otel.yml down -v" description = "Stop OTel collector test container" [tasks."otel:logs"] run = "docker compose -f docker/docker-compose.otel.yml logs -f" description = "View OTel collector container logs" [tasks."test:all"] run = "./scripts/run-tests.sh 18 all" depends = ["build", "install"] description = "Run all tests (PG 18)" # Per-version build tasks [tasks."build:16"] run = "rm -rf build && cmake -B build -G Ninja -DPG_CONFIG=$(mise where postgres@16)/bin/pg_config && cmake --build build" description = "Build for PostgreSQL 16" [tasks."build:17"] run = "rm -rf build && cmake -B build -G Ninja -DPG_CONFIG=$(mise where postgres@17)/bin/pg_config && cmake --build build" description = "Build for PostgreSQL 17" [tasks."build:18"] run = "rm -rf build && cmake -B build -G Ninja -DPG_CONFIG=$(mise where postgres@18)/bin/pg_config && cmake --build build" description = "Build for PostgreSQL 18" [tasks."build:all"] depends = ["build:16", "build:17", "build:18"] description = "Build for all PostgreSQL versions"