Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ These principles should guide all development decisions, code reviews, and featu
- **Unit Tests**: When writing unit tests, follow conventions described in [`docs/contributing/testing/`](../docs/contributing/testing/)
- **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-tests` - Infrastructure provisioning tests
- `cargo run --bin e2e-config-tests` - Configuration validation tests
- `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
- See [`docs/e2e-testing.md`](../docs/e2e-testing.md) for detailed information about CI limitations

Follow the project conventions and ensure all checks pass.
21 changes: 20 additions & 1 deletion docs/contributing/commit-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,29 @@ This script runs all mandatory checks:
2. **Run all linters**: `cargo run --bin linter all` (stable & nightly toolchains)
3. **Run tests**: `cargo test`
4. **Test documentation builds**: `cargo doc --no-deps --bins --examples --workspace --all-features`
5. **Run E2E tests**: `cargo run --bin e2e-tests-full`
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`
7. **Run code coverage check**: `cargo cov-check` (informational only)

**All checks must pass** before committing. Fix any reported issues.

### E2E Test Execution Strategy

The pre-commit script runs E2E tests as **two separate commands** instead of a single comprehensive test:

- **Provision and Destroy Tests**: Test infrastructure lifecycle (LXD VMs)
- **Configuration Tests**: Test software installation and configuration (Docker containers)

This split approach provides the same comprehensive coverage while being compatible with GitHub Actions runners. The split is necessary because GitHub Actions has networking limitations with nested LXD VMs that prevent the full E2E test suite from running.

**For local development**, you can still run the full E2E test suite manually for convenience:

```bash
cargo run --bin e2e-tests-full
```

This provides the same coverage in a single run but is only supported in local environments with proper LXD networking.

### Running Individual Linters

If you need to run specific linters for debugging:
Expand Down
3 changes: 2 additions & 1 deletion scripts/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ declare -a STEPS=(
"Running linters|All linters passed|||cargo run --bin linter all"
"Running tests|All tests passed|||cargo test"
"Testing cargo documentation|Documentation builds successfully|||cargo doc --no-deps --bins --examples --workspace --all-features"
"Running comprehensive E2E tests|All E2E tests passed|(Filtering logs to WARNING level and above - this may take a few minutes)|RUST_LOG=warn|cargo run --bin e2e-tests-full"
"Running E2E provision and destroy tests|Provision and destroy tests passed|(Testing infrastructure lifecycle - this may take a few minutes)|RUST_LOG=warn|cargo run --bin e2e-provision-and-destroy-tests"
"Running E2E configuration tests|Configuration tests passed|(Testing software installation and configuration)|RUST_LOG=warn|cargo run --bin e2e-config-tests"
"Running code coverage check|Coverage meets 75% threshold|(Informational only - does not block commits)||cargo cov-check"
)

Expand Down