Skip to content

test: add eval, smoke, VM and formatting checks - #94

Open
DavSanchez wants to merge 1 commit into
feat/packages-modulesfrom
test/infrastructure
Open

DavSanchez wants to merge 1 commit into
feat/packages-modulesfrom
test/infrastructure

Conversation

@DavSanchez

@DavSanchez DavSanchez commented Aug 18, 2026 •

Copy link
Copy Markdown
Owner

Adds the testing infrastructure so pending and future changes are verifiable.

  • Eval tests (nixpkgs.lib.runTests): assert module options, generated logging.d/integrations.d configs, the Unable to list kernel modules. err: fork/exec /sbin/lsmod: no such file or directory oupu #88 /sbin bind fix, and package wiring with/without the overlay.
  • Package smoke tests (pkgs.testers.runCommand): nrdot-collector --version + config validation, nri-flex -h, plugin .so presence.
  • NixOS VM tests (pkgs.testers.runNixOSTest): boot VMs with newrelic-infra and nrdot-collector, verify services come up, the Unable to list kernel modules. err: fork/exec /sbin/lsmod: no such file or directory oupu #88 mount-namespace fix (via nsenter), and the collector healthz endpoint.
  • VM tests run on any host nixpkgs supports: Linux via KVM, and aarch64-darwin via HVF (the framework's node.pkgs = pkgsLinux machinery). The tests inject the flake's Linux package builds into the guests (pkgs.pkgsLinux).
  • Darwin workaround: nixpkgs' qemu-common.nix pins gic-version=2 for aarch64-darwin, but qemu's HVF only supports GICv3 on Apple Silicon (guests never boot). The tests override the machine type on darwin hosts.
  • Formatting check ensuring all .nix files are nixfmt-clean.
  • CI: ubuntu runs all checks including the VM tests (advertising kvm/nixos-test); macOS runs the non-VM checks, since GitHub's macOS runners cannot build Linux guests.

This is PR 4 of 4 in a stacked series (base: #93). Do not merge out of order.

- Add unit/eval tests covering the module options and generated configs,
  including the #88 FHS /sbin regression.
- Add package smoke tests (version, config validation, binary presence).
- Add NixOS VM integration tests for newrelic-infra and nrdot-collector.
  These run on any host nixpkgs supports: Linux (KVM) and aarch64-darwin
  (HVF, with a GICv3 override for a qemu-common.nix bug on Apple Silicon).
- Add a formatting check and wire all checks into 'nix flake check'.
- CI: run VM tests on ubuntu; macOS runs the non-VM checks since GitHub's
  macOS runners cannot build Linux guests.
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.

1 participant