Skip to content

test: e2e in QEMU with GitHub Actions#1

Merged
khuedoan merged 16 commits into
masterfrom
e2e
Jun 1, 2026
Merged

test: e2e in QEMU with GitHub Actions#1
khuedoan merged 16 commits into
masterfrom
e2e

Conversation

@khuedoan

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an end-to-end test harness that boots NixOS installs in QEMU/KVM via a Python driver, plumbs OpenTelemetry tracing through Nixie, and runs the harness in GitHub Actions. It also reworks SSH key handling (separate install/deployment keys), persists the post-install IP and machine-id hash to hosts.json, and splits the agent into its own Go package.

Changes:

  • New tests/e2e.py driver, nix run .#e2e runner, and test-e2e.yaml GitHub Actions workflow with OTEL collector + trace summary.
  • OpenTelemetry instrumentation across cmd/nixie, internal/{api,nixos,pxe} plus a new internal/telemetry package; protocol package extracted so the agent stops importing internal/api.
  • Replaced password-based SSH with --install-ssh-key / --deployment-ssh-key; persist ip and machine_id_hash (HMAC-SHA256) back into hosts.json; example flake/installer hardening and placeholder keys.

Reviewed changes

Copilot reviewed 23 out of 25 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/e2e.py New Python driver: bridge/tap setup, dnsmasq, OVMF QEMU VMs, install/cold-boot verification, trace summary.
.github/workflows/test-e2e.yaml New CI workflow running .#e2e under sudo with magic Nix cache.
flake.nix Splits builds into nixie and nixie-agent, adds apps.e2e runner with Python + qemu/dnsmasq deps.
Makefile / README.md Documents new SSH key flags and test-e2e target.
cmd/nixie/{main,flags}.go Adds telemetry startup, separate install/deployment SSH key flags, PXE error channel.
cmd/nixie-agent/{main,client}.go Switches to new internal/protocol package.
internal/api/api.go Tracing, install host workflow now reads machine ID and saves hosts.json; new SSH key fields.
internal/hosts/hosts.go (+test) Adds IP / machine_id_hash fields, MarshalJSON, SaveHostsConfig, HashMachineID.
internal/nixos/{anywhere,installer,machine_id}.go nixos-anywhere uses SSH key, new machine-id reader, tracing.
internal/pxe/pixiecore.go Wraps pixiecore Server with tracing and event recorder.
internal/protocol/protocol.go New shared InstallRequest type.
internal/telemetry/telemetry.go OTLP gRPC tracer setup keyed off env vars.
examples/{flake,installer,configuration}.nix Refactor + placeholder SSH keys, installer slimming.
go.mod / go.sum / gomod2nix.toml OpenTelemetry deps.
.gitignore Ignore __pycache__/ and /.cache/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/test-e2e.yaml
Comment thread .github/workflows/test-e2e.yaml Outdated
Comment thread cmd/nixie/main.go
Comment on lines +118 to +123
case err := <-pxeErrCh:
if err != nil {
telemetry.RecordError(runSpan, err)
log.Fatal("PXE server stopped unexpectedly", "error", err)
}
log.Fatal("PXE server stopped unexpectedly")
@khuedoan
khuedoan force-pushed the e2e branch 2 times, most recently from d91a663 to 577535d Compare May 30, 2026 04:43
@khuedoan
khuedoan merged commit aebd3a6 into master Jun 1, 2026
1 check passed
@khuedoan
khuedoan deleted the e2e branch June 1, 2026 06:17
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.

2 participants