Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
298 changes: 7 additions & 291 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ version: '3'
# Prism Data Access Gateway - Task Build System
# Replaces Makefile with automatic change detection and parallel execution

includes:
test:
taskfile: ./testing/Taskfile.yml
dir: .

vars:
# Build directories (hygienic out-of-source builds)
BUILD_DIR: '{{.ROOT_DIR}}/build'
Expand Down Expand Up @@ -312,299 +317,10 @@ tasks:
done
- echo "✓ Debug builds complete"

# ============================================================================
# Testing Tasks
# ============================================================================

test:
desc: Run all tests (unit, acceptance, integration)
deps: [test-proxy, test-patterns, test-operator, test-acceptance, test-integration-go]
cmds:
- echo "✓ All tests passed"

test-parallel:
desc: Run all tests in parallel (fast!)
cmds:
- echo "Running tests in parallel..."
- uv run tooling/parallel_test.py --log-dir {{.TEST_LOGS_DIR}}
- echo "✓ Parallel tests complete"

test-parallel-fast:
desc: Run fast tests only in parallel (skip acceptance)
cmds:
- echo "Running fast tests in parallel..."
- uv run tooling/parallel_test.py --fast --log-dir {{.TEST_LOGS_DIR}}
- echo "✓ Fast parallel tests complete"

test-parallel-fail-fast:
desc: Run tests in parallel with fail-fast
cmds:
- echo "Running tests in parallel with fail-fast..."
- uv run tooling/parallel_test.py --fail-fast --log-dir {{.TEST_LOGS_DIR}}
- echo "✓ Parallel tests complete"

test-proxy:
desc: Run Rust proxy unit tests
sources:
- prism-proxy/src/**/*.rs
- prism-proxy/Cargo.toml
cmds:
- echo "Running Rust proxy tests..."
- cd prism-proxy && cargo test --lib
- echo "✓ Proxy unit tests passed"

test-patterns:
desc: Run all Go pattern tests
deps: [test-core, test-prismctl, test-memstore, test-redis, test-nats, test-kafka, test-postgres]

test-core:
desc: Run Core SDK tests
sources:
- pkg/plugin/**/*.go
cmds:
- echo "Running Core SDK tests..."
- cd pkg/plugin && go test -v -cover ./...
- echo "✓ Core SDK tests passed"

test-prismctl:
desc: Run prismctl tests
sources:
- cmd/prismctl/**/*.go
cmds:
- echo "Running prismctl tests..."
- cd cmd/prismctl && go test -v -cover ./...
- echo "✓ prismctl tests passed"

test-memstore:
desc: Run MemStore driver tests
sources:
- pkg/drivers/memstore/**/*.go
cmds:
- echo "Running memstore tests..."
- cd pkg/drivers/memstore && go test -v -cover ./...
- echo "✓ memstore tests passed"

test-redis:
desc: Run Redis driver tests
sources:
- pkg/drivers/redis/**/*.go
cmds:
- echo "Running redis tests..."
- cd pkg/drivers/redis && go test -v -cover ./...
- echo "✓ redis tests passed"

test-nats:
desc: Run NATS driver tests
sources:
- pkg/drivers/nats/**/*.go
cmds:
- echo "Running nats tests..."
- cd pkg/drivers/nats && go test -v -cover ./...
- echo "✓ nats tests passed"

test-kafka:
desc: Run Kafka driver tests
sources:
- pkg/drivers/kafka/**/*.go
cmds:
- echo "Running kafka tests..."
- cd pkg/drivers/kafka && go test -v -cover ./...
- echo "✓ kafka tests passed"

test-postgres:
desc: Run Postgres driver tests
sources:
- pkg/drivers/postgres/**/*.go
cmds:
- echo "Running postgres tests..."
- cd pkg/drivers/postgres && go test -v -cover ./...
- echo "✓ postgres tests passed"

test-operator:
desc: Run Kubernetes operator controller tests
sources:
- prism-operator/controllers/**/*.go
- prism-operator/api/**/*.go
cmds:
- echo "Running operator controller tests..."
- cd prism-operator/controllers && go test -v -cover ./...
- echo "✓ Operator controller tests passed"

test-integration:
desc: Run integration tests (requires built binaries)
sources:
- prism-proxy/tests/**/*.rs
cmds:
- echo "Running integration tests..."
- cd prism-proxy && cargo test --test integration_test -- --ignored --nocapture
- echo "✓ Integration tests passed"

test-all:
desc: Run all tests (unit, integration, acceptance)
deps: [test, test-integration, test-integration-go, test-acceptance]
cmds:
- echo "✓ All tests (unit + integration + acceptance) passed"

test-acceptance:
desc: Run all acceptance tests with testcontainers
deps:
- test-acceptance-interfaces
- test-acceptance-redis
- test-acceptance-nats
- test-acceptance-kafka
- test-acceptance-postgres
cmds:
- echo "✓ All acceptance tests passed"

test-acceptance-interfaces:
desc: Run interface-based acceptance tests
sources:
- tests/acceptance/interfaces/**/*.go
cmds:
- echo "Running interface-based acceptance tests..."
- cd tests/acceptance/interfaces && go test -v -timeout 10m ./...
- echo "✓ Interface-based acceptance tests passed"

