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

feat: benchmark existing <runtime-name>.wasm or trigger build if needed #411

Open
wants to merge 7 commits into
base: chungquantin/feat-pop_bench
Choose a base branch
from

Conversation

chungquantin
Copy link
Collaborator

@chungquantin chungquantin commented Feb 12, 2025

How to test the PR?

  • Go to ./base-parachain or any parachain template.
  • Run pop bench pallet --pallet=pallet_timestamp --extrinsic= (No runtime provided)

Changelog

  • Add new method build_project to build any Rust projects with features and target, required for the tests of this PR. The method is shared with build_parachain.
  • Add new method build_binary_path to locate the binary path of the provided Rust project. The method is shared with binary_path method.
  • Implement new feature to automatically locate existing <runtime-name>.wasm to benchmark. The path of the runtime WASM blob follows:
./target/<PROFILE>/wbuild/<name-of-runtime>/<name_of_runtime>.wasm
  • Add unit tests for new methods. To test the build_project method for the runtime, we build the mock project with wasm32-unknown-unknown as target and locates the .wasm file.

[sc-2931]

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 16.92308% with 54 lines in your changes missing coverage. Please review.

Project coverage is 74.84%. Comparing base (fa2db46) to head (907696a).

Files with missing lines Patch % Lines
crates/pop-parachains/src/build.rs 0.00% 34 Missing ⚠️
crates/pop-cli/src/commands/bench/mod.rs 39.28% 13 Missing and 4 partials ⚠️
crates/pop-common/src/build.rs 0.00% 3 Missing ⚠️
@@                       Coverage Diff                       @@
##           chungquantin/feat-pop_bench     #411      +/-   ##
===============================================================
- Coverage                        75.09%   74.84%   -0.26%     
===============================================================
  Files                               66       66              
  Lines                            13946    14001      +55     
  Branches                         13946    14001      +55     
===============================================================
+ Hits                             10473    10479       +6     
- Misses                            2139     2188      +49     
  Partials                          1334     1334              
Files with missing lines Coverage Δ
crates/pop-common/src/build.rs 94.20% <0.00%> (-4.29%) ⬇️
crates/pop-cli/src/commands/bench/mod.rs 68.25% <39.28%> (-5.83%) ⬇️
crates/pop-parachains/src/build.rs 83.38% <0.00%> (-4.79%) ⬇️

@chungquantin chungquantin changed the title feat: auto detect wasm blob and build runtime feat: benchmark existing <runtime-name>.wasm or trigger build if needed Feb 13, 2025
@chungquantin chungquantin added the ready-for-final-review The PR is ready for final review label Feb 13, 2025
@chungquantin chungquantin self-assigned this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-final-review The PR is ready for final review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant