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

nixos/test-driver: allow easier sharing between expression and driver script #156563

Open
Synthetica9 opened this issue Jan 24, 2022 · 0 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: testing Tooling for automated testing of packages and modules

Comments

@Synthetica9
Copy link
Member

Synthetica9 commented Jan 24, 2022

Currently, we use a lot of string interpolation to get information from the nix expression defining the test to the script running the driver. It would be nice to have a more principled way of doing this. My thought is to have a field in the driver that is written by Nix, converted to JSON, and then read by the driver script.

A minimal example of how this would work:

import ./make-test-python.nix ({ ... } : {
  machine = { ... }: { };

  shared = {
    foo = 3;
  };

  testScript =
    ''
      assert shared.foo == 3
    '';
})
@veprbl veprbl added the 6.topic: testing Tooling for automated testing of packages and modules label Jan 24, 2022
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: testing Tooling for automated testing of packages and modules
Development

No branches or pull requests

2 participants