test-acceptance-redis:
desc: Run Redis acceptance tests
sources:
- tests/acceptance/redis/**/*.go
cmds:
- echo "Running redis acceptance tests..."
- cd tests/acceptance/redis && go test -v -timeout 10m ./...
- echo "✓ redis acceptance tests passed"

test-acceptance-nats:
desc: Run NATS acceptance tests
sources:
- tests/acceptance/nats/**/*.go
cmds:
- echo "Running nats acceptance tests..."
- cd tests/acceptance/nats && go test -v -timeout 10m ./...
- echo "✓ nats acceptance tests passed"

test-acceptance-kafka:
desc: Run Kafka acceptance tests
sources:
- tests/acceptance/kafka/**/*.go
cmds:
- echo "Running kafka acceptance tests..."
- cd tests/acceptance/kafka && go test -v -timeout 10m ./...
- echo "✓ kafka acceptance tests passed"

test-acceptance-postgres:
desc: Run Postgres acceptance tests
sources:
- tests/acceptance/postgres/**/*.go
cmds:
- echo "Running postgres acceptance tests..."
- cd tests/acceptance/postgres && go test -v -timeout 10m ./...
- echo "✓ postgres acceptance tests passed"

test-acceptance-quiet:
desc: Run all acceptance tests in quiet mode
cmds:
- echo "Running acceptance tests in quiet mode..."
- PRISM_TEST_QUIET=1 task test-acceptance
- echo "✓ All acceptance tests passed (quiet mode)"

test-acceptance-parallel:
desc: Run acceptance tests in parallel with matrix report
cmds:
- echo "Running acceptance tests in parallel..."
- mkdir -p {{.BUILD_DIR}}/reports
- uv run tooling/parallel_acceptance_test.py
- echo "✓ Parallel acceptance tests complete"

test-integration-go:
desc: Run Go integration tests (proxy-pattern lifecycle)
sources:
- tests/integration/**/*.go
cmds:
- echo "Running Go integration tests..."
- cd tests/integration && go test -v -timeout 5m ./...
- echo "✓ Go integration tests passed"

test-integration-admin:
desc: Run admin cluster integration tests (multi-node Raft)
deps: [prism-admin]
sources:
- tests/integration/admin/**/*.go
cmds:
- echo "Running admin cluster integration tests..."
- cd tests/integration/admin && go test -v -timeout 15m ./...
- echo "✓ Admin cluster integration tests passed"

test-integration-shutdown:
desc: Run graceful shutdown integration tests (RFC-041)
sources:
- tests/integration/shutdown/**/*.go
cmds:
- echo "Running graceful shutdown integration tests..."
- cd tests/integration/shutdown && go test -v -timeout 5m ./...
- echo "✓ Graceful shutdown integration tests passed"

test-integration-k8s:
desc: Run Kubernetes integration tests (requires local K8s cluster and built images)
sources:
- tests/integration/k8s/**/*.go
- prism-operator/api/**/*.go
- prism-operator/controllers/**/*.go
cmds:
- echo "Running Kubernetes integration tests..."
- echo "Prerequisites:"
- echo " - K8s cluster running (kubectl cluster-info)"
- echo " - Docker images built (task k8s-build-images)"
- cd tests/integration/k8s && go test -v -timeout 30m ./...
- echo "✓ Kubernetes integration tests passed"

test-integration-k8s-short:
desc: Run quick Kubernetes integration tests (minimal test only)
cmds:
- echo "Running quick Kubernetes integration tests..."
- cd tests/integration/k8s && go test -v -timeout 10m -short ./...
- echo "✓ Quick Kubernetes integration tests passed"

# ============================================================================
# MCP Integration Tests
# ============================================================================

test-infra-up:
desc: Start docker-compose test infrastructure (Prism proxy + backends)
cmds:
- echo "Starting test infrastructure..."
- '{{.COMPOSE}} -f docker-compose.test.yml up -d'
- echo "Waiting for services to be healthy..."
- sleep 10
- echo "✓ Test infrastructure running"

test-infra-down:
desc: Stop docker-compose test infrastructure
cmds:
- echo "Stopping test infrastructure..."
- '{{.COMPOSE}} -f docker-compose.test.yml down -v'
- echo "✓ Test infrastructure stopped"

test-mcp:
desc: Run MCP integration tests (requires test infrastructure)
deps: [test-infra-up]
dir: tests/testing/mcp
cmds:
- echo "Installing MCP test dependencies..."
- npm install --silent
- echo "Running MCP integration tests..."
- npm test
- echo "✓ MCP integration tests passed"

test-mcp-full:
desc: Run MCP tests with full lifecycle (start infra, test, stop)
cmds:
- task test-infra-up
- task test-mcp
- defer: { task: test-infra-down }

# ============================================================================
# Code Coverage Tasks
# NOTE: All test tasks have moved to testing/Taskfile.yml (test: namespace)
# Use: task test:unit-all, task test:integration-all, task test:all
# ============================================================================

coverage:
Expand Down
Loading
Loading