Add CosmOrc test for NFT mint, transfer, and instantiate gas usage.#84
Add CosmOrc test for NFT mint, transfer, and instantiate gas usage.#84
Conversation
bfdbe1d to
5627cf5
Compare
5627cf5 to
2229636
Compare
2229636 to
aaaaf91
Compare
|
Extremely useful, thanks Ekez |
|
This orc things looks cool. Is it ready for larger use? Can you link it here? CosmWasm/cw-plus#507 We had been discussing some way to benchmark gas better, but in the end it needs a chain, not just a local vm, to do this proper. |
Done. I think it's ready? |
ueco-jb
left a comment
There was a problem hiding this comment.
Really nice example of gas benchmark integration 👍 Gotta save link for later
| e2e integration tests with gas profiling. | ||
|
|
||
| `cd ci/integration_tests && cargo t` to run all tests. | ||
|
|
||
| `cargo t fn_test_name` to run individual integration tests. |
There was a problem hiding this comment.
Also some CONFIG variable needs to be set.
https://github.com/CosmWasm/cw-nfts/pull/84/files#diff-1d721ea28fc40ef113f3080306e4595d8176b794321429300530a386a0e305c6R83
and I don't see any mention about that (I might be blind though).
Co-authored-by: Jakub Bogucki <jakub@confio.gmbh>
2a26f4f to
7e96526
Compare
shanev
left a comment
There was a problem hiding this comment.
Should totally get this in after it's been updated.
This adds @de-husk's amazing cosmwasm orc library to this repository which allows us to run contract tests against a real local chan and measure gas usage while we're at it. It currently tests a simple instantiate, mint, and transfer flow and captures gas usage in
ci/integration-tests/gas_reports.Here is an example gas report showing the gas usage of each operation:
{ "cw721_base": { "Execute__cw721_base_mint": { "file_name": "ci/integration-tests/src/tests/cw721_base_test.rs", "gas_used": 140453, "gas_wanted": 186171, "line_number": 39 }, "Execute__cw721_base_transfer": { "file_name": "ci/integration-tests/src/tests/cw721_base_test.rs", "gas_used": 137331, "gas_wanted": 181488, "line_number": 55 }, "Instantiate__cw721_base_init": { "file_name": "ci/integration-tests/src/tests/cw721_base_test.rs", "gas_used": 165333, "gas_wanted": 223490, "line_number": 21 } } }Merging this will cause the associated GitHub action to make a comment on new changes describing how gas usage changed for its tests: