Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 5, 2025

GitHub Copilot agents run in GitHub Actions environments where LXD VM networking is broken (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-testse2e-provision-and-destroy-tests)
  • Clarified pre-commit hook behavior
# 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.

Original prompt

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

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

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)

@josecelano ## Specification

Full specification document: docs/issues/146-1-6-update-precommit-script-for-github-runner-compatible-e2e-tests.md</comment_new>


💡 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 in the docs.

Copilot AI and others added 2 commits November 5, 2025 22:10
…cript

Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
Copilot AI changed the title [WIP] Update pre-commit script for GitHub runner-compatible E2E tests Split E2E tests in pre-commit script for GitHub Actions compatibility Nov 5, 2025
Copilot AI requested a review from josecelano November 5, 2025 22:18
Copilot finished work on behalf of josecelano November 5, 2025 22:18
@josecelano josecelano marked this pull request as ready for review November 6, 2025 07:18
Copy link
Member

@josecelano josecelano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 05ee4b0

@josecelano josecelano merged commit f696347 into main Nov 6, 2025
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Pre-Commit Script for GitHub Runner-Compatible E2E Tests

2 participants