Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ea55f4f
feat: [#217] add release and run CLI commands (no-op)
josecelano Dec 3, 2025
e97483a
refactor: [#217] rename e2e-config-tests to e2e-config-and-release-tests
josecelano Dec 3, 2025
0791846
feat: [#217] add release and run controllers (wired but empty)
josecelano Dec 3, 2025
2d766df
feat: [#217] add release and run command handlers in application layer
josecelano Dec 3, 2025
7c113c0
feat: [#217] add release and run steps in application layer
josecelano Dec 3, 2025
98aec5d
feat: [#217] complete application layer handlers for release and run …
josecelano Dec 3, 2025
fb529ec
feat: [#217] implement state transitions for release and run handlers
josecelano Dec 3, 2025
26528f9
test: [#217] add release and run commands to E2E test workflows
josecelano Dec 3, 2025
bc32270
feat: [#217] implement phase 6 - release step prepares docker compose…
josecelano Dec 4, 2025
8a0291a
docs: [#217] update phase 6 and 7 documentation with implementation s…
josecelano Dec 4, 2025
043560c
feat(release): [#217] Complete Phase 8 - Refactor release handler to …
josecelano Dec 4, 2025
ca4ee88
refactor(release): [#217] Validate instance IP as precondition for re…
josecelano Dec 4, 2025
92509c9
refactor(error-handling): [#217] Standardize EnvironmentNotFound erro…
josecelano Dec 4, 2025
419e35b
fix(clippy): [#217] Fix clippy linting errors
josecelano Dec 4, 2025
0ec82fd
refactor: [#217] Extract load and validate methods in command handlers
josecelano Dec 4, 2025
6ef21d2
refactor: [#217] Improve configure handler clarity
josecelano Dec 4, 2025
351e6fe
refactor: [#217] Add symmetric logging to release and provision handlers
josecelano Dec 4, 2025
1921015
feat: [#217] implement Phase 9 - StartServicesStep for run command
josecelano Dec 4, 2025
ed6f480
feat: [#217] wire RunCommandController to RunCommandHandler
josecelano Dec 4, 2025
1643b44
docs: [#217] document Phase 9 manual E2E test issues and resolution
josecelano Dec 4, 2025
862499c
feat: [#217] Enable Docker-in-Docker for E2E tests to test run command
josecelano Dec 4, 2025
30a1c3f
fix: [#217] Wrap std::env::set_var in unsafe block (Rust 1.81+)
josecelano Dec 4, 2025
5c14832
docs: [#217] Update Docker-in-Docker ADR with implementation details
josecelano Dec 4, 2025
3ede934
feat: [#217] Add separate E2E validation modules for release and run …
josecelano Dec 4, 2025
fd53b7f
refactor: [#217] Rename run_configuration_tests to run_configure_rele…
josecelano Dec 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lint = "run --bin linter all"
e2e-full = "run --bin e2e-tests-full"
e2e-provision = "run --bin e2e-provision-tests"
e2e-config = "run --bin e2e-config-tests"
e2e-config = "run --bin e2e-config-and-release-tests"
cov = "llvm-cov"
cov-check = "llvm-cov --all-features --workspace --fail-under-lines 70"
cov-lcov = "llvm-cov --lcov --output-path=./.coverage/lcov.info"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test-e2e-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
workflow_dispatch: # Allow manual triggering

jobs:
e2e-config-tests:
e2e-config-and-release-tests:
runs-on: ubuntu-latest
timeout-minutes: 45 # Timeout for complete configuration testing with software installation

Expand Down Expand Up @@ -62,16 +62,16 @@ jobs:
chmod 600 fixtures/testing_rsa
ls -la fixtures/testing_rsa

- name: Build E2E configuration tests binary
- name: Build E2E configuration and release tests binary
run: |
cargo build --bin e2e-config-tests --release
cargo build --bin e2e-config-and-release-tests --release

- name: Run E2E configuration test
- name: Run E2E configuration and release test
run: |
# Run the E2E configuration test with debug logging for better debugging
echo "🚀 Starting E2E configuration test at $(date)"
cargo run --bin e2e-config-tests
echo "✅ E2E configuration test completed at $(date)"
# Run the E2E configuration and release test with debug logging for better debugging
echo "🚀 Starting E2E configuration and release test at $(date)"
cargo run --bin e2e-config-and-release-tests
echo "✅ E2E configuration and release test completed at $(date)"
env:
# Preserve environment variables for the E2E test
RUST_LOG: debug
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ These principles should guide all development decisions, code reviews, and featu
- **E2E Tests**:
- `cargo run --bin e2e-tests-full` - Comprehensive tests (⚠️ **LOCAL ONLY** - cannot run on GitHub Actions due to network connectivity issues)
- `cargo run --bin e2e-provision-and-destroy-tests` - Infrastructure provisioning and destruction tests (GitHub runner-compatible)
- `cargo run --bin e2e-config-tests` - Software installation and configuration tests (GitHub runner-compatible)
- Pre-commit hook runs the split tests (`e2e-provision-and-destroy-tests` + `e2e-config-tests`) for GitHub Copilot compatibility
- `cargo run --bin e2e-config-and-release-tests` - Software installation, configuration, release, and run workflow tests (GitHub runner-compatible)
- Pre-commit hook runs the split tests (`e2e-provision-and-destroy-tests` + `e2e-config-and-release-tests`) for GitHub Copilot compatibility
- See [`docs/e2e-testing.md`](docs/e2e-testing.md) for detailed information about CI limitations

Follow the project conventions and ensure all checks pass.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ name = "e2e-tests-full"
path = "src/bin/e2e_tests_full.rs"

[[bin]]
name = "e2e-config-tests"
path = "src/bin/e2e_config_tests.rs"
name = "e2e-config-and-release-tests"
path = "src/bin/e2e_config_and_release_tests.rs"

[[bin]]
name = "e2e-provision-and-destroy-tests"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Use the E2E test binaries to run automated infrastructure tests with hardcoded e
cargo run --bin e2e-tests-full

# Run individual E2E test suites
cargo run --bin e2e-config-tests # Configuration generation and validation tests
cargo run --bin e2e-config-and-release-tests # Configuration, release, and run workflow tests
cargo run --bin e2e-provision-and-destroy-tests # Infrastructure provisioning tests

# Keep the test environment after completion for inspection
Expand Down
9 changes: 8 additions & 1 deletion docker/provisioned-instance/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@ RUN apt-get update && apt-get install -y \
lsb-release \
# APT transport for HTTPS repositories
apt-transport-https \
# iptables for Docker networking
iptables \
# Clean up package cache
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install Docker using official installation script
# This installs both Docker daemon and Docker Compose plugin
RUN curl -fsSL https://get.docker.com | sh \
&& rm -rf /var/lib/apt/lists/*

# Configure SSH server
RUN mkdir -p /var/run/sshd \
# Configure SSH for password authentication initially (tests will set up keys later)
Expand All @@ -45,7 +52,7 @@ RUN mkdir -p /var/run/sshd \
&& sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config

# Create torrust user matching LXD VM configuration
RUN useradd -m -s /bin/bash -G sudo torrust \
RUN useradd -m -s /bin/bash -G sudo,docker torrust \
# Set a simple password for initial SSH access (tests will set up keys later)
&& echo "torrust:torrust123" | chpasswd \
# Configure passwordless sudo
Expand Down
10 changes: 9 additions & 1 deletion docker/provisioned-instance/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@ logfile_maxbytes=50MB
logfile_backups=10
loglevel=info

[program:dockerd]
command=/usr/bin/dockerd --host=unix:///var/run/docker.sock --storage-driver=vfs
stdout_logfile=/var/log/supervisor/dockerd.log
stderr_logfile=/var/log/supervisor/dockerd.log
autorestart=true
startretries=3
priority=5

[program:sshd]
command=/usr/sbin/sshd -D
stdout_logfile=/var/log/supervisor/sshd.log
stderr_logfile=/var/log/supervisor/sshd.log
autorestart=true
startretries=3
priority=1
priority=10

[unix_http_server]
file=/var/run/supervisor.sock
Expand Down
4 changes: 3 additions & 1 deletion docker/ssh-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ RUN ssh-keygen -A
# Create test user for SSH authentication
RUN adduser -D -s /bin/sh testuser && \
echo 'testuser:testpass' | chpasswd && \
addgroup testuser wheel
addgroup testuser wheel && \
# Enable passwordless sudo for wheel group (required for deployment testing)
echo '%wheel ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

# Configure SSH daemon
RUN mkdir -p /run/sshd && \
Expand Down
2 changes: 1 addition & 1 deletion docs/codebase-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ Application initialization and lifecycle management:
**Binary Files:**

- ✅ `src/bin/linter.rs` - Code quality linting binary
- ✅ `src/bin/e2e-config-tests.rs` - E2E configuration tests
- ✅ `src/bin/e2e-config-and-release-tests.rs` - E2E configuration and release tests
- ✅ `src/bin/e2e-provision-and-destroy-tests.rs` - E2E provisioning and destruction tests
- ✅ `src/bin/e2e-tests-full.rs` - Full E2E test suite

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/commit-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ This script runs all mandatory checks:
3. **Run tests**: `cargo test`
4. **Test documentation builds**: `cargo doc --no-deps --bins --examples --workspace --all-features`
5. **Run E2E provision and destroy tests**: `cargo run --bin e2e-provision-and-destroy-tests`
6. **Run E2E configuration tests**: `cargo run --bin e2e-config-tests`
6. **Run E2E configuration and release tests**: `cargo run --bin e2e-config-and-release-tests`

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

Expand Down
4 changes: 2 additions & 2 deletions docs/contributing/copilot-agent/pre-commit-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ The pre-commit script will inform you about skipped tests and provide commands t
# Run E2E provision tests (~44s)
cargo run --bin e2e-provision-and-destroy-tests

# Run E2E config tests (~48s)
cargo run --bin e2e-config-tests
# Run E2E config and release tests (~48s)
cargo run --bin e2e-config-and-release-tests

# Check coverage manually (if needed)
cargo cov-check
Expand Down
12 changes: 6 additions & 6 deletions docs/contributing/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ tracing::debug!(
Run E2E tests to verify the playbook is copied correctly:

```bash
# Run E2E config tests (faster, tests configuration only)
cargo run --bin e2e-config-tests
# Run E2E config and release tests (faster, tests configuration only)
cargo run --bin e2e-config-and-release-tests

# Or run full E2E tests
cargo run --bin e2e-tests-full
Expand Down Expand Up @@ -284,8 +284,8 @@ When creating new Ansible playbooks that need dynamic variables (ports, paths, e

```yaml
# System Configuration
ssh_port: {{ ssh_port }}
my_service_port: {{ my_service_port }} # ← Add your new variable
ssh_port: { { ssh_port } }
my_service_port: { { my_service_port } } # ← Add your new variable
```

**Reference variables in static playbook using `vars_files`:**
Expand All @@ -296,8 +296,8 @@ my_service_port: {{ my_service_port }} # ← Add your new variable
- name: Configure My Service
hosts: all
vars_files:
- variables.yml # Load centralized variables
- variables.yml # Load centralized variables

tasks:
- name: Configure service port
ansible.builtin.lineinfile:
Expand Down
Loading
Loading