Fix E2E Infrastructure Preservation
Type: Task
Priority: High
Parent Epic: #10 - UI Layer Destroy Command
Estimated Effort: 1-2 hours
📋 Issue Overview
Restore the --keep flag functionality in E2E test binaries to preserve infrastructure for manual testing workflows. This is a prerequisite for testing the destroy CLI command implementation.
🎯 Problem Statement
During E2E binary refactoring, the new run_infrastructure_destroy function doesn't respect the --keep CLI argument. This breaks the ability to preserve test infrastructure for manual verification, which is essential for testing the destroy CLI command.
Current Broken Workflow
# This should preserve infrastructure but doesn't
cargo run --bin e2e-tests-full -- --keep
cargo run --bin e2e-provision-and-destroy-tests -- --keep
# Infrastructure gets destroyed despite --keep flag
Required Manual Testing Workflow
# 1. Provision infrastructure and keep it
cargo run --bin e2e-provision-and-destroy-tests -- --keep
# Verify infrastructure is preserved
ls data/e2e-provision/ # Should exist
ls build/e2e-provision/ # Should exist
lxc list | grep e2e-provision # Should show VM running
# 2. Manually test destroy CLI command (when implemented)
torrust-tracker-deployer destroy e2e-provision
# 3. Verify complete cleanup using LXD commands (see docs/tech-stack/lxd.md)
ls data/e2e-provision/ # Should not exist
ls build/e2e-provision/ # Should not exist
lxc list | grep e2e-provision # Should return nothing (VM destroyed)
🎯 Goals
- Fix
--keep flag functionality in both E2E test binaries
- Ensure
run_infrastructure_destroy function respects the keep parameter
- Enable reliable manual testing workflow for destroy CLI command
- Maintain existing E2E test behavior when
--keep is not used
📦 Scope
Files to Fix
src/bin/e2e_tests_full.rs - Main E2E test binary
src/bin/e2e_provision_and_destroy_tests.rs - Provision/destroy E2E binary
- Any helper functions that handle infrastructure cleanup
✅ Acceptance Criteria
Functional Requirements
Testing Requirements
🔗 Related Issues
📚 Related Documentation
Full specification: See docs/issues/fix-e2e-infrastructure-preservation.md
Fix E2E Infrastructure Preservation
Type: Task
Priority: High
Parent Epic: #10 - UI Layer Destroy Command
Estimated Effort: 1-2 hours
📋 Issue Overview
Restore the
--keepflag functionality in E2E test binaries to preserve infrastructure for manual testing workflows. This is a prerequisite for testing the destroy CLI command implementation.🎯 Problem Statement
During E2E binary refactoring, the new
run_infrastructure_destroyfunction doesn't respect the--keepCLI argument. This breaks the ability to preserve test infrastructure for manual verification, which is essential for testing the destroy CLI command.Current Broken Workflow
Required Manual Testing Workflow
🎯 Goals
--keepflag functionality in both E2E test binariesrun_infrastructure_destroyfunction respects thekeepparameter--keepis not used📦 Scope
Files to Fix
src/bin/e2e_tests_full.rs- Main E2E test binarysrc/bin/e2e_provision_and_destroy_tests.rs- Provision/destroy E2E binary✅ Acceptance Criteria
Functional Requirements
--keepflag ine2e_tests_full.rspreserves infrastructure as intended--keepflag ine2e_provision_and_destroy_tests.rspreserves infrastructure as intendedrun_infrastructure_destroyfunction respects thekeepparameter correctly--keep→ infrastructure preserved (data/, build/, LXD VM)lxc list | grep e2e-provisionshows VM when preserved, nothing when destroyed--keepflag is not used (default behavior unchanged)Testing Requirements
Unit tests for CLI argument parsing with
--keepflagIntegration test verifying infrastructure preservation
E2E test verifying default destruction behavior (no
--keep)Manual testing verification:
🔗 Related Issues
📚 Related Documentation
Full specification: See
docs/issues/fix-e2e-infrastructure-preservation.md