You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
refactor: [#14] separate testing concerns across three-layer architecture
- Refactor infrastructure/tests/test-ci.sh to only test infrastructure concerns
- Remove global 'make lint' calls from infrastructure layer
- Create new application/tests/test-ci.sh for application-only testing
- Create new tests/test-ci.sh for project-wide orchestration
- Update Makefile with proper layer separation (infra-test-ci, app-test-ci, test-ci)
- Update GitHub workflow to use 'make test-ci' for complete validation
- Fix application tests to be CI-friendly (optional environment files)
- Add comprehensive documentation in .github/copilot-instructions.md
- Document three-layer testing architecture with clear boundaries
- Add AI assistant guidelines to prevent future violations
Testing Hierarchy:
- make test-ci: Project-wide orchestrator (global + infra + app)
- make infra-test-ci: Infrastructure layer only
- make app-test-ci: Application layer only
Prevents mixing concerns like calling global commands from layer-specific tests.
- ❌ Testing application concerns from infrastructure tests
401
+
- ❌ Testing infrastructure concerns from application tests
402
+
- ✅ Keep each layer focused on its own responsibilities only
403
+
- ✅ Use `make test-ci` for complete validation that orchestrates all layers
404
+
405
+
**GitHub Actions Integration:**
406
+
407
+
- Uses `make test-ci` (not `make infra-test-ci`) to ensure all layers are tested
408
+
- Runs without virtualization (CI-compatible)
409
+
- Maintains separation of concerns for maintainable testing
410
+
351
411
#### End-to-End Smoke Testing
352
412
353
413
For verifying the functionality of the tracker from an end-user's perspective (e.g., simulating announce/scrape requests), refer to the **Smoke Testing Guide**. This guide explains how to use the official `torrust-tracker-client` tools to perform black-box testing against a running tracker instance without needing a full BitTorrent client.
@@ -466,6 +526,27 @@ When providing assistance:
466
526
- Test infrastructure changes locally before suggesting them
467
527
- Provide clear explanations and documentation
468
528
- Consider the migration to Hetzner infrastructure in suggestions
529
+
-**CRITICAL**: Respect the three-layer testing architecture (see Testing Requirements above)
530
+
531
+
#### Testing Layer Separation (CRITICAL)
532
+
533
+
**NEVER** mix testing concerns across the three layers:
534
+
535
+
-**Infrastructure tests** (`infrastructure/tests/`) should ONLY test infrastructure concerns
536
+
-**Application tests** (`application/tests/`) should ONLY test application concerns
537
+
-**Global tests** (`tests/`) handle cross-cutting concerns and orchestration
538
+
539
+
**Common violations to avoid:**
540
+
541
+
- ❌ Adding `make lint` calls in `infrastructure/tests/test-ci.sh`
542
+
- ❌ Testing Docker Compose from infrastructure layer
543
+
- ❌ Testing Terraform from application layer
544
+
- ❌ Any layer calling commands from other layers directly
545
+
546
+
**Always use the proper orchestrator:**
547
+
548
+
- Use `make test-ci` for complete testing (orchestrates all layers)
549
+
- Use layer-specific commands only when targeting that specific layer
0 commit comments