-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
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
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:
e2e-provision-and-destroy-tests- Infrastructure lifecycle testinge2e-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.mdto document the split E2E test execution - Task 2.2: Update
.github/copilot-instructions.mdif 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.shlocally 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.shcompletes 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: [EPIC] Refactor and Improve E2E Test Execution #112 - Refactor and Improve E2E Test Execution
- Depends On: Install Git Pre-Commit Hooks for Copilot Agent #121 - Install Git Pre-Commit Hooks for Copilot Agent
- Related: Configure GitHub Copilot Agent Environment #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
Copilot