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

Script to print sizes of all integration test contracts #1851

Merged
merged 5 commits into from
Jul 24, 2023

Conversation

ascjones
Copy link
Collaborator

@ascjones ascjones commented Jul 20, 2023

A basic script to print out all integration-tests contract sizes. This is a first step towards restoring the CI step of diffing contract wasm sizes for PRs to check for improvements/regressions.

It can be invoked using find to run recursively over all cargo projects in a directory, skipping over any project which doesn't compile with cargo contract build (assumed to be a non-contract project).

find ./integration-tests/ -name "Cargo.toml" -exec ./scripts/contract_size.sh {} \;

image

trait_erc20 7887
call_builder_return_value 8952
wildcard_selector 2496
psp22_extension 7012
rand_extension 2935
e2e_call_runtime 1000
multisig 23387
dns 8797
erc20 7487
conditional_compilation 1176
trait_incrementer 1336
erc721 11277
call_runtime 1781
custom_allocator 8216
erc1155 16893
integration_flipper 1599
call_builder 5179
call_builder_delegate 2436
constructors_return_value 1779
contract_ref 4710
updated_incrementer 1458
incrementer 1479
trait_flipper 1176
mapping_integration_tests 3346
accumulator 1052
adder 1710
multi_contract_caller 6103
subber 1727
contract_transfer 1441
contract_terminate 1149
flipper 1403
payment_channel 5942
other_contract 1295
basic_contract_caller 3117
trait_incrementer 1274
trait_incrementer_caller 2569
custom_environment 2548
incrementer 1215
mother 10410

@codecov-commenter
Copy link

Codecov Report

Merging #1851 (14f0392) into master (6d7810e) will increase coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1851      +/-   ##
==========================================
+ Coverage   52.14%   52.17%   +0.03%     
==========================================
  Files         206      206              
  Lines        6658     6658              
==========================================
+ Hits         3472     3474       +2     
+ Misses       3186     3184       -2     

see 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ascjones ascjones mentioned this pull request Jul 21, 2023
Copy link
Collaborator

@xgreenx xgreenx left a comment

Choose a reason for hiding this comment

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

I was not aware of --output-json=)
image

@ascjones ascjones merged commit 8383828 into master Jul 24, 2023
@ascjones ascjones deleted the aj/contract-sizes branch July 24, 2023 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants