# Testing configuration template - docs/testing.yaml
kind: testing
version: "1"
updated_at: "{{ today }}"

# Unit Test Configuration
unit_test:
  enabled: {{ testing.unit_test.enabled | default(true) }}
  framework: "{{ testing.unit_test.framework | default('pytest') }}"
  coverage_target: {{ testing.unit_test.coverage_target | default(0.8) }}
  patterns:
{% for pattern in testing.unit_test.patterns %}
    - "{{ pattern }}"
{% endfor %}
{% if not testing.unit_test.patterns %}
    - "**/*.test.ts"
    - "**/*.test.js"
    - "**/*.spec.ts"
    - "tests/test_*.py"
{% endif %}
  run_on:
{% for timing in testing.unit_test.run_on %}
    - "{{ timing }}"
{% endfor %}
{% if not testing.unit_test.run_on %}
    - "pre-commit"
    - "ci"
{% endif %}
  principles:
    - "Each module should have a corresponding test file"
    - "Critical functions must have test coverage"
    - "Tests should be independent and repeatable"
    - "Mock external dependencies"

# Product QA Acceptance
product_qa:
  enabled: {{ testing.product_qa.enabled | default(true) }}
  test_case_file: "{{ testing.product_qa.test_case_file | default('docs/QA_TEST_CASES.md') }}"
  case_id_pattern: "{{ testing.product_qa.case_id_pattern | default('TC-{module}-{seq}') }}"
  required_fields:
{% for field in testing.product_qa.required_fields %}
    - "{{ field }}"
{% endfor %}
{% if not testing.product_qa.required_fields %}
    - "Test ID"
    - "Related Feature"
    - "Preconditions"
    - "Test Steps"
    - "Expected Results"
{% endif %}
  statuses:
{% for status in testing.product_qa.statuses %}
    - symbol: "{{ status.symbol }}"
      meaning: "{{ status.meaning }}"
{% endfor %}
{% if not testing.product_qa.statuses %}
    - symbol: "[ ]"
      meaning: "Not tested"
    - symbol: "[x]"
      meaning: "Passed"
    - symbol: "[~]"
      meaning: "Partial"
    - symbol: "[!]"
      meaning: "Failed"
{% endif %}

# QA vs Unit Test Comparison
test_comparison:
  dimensions:
    - name: "Perspective"
      unit_test: "Developer"
      product_qa: "User"
    - name: "Goal"
      unit_test: "Code correctness"
      product_qa: "Feature completeness"
    - name: "Granularity"
      unit_test: "Function/module level"
      product_qa: "Feature/flow level"
    - name: "Execution"
      unit_test: "Automated"
      product_qa: "Automated + manual"
    - name: "Timing"
      unit_test: "On commit"
      product_qa: "On feature completion"

# QA Acceptance Protocol
qa_acceptance_protocol:
  developer_responsibilities:
    - "Add test cases when feature is complete"
    - "Provide clear operation steps and expected behavior"
    - "Note known limitations or edge cases"
  qa_responsibilities:
    - "Execute acceptance tests per test cases"
    - "Record actual results and issues"
    - "Update test status"
    - "On failure: Attach logs/screenshots"
    - "Submit bugs to known issues table"
