diff --git a/pytests/iroha_cli_tests/README.md b/pytests/iroha_cli_tests/README.md index f935bb8adc8..1ab51a0e7bd 100644 --- a/pytests/iroha_cli_tests/README.md +++ b/pytests/iroha_cli_tests/README.md @@ -194,3 +194,7 @@ allure serve allure-results ``` The `allure-results` argument specifies the directory where the report is stored. After running this command, you will be able to view the report in your web browser by navigating to `http://localhost:port`, where `port` is the port number displayed in the terminal output. + +## Nix tool + +See [../../scripts/pytests.nix] diff --git a/pytests/iroha_torii_tests/README.md b/pytests/iroha_torii_tests/README.md index a9e4abe7757..d50260594d3 100644 --- a/pytests/iroha_torii_tests/README.md +++ b/pytests/iroha_torii_tests/README.md @@ -28,3 +28,7 @@ To run the automated tests, use the following command: ```bash poetry run pytest ``` + +## Nix tool + +See [../../scripts/pytests.nix] diff --git a/scripts/pytests.nix b/scripts/pytests.nix new file mode 100755 index 00000000000..bf819825449 --- /dev/null +++ b/scripts/pytests.nix @@ -0,0 +1,45 @@ +# This is for development convenience, to make setting up and running pytests straightforward. +# This is not a final product, so feel free to edit manually to adjust tests running or do whatever is convenient +# for you right now. +# +# Build binaries: `cargo build --release --bins` +# Run from the repo root: `nix-shell ./scripts/pytests.nix` +# That's it +with import {}; + pkgs.mkShell { + buildInputs = [ + poetry + python313Packages.tomli-w + + cowsay + ]; + + BIN_IROHAD = "target/release/irohad"; + BIN_IROHA = "target/release/iroha"; + BIN_KAGAMI = "target/release/kagami"; + + TMP_DIR = "../../test"; + IROHA_CLI_BINARY = "iroha"; + IROHA_CLI_CONFIG = "client.toml"; + + shellHook = '' + ./scripts/test_env.py setup + echo "Set up test env" + + cd pytests/iroha_cli_tests + poetry install --no-root + poetry run pytest + + cd ../iroha_torii_tests + poetry install --no-root + poetry run pytest + + cd ../../ + + ./scripts/test_env.py cleanup + echo "Cleaned up" + + cowsay "Done!" + exit + ''; + }