Skip to content

Commit 1e957ba

Browse files
committed
refactor: [#220] rename E2E test binaries to better reflect their purpose
BREAKING CHANGE: E2E test binary names have changed Old naming (what they did): - e2e-provision-and-destroy-tests - Infrastructure provisioning lifecycle - e2e-config-and-release-tests - Software deployment workflow - e2e-tests-full - Complete end-to-end workflow New naming (what they test): - e2e-infrastructure-lifecycle-tests - Infrastructure provisioning lifecycle - e2e-deployment-workflow-tests - Software deployment workflow - e2e-complete-workflow-tests - Complete end-to-end workflow Changes applied: - Renamed binary source files in src/bin/ - Updated Cargo.toml binary definitions - Renamed GitHub Actions workflow files - Updated all binary names in workflows - Changed ENVIRONMENT_NAME constants (e2e-provision -> e2e-infrastructure, e2e-config -> e2e-deployment, e2e-full -> e2e-complete) - Updated all test_suite logging references - Updated log directory paths - Updated container/VM names in workflows - Updated all documentation (README.md, AGENTS.md, docs/e2e-testing.md, etc.) - Updated pre-commit.sh script with new binary names - Updated clap command names and help text Benefits: - Clearer naming that describes test scope rather than implementation - Consistent with workflow-based terminology - Better developer experience understanding test purposes - Aligns with industry standards for test naming conventions
1 parent 13cca4c commit 1e957ba

14 files changed

+124
-126
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: E2E Configuration Tests
2+
name: E2E Deployment Workflow Tests
33

44
# This workflow tests ONLY software configuration, release, and run phases
55
# using Docker containers. It does NOT test infrastructure provisioning
@@ -22,7 +22,7 @@ on:
2222
workflow_dispatch: # Allow manual triggering
2323

2424
jobs:
25-
e2e-config-and-release-tests:
25+
e2e-deployment-workflow-tests:
2626
runs-on: ubuntu-latest
2727
timeout-minutes: 45 # Timeout for complete configuration testing with software installation
2828

@@ -62,16 +62,16 @@ jobs:
6262
chmod 600 fixtures/testing_rsa
6363
ls -la fixtures/testing_rsa
6464
65-
- name: Build E2E configuration and release tests binary
65+
- name: Build E2E deployment workflow tests binary
6666
run: |
67-
cargo build --bin e2e-config-and-release-tests --release
67+
cargo build --bin e2e-deployment-workflow-tests --release
6868
69-
- name: Run E2E configuration and release test
69+
- name: Run E2E deployment workflow test
7070
run: |
71-
# Run the E2E configuration and release test with debug logging for better debugging
72-
echo "🚀 Starting E2E configuration and release test at $(date)"
73-
cargo run --bin e2e-config-and-release-tests
74-
echo "✅ E2E configuration and release test completed at $(date)"
71+
# Run the E2E deployment workflow test with debug logging for better debugging
72+
echo "🚀 Starting E2E deployment workflow test at $(date)"
73+
cargo run --bin e2e-deployment-workflow-tests
74+
echo "✅ E2E deployment workflow test completed at $(date)"
7575
env:
7676
# Preserve environment variables for the E2E test
7777
RUST_LOG: debug
@@ -113,8 +113,8 @@ jobs:
113113
# properly (e.g., if the test was abruptly halted). Under normal circumstances,
114114
# the testcontainers crate should automatically clean up containers when tests finish.
115115
116-
# Clean up the specific container created for e2e-config tests
117-
docker rm -f torrust-tracker-vm-e2e-config 2>/dev/null || echo "Container torrust-tracker-vm-e2e-config not found or already removed"
116+
# Clean up the specific container created for e2e-deployment tests
117+
docker rm -f torrust-tracker-vm-e2e-deployment 2>/dev/null || echo "Container torrust-tracker-vm-e2e-deployment not found or already removed"
118118
119119
# Clean up any test images if needed
120120
docker images --filter "reference=torrust-provisioned-instance*" -q | xargs -r docker rmi -f || echo "No test images to remove"
@@ -126,9 +126,9 @@ jobs:
126126
docker ps -a
127127
128128
echo "=== Test Summary ==="
129-
echo "E2E configuration test workflow completed"
129+
echo "E2E deployment workflow test completed"
130130
if [ "${{ job.status }}" = "success" ]; then
131-
echo "✅ All configuration tests passed successfully"
131+
echo "✅ All deployment workflow tests passed successfully"
132132
else
133-
echo "❌ Some configuration tests failed - check logs above"
133+
echo "❌ Some deployment workflow tests failed - check logs above"
134134
fi

.github/workflows/test-e2e-provision.yml renamed to .github/workflows/test-e2e-infrastructure.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: E2E Provision and Destroy Tests
1+
name: E2E Infrastructure Lifecycle Tests
22

33
# This workflow tests infrastructure provisioning and destruction (creating and destroying VMs/containers)
44
# It does NOT test software configuration/installation to avoid GitHub Actions
@@ -18,7 +18,7 @@ on:
1818
workflow_dispatch: # Allow manual triggering
1919

2020
jobs:
21-
e2e-provision-tests:
21+
e2e-infrastructure-lifecycle-tests:
2222
runs-on: ubuntu-latest
2323
timeout-minutes: 30 # Reduced timeout since we're not installing software
2424

@@ -48,17 +48,17 @@ jobs:
4848
tofu version
4949
cargo --version
5050
51-
- name: Build E2E provision and destroy tests binary
51+
- name: Build E2E infrastructure lifecycle tests binary
5252
run: |
53-
cargo build --bin e2e-provision-and-destroy-tests --release
53+
cargo build --bin e2e-infrastructure-lifecycle-tests --release
5454
55-
- name: Run E2E provision and destroy test
55+
- name: Run E2E infrastructure lifecycle test
5656
run: |
57-
# Run the E2E provision and destroy test with debug logging for better debugging
57+
# Run the E2E infrastructure lifecycle test with debug logging for better debugging
5858
# Use sudo -E and preserve PATH to ensure cargo is accessible
59-
echo "🚀 Starting E2E provision and destroy test at $(date)"
60-
sudo -E env "PATH=$PATH" cargo run --bin e2e-provision-and-destroy-tests
61-
echo "✅ E2E provision and destroy test completed at $(date)"
59+
echo "🚀 Starting E2E infrastructure lifecycle test at $(date)"
60+
sudo -E env "PATH=$PATH" cargo run --bin e2e-infrastructure-lifecycle-tests
61+
echo "✅ E2E infrastructure lifecycle test completed at $(date)"
6262
env:
6363
# Preserve environment variables for the E2E test
6464
RUST_LOG: debug
@@ -68,18 +68,18 @@ jobs:
6868
run: |
6969
echo "=== Infrastructure Outputs ==="
7070
# Only check outputs if build directory still exists (it may be cleaned up by DestroyCommand)
71-
if [ -d "build/e2e-provision/tofu/lxd" ]; then
72-
cd build/e2e-provision/tofu/lxd
71+
if [ -d "build/e2e-infrastructure/tofu/lxd" ]; then
72+
cd build/e2e-infrastructure/tofu/lxd
7373
sudo -E tofu output || echo "No outputs available"
7474
else
7575
echo "Build directory not found (likely cleaned up by DestroyCommand)"
7676
fi
7777
7878
echo "=== Container Status ==="
79-
sudo lxc list torrust-tracker-vm-e2e-provision || echo "Container not found"
79+
sudo lxc list torrust-tracker-vm-e2e-infrastructure || echo "Container not found"
8080
8181
# Check if the container has an IP address before proceeding
82-
sudo lxc info torrust-tracker-vm-e2e-provision || echo "Container info not available"
82+
sudo lxc info torrust-tracker-vm-e2e-infrastructure || echo "Container info not available"
8383
8484
- name: Debug information (on failure)
8585
if: failure()
@@ -88,8 +88,8 @@ jobs:
8888
sudo lxc list || echo "LXC list failed"
8989
9090
echo "=== OpenTofu State ==="
91-
if [ -d "build/e2e-provision/tofu/lxd" ]; then
92-
cd build/e2e-provision/tofu/lxd
91+
if [ -d "build/e2e-infrastructure/tofu/lxd" ]; then
92+
cd build/e2e-infrastructure/tofu/lxd
9393
sudo -E tofu show || echo "No state to show"
9494
else
9595
echo "No OpenTofu state directory found"
@@ -108,18 +108,18 @@ jobs:
108108
echo "Test failed - attempting emergency cleanup..."
109109
110110
# Try OpenTofu cleanup only if build directory still exists
111-
if [ -d "build/e2e-provision/tofu/lxd" ]; then
111+
if [ -d "build/e2e-infrastructure/tofu/lxd" ]; then
112112
echo "Found OpenTofu state directory, attempting tofu destroy..."
113-
cd build/e2e-provision/tofu/lxd
113+
cd build/e2e-infrastructure/tofu/lxd
114114
sudo -E tofu destroy -auto-approve || echo "Tofu destroy failed or nothing to destroy"
115115
else
116116
echo "No OpenTofu state directory found (likely cleaned up by DestroyCommand)"
117117
fi
118118
119119
# Always attempt LXD cleanup (no working directory dependency)
120120
echo "Attempting LXD resource cleanup..."
121-
sudo lxc delete torrust-tracker-vm-e2e-provision --force || echo "Container deletion failed or container doesn't exist"
122-
sudo lxc profile delete torrust-profile-e2e-provision || echo "Profile deletion failed or profile doesn't exist"
121+
sudo lxc delete torrust-tracker-vm-e2e-infrastructure --force || echo "Container deletion failed or container doesn't exist"
122+
sudo lxc profile delete torrust-profile-e2e-infrastructure || echo "Profile deletion failed or profile doesn't exist"
123123
124124
- name: Final verification
125125
if: always()
@@ -128,9 +128,9 @@ jobs:
128128
sudo lxc list
129129
130130
echo "=== Test Summary ==="
131-
echo "E2E provision and destroy test workflow completed"
131+
echo "E2E infrastructure lifecycle test workflow completed"
132132
if [ "${{ job.status }}" = "success" ]; then
133-
echo "✅ All provision and destroy tests passed successfully"
133+
echo "✅ All infrastructure lifecycle tests passed successfully"
134134
else
135-
echo "❌ Some provision and destroy tests failed - check logs above"
135+
echo "❌ Some infrastructure lifecycle tests failed - check logs above"
136136
fi

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ These principles should guide all development decisions, code reviews, and featu
130130
- **Test**: `cargo test`
131131
- **Unit Tests**: When writing unit tests, follow conventions described in [`docs/contributing/testing/`](docs/contributing/testing/)
132132
- **E2E Tests**:
133-
- `cargo run --bin e2e-tests-full` - Comprehensive tests (⚠️ **LOCAL ONLY** - cannot run on GitHub Actions due to network connectivity issues)
134-
- `cargo run --bin e2e-provision-and-destroy-tests` - Infrastructure provisioning and destruction tests (GitHub runner-compatible)
135-
- `cargo run --bin e2e-config-and-release-tests` - Software installation, configuration, release, and run workflow tests (GitHub runner-compatible)
136-
- Pre-commit hook runs the split tests (`e2e-provision-and-destroy-tests` + `e2e-config-and-release-tests`) for GitHub Copilot compatibility
133+
- `cargo run --bin e2e-complete-workflow-tests` - Comprehensive tests (⚠️ **LOCAL ONLY** - cannot run on GitHub Actions due to network connectivity issues)
134+
- `cargo run --bin e2e-infrastructure-lifecycle-tests` - Infrastructure provisioning and destruction tests (GitHub runner-compatible)
135+
- `cargo run --bin e2e-deployment-workflow-tests` - Software installation, configuration, release, and run workflow tests (GitHub runner-compatible)
136+
- Pre-commit hook runs the split tests (`e2e-infrastructure-lifecycle-tests` + `e2e-deployment-workflow-tests`) for GitHub Copilot compatibility
137137
- See [`docs/e2e-testing.md`](docs/e2e-testing.md) for detailed information about CI limitations
138138

139139
Follow the project conventions and ensure all checks pass.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ name = "torrust-tracker-deployer"
2121
path = "src/main.rs"
2222

2323
[[bin]]
24-
name = "e2e-tests-full"
25-
path = "src/bin/e2e_tests_full.rs"
24+
name = "e2e-complete-workflow-tests"
25+
path = "src/bin/e2e_complete_workflow_tests.rs"
2626

2727
[[bin]]
28-
name = "e2e-config-and-release-tests"
29-
path = "src/bin/e2e_config_and_release_tests.rs"
28+
name = "e2e-deployment-workflow-tests"
29+
path = "src/bin/e2e_deployment_workflow_tests.rs"
3030

3131
[[bin]]
32-
name = "e2e-provision-and-destroy-tests"
33-
path = "src/bin/e2e_provision_and_destroy_tests.rs"
32+
name = "e2e-infrastructure-lifecycle-tests"
33+
path = "src/bin/e2e_infrastructure_lifecycle_tests.rs"
3434

3535
[[bin]]
3636
name = "linter"

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,18 @@ Use the E2E test binaries to run automated infrastructure tests with hardcoded e
164164

165165
```bash
166166
# Run comprehensive E2E tests (LOCAL ONLY - connectivity issues in GitHub runners)
167-
cargo run --bin e2e-tests-full
167+
cargo run --bin e2e-complete-workflow-tests
168168

169169
# Run individual E2E test suites
170-
cargo run --bin e2e-config-and-release-tests # Configuration, release, and run workflow tests
171-
cargo run --bin e2e-provision-and-destroy-tests # Infrastructure provisioning tests
170+
cargo run --bin e2e-deployment-workflow-tests # Configuration, release, and run workflow tests
171+
cargo run --bin e2e-infrastructure-lifecycle-tests # Infrastructure provisioning tests
172172

173173
# Keep the test environment after completion for inspection
174-
cargo run --bin e2e-tests-full -- --keep
175-
cargo run --bin e2e-provision-and-destroy-tests -- --keep
174+
cargo run --bin e2e-complete-workflow-tests -- --keep
175+
cargo run --bin e2e-infrastructure-lifecycle-tests -- --keep
176176

177177
# Use custom templates directory
178-
cargo run --bin e2e-tests-full -- --templates-dir ./custom/templates
178+
cargo run --bin e2e-complete-workflow-tests -- --templates-dir ./custom/templates
179179

180180
# See all available options
181181
cargo run --bin e2e-tests-full -- --help

docs/codebase-architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ Application initialization and lifecycle management:
209209
**Binary Files:**
210210

211211
-`src/bin/linter.rs` - Code quality linting binary
212-
-`src/bin/e2e-config-and-release-tests.rs` - E2E configuration and release tests
213-
-`src/bin/e2e-provision-and-destroy-tests.rs` - E2E provisioning and destruction tests
214-
-`src/bin/e2e-tests-full.rs` - Full E2E test suite
212+
-`src/bin/e2e-deployment-workflow-tests.rs` - E2E deployment workflow tests
213+
-`src/bin/e2e-infrastructure-lifecycle-tests.rs` - E2E infrastructure lifecycle tests
214+
-`src/bin/e2e-complete-workflow-tests.rs` - Complete E2E workflow test suite
215215

216216
### Presentation Layer
217217

docs/contributing/commit-process.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ This script runs all mandatory checks:
134134
2. **Run all linters**: `cargo run --bin linter all` (stable & nightly toolchains)
135135
3. **Run tests**: `cargo test`
136136
4. **Test documentation builds**: `cargo doc --no-deps --bins --examples --workspace --all-features`
137-
5. **Run E2E provision and destroy tests**: `cargo run --bin e2e-provision-and-destroy-tests`
138-
6. **Run E2E configuration and release tests**: `cargo run --bin e2e-config-and-release-tests`
137+
5. **Run E2E infrastructure lifecycle tests**: `cargo run --bin e2e-infrastructure-lifecycle-tests`
138+
6. **Run E2E deployment workflow tests**: `cargo run --bin e2e-deployment-workflow-tests`
139139

140140
**Note**: Code coverage is checked automatically in CI via GitHub Actions, not in the pre-commit script, to keep local commits fast and efficient.
141141

docs/contributing/templates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Run E2E tests to verify the playbook is copied correctly:
206206

207207
```bash
208208
# Run E2E config and release tests (faster, tests configuration only)
209-
cargo run --bin e2e-config-and-release-tests
209+
cargo run --bin e2e-deployment-workflow-tests
210210
211211
# Or run full E2E tests
212212
cargo run --bin e2e-tests-full

docs/contributing/testing/testing-commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ Commands should be integrated into E2E test suites:
176176

177177
### Provision and Destroy E2E Tests
178178

179-
The `e2e-provision-and-destroy-tests` binary tests the complete infrastructure lifecycle:
179+
The `e2e-infrastructure-lifecycle-tests` binary tests the complete infrastructure lifecycle:
180180

181181
```rust
182-
// From src/bin/e2e_provision_and_destroy_tests.rs
182+
// From src/bin/e2e_infrastructure_lifecycle_tests.rs
183183

184184
// Provision infrastructure
185185
let provisioned_env = run_provision_command(&context).await?;

docs/e2e-testing.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,40 @@ This guide explains how to run and understand the End-to-End (E2E) tests for the
66

77
The E2E tests validate the complete deployment process using two independent test suites:
88

9-
1. **E2E Provision and Destroy Tests** - Test infrastructure provisioning and destruction lifecycle using LXD VMs
10-
2. **E2E Configuration Tests** - Test software installation and configuration using Docker containers
9+
1. **E2E Infrastructure Lifecycle Tests** - Test infrastructure provisioning and destruction lifecycle using LXD VMs
10+
2. **E2E Deployment Workflow Tests** - Test software installation and configuration using Docker containers
1111

1212
This split approach ensures reliable testing in CI environments while maintaining comprehensive coverage.
1313

1414
## 🚀 Running E2E Tests
1515

1616
### Independent Test Suites
1717

18-
#### Provision and Destroy Tests
18+
#### Infrastructure Lifecycle Tests
1919

2020
Test infrastructure provisioning and destruction lifecycle (VM creation, cloud-init, and destruction):
2121

2222
```bash
23-
cargo run --bin e2e-provision-and-destroy-tests
23+
cargo run --bin e2e-infrastructure-lifecycle-tests
2424
```
2525

26-
#### Configuration Tests
26+
#### Deployment Workflow Tests
2727

2828
Test software installation, configuration, release, and run workflows (Ansible playbooks):
2929

3030
```bash
31-
cargo run --bin e2e-config-and-release-tests
31+
cargo run --bin e2e-deployment-workflow-tests
3232
```
3333

3434
#### Full Local Testing
3535

3636
For local development, you can run the complete end-to-end test:
3737

3838
```bash
39-
cargo run --bin e2e-tests-full
39+
cargo run --bin e2e-complete-workflow-tests
4040
```
4141

42-
⚠️ **Note**: The `e2e-tests-full` binary cannot run on GitHub Actions due to network connectivity issues, but is useful for local validation.
42+
⚠️ **Note**: The `e2e-complete-workflow-tests` binary cannot run on GitHub Actions due to network connectivity issues, but is useful for local validation.
4343

4444
### Command Line Options
4545

@@ -52,22 +52,22 @@ All test binaries support these options:
5252
### Examples
5353

5454
```bash
55-
# Run provision and destroy tests
56-
cargo run --bin e2e-provision-and-destroy-tests
55+
# Run infrastructure lifecycle tests
56+
cargo run --bin e2e-infrastructure-lifecycle-tests
5757

58-
# Run provision and destroy tests with debugging (keep environment)
59-
cargo run --bin e2e-provision-and-destroy-tests -- --keep
58+
# Run infrastructure lifecycle tests with debugging (keep environment)
59+
cargo run --bin e2e-infrastructure-lifecycle-tests -- --keep
6060

61-
# Run configuration tests with debugging
62-
cargo run --bin e2e-config-and-release-tests -- --keep
61+
# Run deployment workflow tests with debugging
62+
cargo run --bin e2e-deployment-workflow-tests -- --keep
6363

6464
# Run full local tests with custom templates
65-
cargo run --bin e2e-tests-full -- --templates-dir ./custom/templates
65+
cargo run --bin e2e-complete-workflow-tests -- --templates-dir ./custom/templates
6666
```
6767

6868
## 📋 Test Sequences
6969

70-
### E2E Provision and Destroy Tests (`e2e-provision-and-destroy-tests`)
70+
### E2E Infrastructure Lifecycle Tests (`e2e-infrastructure-lifecycle-tests`)
7171

7272
Tests the complete infrastructure lifecycle using LXD VMs:
7373

@@ -147,7 +147,7 @@ For detailed destroy command documentation, see:
147147
- [Destroy Command User Guide](user-guide/commands/destroy.md)
148148
- [Destroy Command Developer Guide](contributing/commands.md#destroycommand)
149149

150-
### E2E Configuration and Release Tests (`e2e-config-and-release-tests`)
150+
### E2E Deployment Workflow Tests (`e2e-deployment-workflow-tests`)
151151

152152
Tests software installation and configuration using Docker containers:
153153

@@ -174,7 +174,7 @@ Tests software installation and configuration using Docker containers:
174174
- ✅ Docker Compose version command works
175175
- ✅ Can parse and validate a test docker-compose.yml file
176176

177-
### Full Local Tests (`e2e-tests-full`)
177+
### E2E Complete Workflow Tests (`e2e-complete-workflow-tests`)
178178

179179
Combines both provision and configuration phases in a single LXD VM for comprehensive local testing.
180180

0 commit comments

Comments
 (0)