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
**Torrust Tracker Demo** is the complete production deployment configuration for running a live [Torrust Tracker](https://github.com/torrust/torrust-tracker) instance. This repository provides:
@@ -132,30 +153,30 @@ cd torrust-tracker-demo
132
153
make install-deps
133
154
134
155
# 3. Setup SSH key for VMs
135
-
make setup-ssh-key
156
+
make infra-config-local
136
157
137
158
# 4. Test twelve-factor deployment workflow locally
138
159
make infra-apply # Provision infrastructure (platform setup)
139
160
make app-deploy # Deploy application (Build + Release + Run stages)
- ❌ Testing application concerns from infrastructure tests
422
+
- ❌ Testing infrastructure concerns from application tests
423
+
- ✅ Keep each layer focused on its own responsibilities only
424
+
- ✅ Use `make test-ci` for complete validation that orchestrates all layers
425
+
426
+
**GitHub Actions Integration:**
427
+
428
+
- Uses `make test-ci` (not `make infra-test-ci`) to ensure all layers are tested
429
+
- Runs without virtualization (CI-compatible)
430
+
- Maintains separation of concerns for maintainable testing
431
+
352
432
#### End-to-End Smoke Testing
353
433
354
434
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.
@@ -408,8 +488,8 @@ The project implements intelligent sudo cache management to improve the user exp
408
488
409
489
```bash
410
490
make install-deps # Install dependencies
411
-
make setup-ssh-key# Configure SSH access
412
-
make test-prereq # Verify setup
491
+
make infra-config-local# Configure SSH access
492
+
make infra-test-prereq # Verify setup
413
493
```
414
494
415
495
3.**Install recommended VS Code extensions**:
@@ -439,7 +519,7 @@ The project implements intelligent sudo cache management to improve the user exp
439
519
```bash
440
520
make infra-apply # Deploy test VM
441
521
make app-deploy # Deploy application
442
-
make ssh # Verify access
522
+
make vm-ssh # Verify access
443
523
make infra-destroy # Clean up
444
524
```
445
525
@@ -448,7 +528,7 @@ The project implements intelligent sudo cache management to improve the user exp
448
528
### For Infrastructure Changes
449
529
450
530
1.**Local testing first**: Always test infrastructure changes locally
451
-
2.**Validate syntax**: Run `make test-syntax` before committing
531
+
2.**Validate syntax**: Run `make lint` before committing
4.**Test twelve-factor workflow**: Ensure both infrastructure provisioning and application deployment work
454
534
```bash
@@ -467,6 +547,27 @@ When providing assistance:
467
547
- Test infrastructure changes locally before suggesting them
468
548
- Provide clear explanations and documentation
469
549
- Consider the migration to Hetzner infrastructure in suggestions
550
+
-**CRITICAL**: Respect the three-layer testing architecture (see Testing Requirements above)
551
+
552
+
#### Testing Layer Separation (CRITICAL)
553
+
554
+
**NEVER** mix testing concerns across the three layers:
555
+
556
+
-**Infrastructure tests** (`infrastructure/tests/`) should ONLY test infrastructure concerns
557
+
-**Application tests** (`application/tests/`) should ONLY test application concerns
558
+
-**Global tests** (`tests/`) handle cross-cutting concerns and orchestration
559
+
560
+
**Common violations to avoid:**
561
+
562
+
- ❌ Adding `make lint` calls in `infrastructure/tests/test-ci.sh`
563
+
- ❌ Testing Docker Compose from infrastructure layer
564
+
- ❌ Testing Terraform from application layer
565
+
- ❌ Any layer calling commands from other layers directly
566
+
567
+
**Always use the proper orchestrator:**
568
+
569
+
- Use `make test-ci` for complete testing (orchestrates all layers)
570
+
- Use layer-specific commands only when targeting that specific layer
470
571
471
572
#### Command Execution Context
472
573
@@ -482,15 +583,15 @@ Be mindful of the execution context for different types of commands. The project
482
583
483
584
When executing commands on the remote VM, be aware of limitations with interactive sessions.
484
585
485
-
-**Problem**: The VS Code integrated terminal may not correctly handle commands that initiate a new interactive shell, such as `ssh torrust@<VM_IP>` or `make ssh`. The connection may succeed, but subsequent commands sent to that shell may not execute as expected, and their output may not be captured.
586
+
-**Problem**: The VS Code integrated terminal may not correctly handle commands that initiate a new interactive shell, such as `ssh torrust@<VM_IP>` or `make vm-ssh`. The connection may succeed, but subsequent commands sent to that shell may not execute as expected, and their output may not be captured.
486
587
487
588
-**Solution**: Prefer executing commands non-interactively whenever possible. Instead of opening a persistent SSH session, pass the command directly to `ssh`.
488
589
489
590
-**Don't do this**:
490
591
491
592
```bash
492
593
# 1. Log in
493
-
make ssh
594
+
make vm-ssh
494
595
# 2. Run command (this might fail or output won't be seen)
495
596
df -H
496
597
```
@@ -569,7 +670,7 @@ This ensures that the command is executed and its output is returned to the prim
569
670
**Pre-commit Testing Requirement**: ALWAYS run the CI test suite before committing any changes:
570
671
571
672
```bash
572
-
make test-ci
673
+
make infra-test-ci
573
674
```
574
675
575
676
This command runs all unit tests that don't require a virtual machine, including:
@@ -581,7 +682,7 @@ This command runs all unit tests that don't require a virtual machine, including
581
682
582
683
Only commit if all CI tests pass. If any tests fail, fix the issues before committing.
583
684
584
-
**Note**: End-to-end tests (`make test`) are excluded from pre-commit requirements due to their longer execution time (~5-8 minutes), but running them before pushing is strongly recommended for comprehensive validation.
685
+
**Note**: End-to-end tests (`make test-e2e`) are excluded from pre-commit requirements due to their longer execution time (~5-8 minutes), but running them before pushing is strongly recommended for comprehensive validation.
585
686
586
687
**Best Practice**: Always ask "Would you like me to commit these changes?" before performing any git state-changing operations.
0 commit comments