Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pytests/iroha_cli_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
4 changes: 4 additions & 0 deletions pytests/iroha_torii_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ To run the automated tests, use the following command:
```bash
poetry run pytest
```

## Nix tool

See [../../scripts/pytests.nix]
45 changes: 45 additions & 0 deletions scripts/pytests.nix
Original file line number Diff line number Diff line change
@@ -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`
Copy link
Contributor

@aoyako aoyako Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the guide in thepytest/* folder be updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mentioned, intentionally with minimal effort

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And opened #5504

# Run from the repo root: `nix-shell ./scripts/pytests.nix`
# That's it
with import <nixpkgs> {};
pkgs.mkShell {
buildInputs = [
poetry
python313Packages.tomli-w

cowsay
];

BIN_IROHAD = "target/release/irohad";
BIN_IROHA = "target/release/iroha";
BIN_KAGAMI = "target/release/kagami";
Comment on lines +17 to +19
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What’s the rationale for switching to release builds? Is it to align with integration tests that use cargo install? However, unless we’re testing non‑functional requirements, wouldn’t debug builds suffice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, debug builds would totally suffice.

I made it to align with the integration tests. Which aren't, btw, using cargo install anymore; they rely on target/release bins too.

Copy link
Contributor

@s8sato s8sato Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be helpful to update the README.md or CONTRIBUTING.md with instructions on how to run the integration tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created: #5505


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
'';
}
Loading