Skip to content

misc: add pytests.nix dev utility #5501

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

0x009922
Copy link
Contributor

Instead of setting up Python, Poetry, requirements.txt, setting up ENV vars, moving between directories and typing commands manually, just do:

nix-shell ./scripts/pytests.nix

This script is intentionally simple, and serves both as a documentation and a tool to quickly modify it locally and run tests as you like (without necessarily committing changes back to the script).

@0x009922 0x009922 requested a review from aoyako July 25, 2025 03:11
@0x009922 0x009922 self-assigned this Jul 25, 2025
@0x009922 0x009922 added the Tests label Jul 25, 2025
@0x009922 0x009922 requested a review from s8sato as a code owner July 25, 2025 03:11
@0x009922 0x009922 added the Chore This is a small task that can be done at any point in time and is easier than others label Jul 25, 2025
@s8sato s8sato self-assigned this Jul 29, 2025
Comment on lines +17 to +19
BIN_IROHAD = "target/release/irohad";
BIN_IROHA = "target/release/iroha";
BIN_KAGAMI = "target/release/kagami";
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

# 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

Comment on lines +17 to +19
BIN_IROHAD = "target/release/irohad";
BIN_IROHA = "target/release/iroha";
BIN_KAGAMI = "target/release/kagami";
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chore This is a small task that can be done at any point in time and is easier than others Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants