IntersectMBO / cardano-node-tests

System and end-to-end (E2E) tests for cardano-node.
https://tests.cardano.intersectmbo.org/
Apache License 2.0
53 stars 29 forks source link

Use Nix instead of venv? #1048

Closed Mr-Andersen closed 4 weeks ago

Mr-Andersen commented 2 years ago

Currently the repo uses both Nix and venv to create dev environments. It's possible to dispose of venv and only use Nix. It would make development and test runs cleaner and easier to perform. I can implement this myself.

mkoura commented 2 years ago

Hey! You can run nix-shell in root of the repo and you'll have everything that is needed for running the tests (we run our nightly jobs this way).

For development we need to use some packages in "editable" mode (pip install -e ...), not sure if that would work with nix? Namely cardano-clusterlib where we often need to make changes and test it together with cardano-node-tests.

Mr-Andersen commented 2 years ago

@mkoura oh, nice, you should mention that in readme :) However, when I call make lint from under nix-shell, it reports:

$ make lint
pre-commit run -a
make: pre-commit: No such file or directory
make: *** [Makefile:16: lint] Error 127

Are Nix and venv not in parity?

Mr-Andersen commented 2 years ago

This fixes it:

diff --git a/nix/default.nix b/nix/default.nix
index c342e8cd..ed087666 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -53,6 +53,7 @@ let
           requests
           psycopg2
           pandas
+          pre-commit
         ])) ];
       });
     });