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

[feature] #3376: Add Iroha Client CLI pytest automation framework #3490

Merged

Conversation

AlexStroke
Copy link
Contributor

Description

This PR introduces automated tests for the Iroha Client CLI, using Python's Pytest framework. The new test suite includes a collection of tests that verify the functionality of the client CLI in various scenarios.

@github-actions github-actions bot added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label May 18, 2023
@AlexStroke AlexStroke changed the title [feature] hyperledger#3376 Added Iroha Client CLI pytest automation framework [feature] #3376 Added Iroha Client CLI pytest automation framework May 18, 2023
@AlexStroke AlexStroke changed the title [feature] #3376 Added Iroha Client CLI pytest automation framework [test] #3376 Added Iroha Client CLI pytest automation framework May 18, 2023
@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #3490 (741302e) into iroha2-dev (a4d5c9f) will decrease coverage by 6.30%.
The diff coverage is 22.22%.

❗ Current head 741302e differs from pull request most recent head 13813a2. Consider uploading reports for the commit 13813a2 to get more accurate results

@@              Coverage Diff               @@
##           iroha2-dev    #3490      +/-   ##
==============================================
- Coverage       62.33%   56.03%   -6.30%     
==============================================
  Files             169      160       -9     
  Lines           31218    31294      +76     
==============================================
- Hits            19459    17535    -1924     
- Misses          11759    13759    +2000     
Impacted Files Coverage Δ
cli/src/lib.rs 0.57% <0.00%> (-68.86%) ⬇️
cli/src/main.rs 0.66% <0.00%> (-0.44%) ⬇️
cli/src/samples.rs 0.00% <0.00%> (-61.85%) ⬇️
cli/src/style.rs 0.00% <0.00%> (ø)
cli/src/torii/mod.rs 0.00% <0.00%> (-27.66%) ⬇️
cli/src/torii/routing.rs 0.00% <0.00%> (-57.11%) ⬇️
cli/src/torii/utils.rs 0.00% <0.00%> (-84.85%) ⬇️
client/src/http_default.rs 0.00% <0.00%> (-38.94%) ⬇️
client/src/lib.rs 3.84% <0.00%> (-96.16%) ⬇️
client_cli/src/main.rs 0.24% <0.00%> (-0.02%) ⬇️
... and 97 more

... and 58 files with indirect coverage changes

@AlexStroke AlexStroke changed the title [test] #3376 Added Iroha Client CLI pytest automation framework [test] #3376: Added Iroha Client CLI pytest automation framework May 18, 2023
@AlexStroke AlexStroke changed the title [test] #3376: Added Iroha Client CLI pytest automation framework [feature] #3376: Added Iroha Client CLI pytest automation framework May 18, 2023
@AlexStroke AlexStroke changed the title [feature] #3376: Added Iroha Client CLI pytest automation framework [feature] #3376: Add Iroha Client CLI pytest automation framework May 18, 2023
Copy link
Contributor

@0x009922 0x009922 left a comment

Choose a reason for hiding this comment

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

I wonder if we can test SDKs with this framework.

For example, I could create a JavaScript CLI (using iroha-javascript) with the same interface as iroha_client_clihas. Then it would be straightforward to plug it intoclient_cli.py`, passing just a different binary path.

First of all, it will ensure that JS or whatever SDK covers the same functionality for sure. Furthermore, building such a CLI using JS SDK will help to enhance the SDK itself, because it still doesn't have "real-word" use cases.

@Erigara Erigara self-assigned this May 29, 2023
@Erigara
Copy link
Contributor

Erigara commented May 29, 2023

I have number of failed tests when i try to run testing suit.

@Erigara
Copy link
Contributor

Erigara commented May 29, 2023

@astrokov7 do we need to restart iroha before running tests?

Copy link
Contributor

@Erigara Erigara left a comment

Choose a reason for hiding this comment

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

Looks good in general.

client_cli/pytests/README.md Outdated Show resolved Hide resolved
client_cli/pytests/pyproject.toml Show resolved Hide resolved
client_cli/pytests/common/consts.py Show resolved Hide resolved
client_cli/pytests/common/consts.py Outdated Show resolved Hide resolved
client_cli/pytests/models/account.py Show resolved Hide resolved
client_cli/pytests/models/asset.py Outdated Show resolved Hide resolved
client_cli/pytests/src/client_cli/client_cli.py Outdated Show resolved Hide resolved
client_cli/pytests/src/client_cli/iroha.py Outdated Show resolved Hide resolved
@AlexStroke
Copy link
Contributor Author

@astrokov7 do we need to restart iroha before running tests?

no

client_cli/pytests/README.md Outdated Show resolved Hide resolved
client_cli/pytests/common/helpers.py Outdated Show resolved Hide resolved
client_cli/pytests/src/client_cli/client_cli.py Outdated Show resolved Hide resolved
client_cli/pytests/common/settings.py Outdated Show resolved Hide resolved
@QuentinI QuentinI self-assigned this May 31, 2023
@mversic mversic force-pushed the iroha2-dev-client-cli-tests branch from de7fb5e to 9d4826a Compare June 1, 2023 03:21
AlexStroke and others added 14 commits June 22, 2023 12:00
…ramework

Signed-off-by: alexstroke <busyfifer@gmail.com>
…/pytests

Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
Signed-off-by: alexstroke <busyfifer@gmail.com>
@appetrosyan appetrosyan merged commit a49d6f1 into hyperledger:iroha2-dev Jun 22, 2023
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants