Commit f696347
committed
Merge #150: Split E2E tests in pre-commit script for GitHub Actions compatibility
05ee4b0 docs: [#146] update documentation for split E2E test execution (copilot-swe-agent[bot])
af2846e chore: [#146] replace e2e-tests-full with split tests in pre-commit script (copilot-swe-agent[bot])
17bbe8d Initial plan (copilot-swe-agent[bot])
Pull request description:
GitHub Copilot agents run in GitHub Actions environments where LXD VM networking is broken ([actions/runner-images#13003](actions/runner-images#13003)). The pre-commit script's `e2e-tests-full` cannot run there, blocking automated commits.
## Changes
**`scripts/pre-commit.sh`**
- Split single E2E test step into two GitHub runner-compatible steps:
- `e2e-provision-and-destroy-tests` - LXD VM lifecycle (no nested networking)
- `e2e-config-tests` - Docker-based configuration tests
- Maintains identical coverage, now 7 steps instead of 6
**`docs/contributing/commit-process.md`**
- Updated checklist to reflect split execution
- Added section explaining split strategy and when to use `e2e-tests-full` locally
**`.github/copilot-instructions.md`**
- Fixed binary name typo (`e2e-provision-tests` → `e2e-provision-and-destroy-tests`)
- Clarified pre-commit hook behavior
```bash
# Before (fails in GitHub Actions)
"Running comprehensive E2E tests|...|RUST_LOG=warn|cargo run --bin e2e-tests-full"
# After (GitHub Actions compatible)
"Running E2E provision and destroy tests|...|RUST_LOG=warn|cargo run --bin e2e-provision-and-destroy-tests"
"Running E2E configuration tests|...|RUST_LOG=warn|cargo run --bin e2e-config-tests"
```
Developers can still run `cargo run --bin e2e-tests-full` manually for single-command local testing.
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Update Pre-Commit Script for GitHub Runner-Compatible E2E Tests</issue_title>
> <issue_description>## Overview
>
> Update the pre-commit verification script (`scripts/pre-commit.sh`) to run GitHub runner-compatible E2E tests instead of the full E2E test suite. This enables GitHub Copilot agents to successfully execute pre-commit checks in GitHub Actions environments where LXD VM network connectivity is limited.
>
> ## Specification
>
> See detailed specification: [docs/issues/update-precommit-script-for-github-runner-compatible-e2e-tests.md](https://github.com/torrust/torrust-tracker-deployer/blob/main/docs/issues/update-precommit-script-for-github-runner-compatible-e2e-tests.md)
>
> ## Problem Statement
>
> The pre-commit script currently runs `e2e-tests-full` which:
> - Requires LXD VMs with full network connectivity
> - Cannot run on GitHub Actions runners due to known networking limitations with nested virtualization
> - Prevents GitHub Copilot agents from executing pre-commit checks
>
> ## Solution
>
> Replace the single `e2e-tests-full` step with two GitHub runner-compatible tests:
> 1. `e2e-provision-and-destroy-tests` - Infrastructure lifecycle testing
> 2. `e2e-config-tests` - Software installation and configuration testing
>
> ## Implementation Plan
>
> ### Phase 1: Update Pre-Commit Script (30 minutes)
>
> - [ ] Task 1.1: Replace the E2E full test step with provision and destroy test step
> - [ ] Task 1.2: Add the configuration test step after provision and destroy test step
> - [ ] Task 1.3: Verify step numbering and total step count are correct
> - [ ] Task 1.4: Test the script locally to ensure both tests run successfully
>
> ### Phase 2: Documentation Updates (15 minutes)
>
> - [ ] Task 2.1: Update `docs/contributing/commit-process.md` to document the split E2E test execution
> - [ ] Task 2.2: Update `.github/copilot-instructions.md` if needed
> - [ ] Task 2.3: Ensure documentation clarifies when to use E2E full tests vs split tests
>
> ### Phase 3: Validation (15 minutes)
>
> - [ ] Task 3.1: Run `./scripts/pre-commit.sh` locally to verify both E2E tests execute
> - [ ] Task 3.2: Verify pre-commit script passes when both E2E tests succeed
> - [ ] Task 3.3: Verify pre-commit script fails when either E2E test fails
> - [ ] Task 3.4: Run shellcheck on the modified script
>
> ## Acceptance Criteria
>
> **Quality Checks**:
>
> - [ ] Pre-commit checks pass: `./scripts/pre-commit.sh`
> - [ ] Shellcheck passes for `scripts/pre-commit.sh`
>
> **Task-Specific Criteria**:
>
> - [ ] Pre-commit script runs provision and destroy E2E tests
> - [ ] Pre-commit script runs configuration E2E tests
> - [ ] Both E2E test steps execute in sequence
> - [ ] Script succeeds when both tests pass
> - [ ] Script fails appropriately when either test fails
> - [ ] Step numbering and count are correct
> - [ ] Timing notes accurately describe each test's duration expectations
> - [ ] Documentation reflects the split E2E test approach
>
> **Testing Criteria**:
>
> - [ ] Verify locally: `./scripts/pre-commit.sh` completes successfully
> - [ ] Verify provision test step runs: Check for "Running E2E provision and destroy tests" message
> - [ ] Verify config test step runs: Check for "Running E2E configuration tests" message
> - [ ] Both test steps show success messages with timing
>
> ## Related
>
> - **Parent Epic**: #112 - Refactor and Improve E2E Test Execution
> - **Depends On**: #121 - Install Git Pre-Commit Hooks for Copilot Agent
> - **Related**: #120 - Configure GitHub Copilot Agent Environment
>
> ## Time Estimate
>
> **Total**: 1-1.5 hours
>
> - Script modification: 30 minutes
> - Documentation updates: 15 minutes
> - Testing and validation: 15 minutes
> - Buffer for edge cases: 15 minutes</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> <comment_new><author>@josecelano</author><body>
> ## Specification
>
> Full specification document: [docs/issues/146-1-6-update-precommit-script-for-github-runner-compatible-e2e-tests.md](https://github.com/torrust/torrust-tracker-deployer/blob/main/docs/issues/146-1-6-update-precommit-script-for-github-runner-compatible-e2e-tests.md)</body></comment_new>
> </comments>
>
</details>
- Fixes #146
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.
ACKs for top commit:
josecelano:
ACK 05ee4b0
Tree-SHA512: 6b92a41f9c39ee755f09f527a9ba0172158c4e8d2d1868098c5a65fb878e662a4b32f20bdb645150ce6666b10c366f4ae69dcf32ea66ca852e66aaaadc0f5bc0File tree
3 files changed
+25
-4
lines changed- .github
- docs/contributing
- scripts
3 files changed
+25
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
141 | 160 | | |
142 | 161 | | |
143 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
0 commit comments