promocrypt-core 1.1.0

Core library for cryptographically secure promotional code generation
Documentation
# docker-compose.test.yml - Test orchestration for promocrypt-core
#
# Usage:
#   docker-compose -f docker-compose.test.yml up --build
#   docker-compose -f docker-compose.test.yml run test cargo test --release
#   docker-compose -f docker-compose.test.yml down

version: '3.8'

services:
  test:
    build:
      context: .
      dockerfile: Dockerfile.test
    volumes:
      - ./test-results:/app/test-results
      - cargo-cache:/usr/local/cargo/registry
      - cargo-git:/usr/local/cargo/git
      - target-cache:/app/target
    environment:
      - RUST_BACKTRACE=1
      - RUST_LOG=debug
    command: >
      sh -c "
        echo '=== Running promocrypt-core Test Suite ===' &&
        mkdir -p /app/test-results &&

        echo '' &&
        echo '1. Format check...' &&
        cargo fmt --check 2>&1 | tee /app/test-results/fmt.txt &&

        echo '' &&
        echo '2. Clippy lint check...' &&
        cargo clippy -- -D warnings 2>&1 | tee /app/test-results/clippy.txt &&

        echo '' &&
        echo '3. Unit tests...' &&
        cargo test --lib --release 2>&1 | tee /app/test-results/unit-tests.txt &&

        echo '' &&
        echo '4. Integration tests...' &&
        cargo test --test '*' --release 2>&1 | tee /app/test-results/integration-tests.txt &&

        echo '' &&
        echo '5. Doc tests...' &&
        cargo test --doc --release 2>&1 | tee /app/test-results/doc-tests.txt &&

        echo '' &&
        echo '6. Build release...' &&
        cargo build --release 2>&1 | tee /app/test-results/build.txt &&

        echo '' &&
        echo '=== All tests completed ===' &&
        echo 'Results saved to /app/test-results/'
      "

  # Quick test variant for CI
  test-quick:
    build:
      context: .
      dockerfile: Dockerfile.test
    volumes:
      - cargo-cache:/usr/local/cargo/registry
      - cargo-git:/usr/local/cargo/git
    environment:
      - RUST_BACKTRACE=1
    command: cargo test --release

  # Benchmark runner
  bench:
    build:
      context: .
      dockerfile: Dockerfile.test
    volumes:
      - ./bench-results:/app/bench-results
      - cargo-cache:/usr/local/cargo/registry
      - cargo-git:/usr/local/cargo/git
    environment:
      - RUST_BACKTRACE=1
    command: >
      sh -c "
        echo '=== Running Benchmarks ===' &&
        cargo bench 2>&1 | tee /app/bench-results/benchmarks.txt
      "

  # FFI test (builds cdylib and runs C tests if available)
  ffi-test:
    build:
      context: .
      dockerfile: Dockerfile.test
    volumes:
      - cargo-cache:/usr/local/cargo/registry
      - cargo-git:/usr/local/cargo/git
    command: >
      sh -c "
        echo '=== Building FFI Library ===' &&
        cargo build --release --features ffi &&
        echo 'FFI library built successfully' &&
        ls -la target/release/libpromocrypt* || echo 'Library files:'
      "

volumes:
  cargo-cache:
  cargo-git:
  target-cache: