@@ -705,7 +705,83 @@ Add link to HTTPS setup guide.
705705
706706# ## Phase 6: E2E Testing (5-6 hours)
707707
708- **Automated E2E Tests**:
708+ **Revised Strategy** (2026-01-20):
709+
710+ The original plan to test multiple HTTPS patterns is not feasible because the Torrust Tracker
711+ has only one config option to enable the TLS proxy - we cannot have some HTTP trackers using
712+ HTTPS while others use HTTP simultaneously. Instead, we'll take a simpler, more maintainable approach :
713+
714+ 1. **Enable HTTPS for all HTTP trackers** in the E2E test configuration
715+ 2. **Use the `test` command** (smoke test) instead of manual validation
716+ 3. **Test non-HTTPS via UDP tracker** which never uses the Caddy proxy
717+
718+ This approach provides comprehensive HTTPS coverage while leveraging existing infrastructure.
719+
720+ Implementation Plan :
721+
722+ - **Step 1: Add smoke test execution to E2E workflow**
723+ - [ ] Add `run_smoke_tests()` method to `E2eTestRunner` in `src/testing/e2e/tasks/black_box/test_runner.rs`
724+ - [ ] Execute `cargo run --bin torrust-tracker-deployer -- test <env-name>` via `ProcessRunner`
725+ - [ ] The existing `test` command already supports HTTPS via `ServiceEndpoint::https()` with domain resolution
726+ - [ ] Call `test_runner.run_smoke_tests()` in `run_deployer_workflow()` after `run_services()`
727+ - [ ] Verify E2E tests pass on GitHub Actions (may require runner changes)
728+ - [ ] Commit and push to verify CI passes
729+
730+ - **Step 2: Enable HTTPS in E2E test configuration**
731+ - [ ] Modify `E2eConfigEnvironment::to_json_config()` in `src/testing/e2e/containers/tracker_ports.rs` :
732+ - [ ] Add `domain` and `use_tls_proxy : true` for each HTTP tracker
733+ - [ ] Add `domain` and `use_tls_proxy : true` for HTTP API
734+ - [ ] Add `domain` and `use_tls_proxy : true` for Grafana
735+ - [ ] Add `https` section with `admin_email` and `use_staging : true`
736+ - [ ] Use `.local` domains (e.g., `api.tracker.local`, `http1.tracker.local`)
737+ - [ ] Caddy's internal CA automatically handles `.local` domain certificates
738+ - [ ] Wait for Caddy certificate acquisition after `run_services()` (add brief delay or retry logic)
739+
740+ - **Step 3: Verify HTTPS E2E tests pass**
741+ - [ ] Run E2E tests locally : ` cargo run --bin e2e-deployment-workflow-tests`
742+ - [ ] Verify `test` command validates HTTPS endpoints correctly
743+ - [ ] Verify Caddy logs show successful certificate acquisition
744+ - [ ] Run all linters and pre-commit checks
745+ - [ ] Push to GitHub and verify CI passes
746+
747+ **Configuration Example** (E2E test config):
748+
749+ ` ` ` json
750+ {
751+ "tracker": {
752+ "http_trackers": [
753+ {
754+ "bind_address": "0.0.0.0:7070",
755+ "domain": "http1.tracker.local",
756+ "use_tls_proxy": true
757+ }
758+ ],
759+ "http_api": {
760+ "bind_address": "0.0.0.0:1212",
761+ "domain": "api.tracker.local",
762+ "use_tls_proxy": true,
763+ "admin_token": "MyAccessToken"
764+ }
765+ },
766+ "grafana": {
767+ "admin_user": "admin",
768+ "admin_password": "e2e-test-password",
769+ "domain": "grafana.tracker.local",
770+ "use_tls_proxy": true
771+ },
772+ "https": {
773+ "admin_email": "admin@tracker.local",
774+ "use_staging": true
775+ }
776+ }
777+ ` ` `
778+
779+ **Non-HTTPS coverage** (tested implicitly):
780+
781+ - UDP tracker - never uses Caddy proxy, validates non-TLS path
782+ - Health Check API - can be tested independently without TLS
783+
784+ **Automated E2E Tests** (deferred - may not be needed):
709785
710786- [ ] Create E2E test environment configs with various HTTPS patterns :
711787 - [ ] All services HTTPS
0 commit comments