Skip to content

Understanding Test Suites

Status: Placeholder - Content coming soon

Prerequisites: Your First Module

Planned Content

This tutorial will teach you about the test pyramid, test levels, and how to choose the right test suite for different scenarios.

What You'll Learn

  • Understand the test pyramid (L0 unit → L4 smoke)
  • Learn verification types (@ov, @iv, @pv)
  • Use the four built-in test suites: unit, integration, acceptance, production-verification
  • Know when to use each test level and suite
  • Run specific test suites with r2r test --suite <name>
  • Configure custom test suites in contracts

Tutorial Structure

  1. The Test Pyramid
  2. L0: Unit tests (fast, isolated, deterministic)
  3. L1: Integration tests (component interactions)
  4. L2: Component tests (full component behavior)
  5. L3: System tests (end-to-end scenarios)
  6. L4: Smoke tests (production verification)
  7. Why the pyramid shape matters

  8. Verification Types

  9. @ov: Operational Verification (functionality)
  10. @iv: Interface Verification (contracts/APIs)
  11. @pv: Performance Verification (scalability)
  12. @piv: Production Interface Verification
  13. When to use each type

  14. Built-in Test Suites

  15. unit: L0-L1 tests (fast feedback, module-level)
  16. integration: L2 tests (Docker-based emulated tests)
  17. acceptance: L3 tests (PLTE production-like tests)
  18. production-verification: L4+PIV (production smoke tests)
  19. Trade-offs: speed vs. confidence

  20. Running Test Suites

  21. Default: r2r test (runs unit suite)
  22. Specific suite: r2r test --suite acceptance
  23. Specific module: r2r test eac-commands --suite unit
  24. List suites: r2r test list-suites

  25. Understanding Test Results

  26. Test summary: r2r show test-summary <module>
  27. Test timings: r2r show test-timings
  28. Debug failures: r2r test debug

  29. Custom Test Suites

  30. Define custom suites in contracts
  31. Filter by tags and test levels
  32. Create scenario-specific suites

Example Scenarios

The tutorial will walk through practical examples:

  • Pre-commit hook: Use unit suite for fast L0-L1 validation
  • Pull request CI: Use integration suite for Docker-based L2 validation
  • PLTE deployment: Use acceptance suite for production-like L3 validation
  • Production deployment: Use production-verification for L4 smoke tests
  • Performance testing: Use @pv tagged tests

Key Concepts Covered

  • Test pyramid and why it matters
  • Test levels and their trade-offs
  • Verification types for different concerns
  • Built-in test suites and when to use them
  • Custom test suite configuration

Best Practices

  • Run L0-L1 tests locally (fast feedback with unit suite)
  • Run L2 tests in CI (integration suite with Docker)
  • Run L3 tests in PLTE (acceptance suite for production-like validation)
  • Run L4 tests post-deployment (production-verification smoke tests)
  • Tag tests appropriately for discoverability
  • Keep test suites focused and fast

Next Steps

You now understand testing fundamentals. Continue to Core Workflows to learn daily development practices with TDD and specifications.


Tutorials | How-to Guides | Explanation | Reference

You are here: Tutorials — learning-oriented guides that take you through steps to complete a project.