Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: redeploying to interactive nixos tests #281332

Open
Radvendii opened this issue Jan 16, 2024 · 2 comments
Open

Feature Request: redeploying to interactive nixos tests #281332

Radvendii opened this issue Jan 16, 2024 · 2 comments
Assignees
Labels
0.kind: enhancement Add something new 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: testing Tooling for automated testing of packages and modules

Comments

@Radvendii
Copy link
Contributor

Radvendii commented Jan 16, 2024

Issue description

When developing NixOS tests, it is usually slow and tedious to re-run the test every time one makes a change. For this reason, I usually use driverInteractive, which allows me to muck around on the machines and see what happens in real time, re-run parts of tests that have failed, etc.

However, it often happens that I want to modify the NixOS configuration for one or more machines and redeploy. In this case I am back to re-running the driver every time I make a change.

I would like a way to modify the configuration and re-deploy, as I would with nixos-rebuild switch normally.

proposed solution

I developed a solution that I've been using privately #281331. It adds a command to the output of driverInteractive that can be used to push that configuration to the actively running test.

alternate solutions

we can just continue re-running the driver and restarting the machines every time we make a change to the configuration.

  1. this is slow and annoying

getting the configuration somehow into /etc/nixos/configuration.nix. This way people could modify the configuration on the machine and run nixos-rebuild switch.

  1. you have to generate a configuration.nix, and it's not clear which options to include and which not. It will end up in a different form than people are editing it in their test.
  2. the changes are ephemeral until you also make them on the test itself. which is easy to forget to do.

iterating on your tests in a separate environment (e.g. nixos-shell)

  1. requires copying changes over to the test, which is error-prone
  2. requires you to be familiar with two frameworks for spinning up nixos vms
  3. other systems for spinning up vms (such as nixos-rebuild) are often less convenient for spinning up several vms that all have access to each other
  4. the two systems for spinning up vms might have differences that affect the running of the tests.
@Radvendii
Copy link
Contributor Author

Radvendii commented Jan 16, 2024

See also https://github.com/fornybar/redpanda.nix, where we've been using my proposed solution

@Radvendii Radvendii self-assigned this Feb 22, 2024
@tomodachi94 tomodachi94 added 0.kind: enhancement Add something new 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: testing Tooling for automated testing of packages and modules labels May 13, 2024
@Radvendii
Copy link
Contributor Author

I've updated the PR to reflect a new solution. In retrospect I'm not sure it was useful to have a separate issue but here we are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement Add something new 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: testing Tooling for automated testing of packages and modules
Projects
None yet
Development

No branches or pull requests

4 participants