# VPS Test Configuration for saorsa-core
# Used by /vps-test skill for autonomous deployment and testing

# Note: saorsa-core is a library crate, so testing is different
# This config runs integration tests that exercise the core library

project: saorsa-core

binary:
  name: saorsa-core-test
  # May need a dedicated test binary or use cargo test
  build: cargo zig build --release --target x86_64-unknown-linux-gnu --tests
  target: target/x86_64-unknown-linux-gnu/release/deps/saorsa_core-*
  local_build: cargo build --release --tests

deploy:
  install_path: /opt/saorsa-core/
  service_name: saorsa-core-test
  # For library testing, may only need a subset of nodes
  nodes:
    - saorsa-2
    - saorsa-3
    - saorsa-4
  post_deploy:
    - chmod +x /opt/saorsa-core/saorsa-core-test

bootstrap:
  registry: https://saorsa-1.saorsalabs.com
  nodes:
    - saorsa-2.saorsalabs.com:9000
    - saorsa-3.saorsalabs.com:9000
  wait_for_registration: 30

tests:
  # Library tests run via cargo test
  custom:
    - name: unit_tests
      command: cd /opt/saorsa-core && ./saorsa-core-test --test-threads=1
      success_pattern: "test result: ok"
      timeout_seconds: 300

    - name: integration_tests
      command: cd /opt/saorsa-core && ./saorsa-core-test --ignored
      success_pattern: "test result: ok"
      timeout_seconds: 600

    - name: property_tests
      command: cd /opt/saorsa-core && ./saorsa-core-test proptest
      success_pattern: "test result: ok"
      timeout_seconds: 300

  # Basic connectivity verification (for network-dependent tests)
  connectivity:
    enabled: true
    success_criteria:
      direct: 99
      nat_traversed: 85
      relay: 100
    nat_cooloff_seconds: 30
    timeout_seconds: 10

soak:
  wait_1hr: true
  wait_6hr: true
  regression_tolerance: 0
  check_interval_minutes: 15  # Less frequent for library tests

notifications:
  voice: true
  on_events:
    - start
    - test_fail
    - fix_commit
    - complete
    - error
