moondance-labs / tanssi

GNU General Public License v3.0
116 stars 44 forks source link

add core buyer xcm emulator tests (non-forced) #599

Closed girazoki closed 5 days ago

girazoki commented 1 month ago

Added to a different file in which now the core-buyer is a collator. Tests are identical

Includes a refactor to decide whether we want to test forced or non-forced manner

github-actions[bot] commented 1 month ago

Coverage Report

(master)

@@                              Coverage Diff                               @@
##           master   girazoki-test-non-forced-buy-core-emulator      +/-   ##
==============================================================================
- Coverage   66.94%                                       66.61%   -0.33%     
- Files         250                                          249       -1     
- Lines       43712                                        43238     -474     
==============================================================================
- Hits        29260                                        28802     -458     
- Misses      14452                                        14436      -16     
Files Changed Coverage
/container-chains/runtime-templates/frontier/src/lib.rs 58.88% (-0.06%) 🔽
/container-chains/runtime-templates/simple/src/lib.rs 72.54% (+0.24%) 🔼
/pallets/author-noting/src/lib.rs 87.96% (-0.17%) 🔽
/pallets/authority-assignment/src/lib.rs 97.87% (-0.21%) 🔽
/pallets/authority-mapping/src/lib.rs 88.24% (-2.67%) 🔽
/pallets/collator-assignment/src/lib.rs 94.74% (+0.86%) 🔼
/pallets/configuration/src/lib.rs 87.50% (-0.29%) 🔽
/pallets/data-preservers/src/types.rs 75.00% (-12.50%) 🔽
/pallets/inflation-rewards/src/lib.rs 91.54% (+2.07%) 🔼
/pallets/invulnerables/src/lib.rs 85.19% (-0.40%) 🔽
/pallets/pooled-staking/src/candidate.rs 95.45% (-0.88%) 🔽
/pallets/pooled-staking/src/lib.rs 55.94% (-1.61%) 🔽
/pallets/registrar/src/lib.rs 90.56% (+1.69%) 🔼
/pallets/services-payment/src/lib.rs 94.27% (+4.30%) 🔼
/pallets/stream-payment/runtime-api/src/lib.rs 84.00% (-3.50%) 🔽
/pallets/stream-payment/src/lib.rs 91.01% (-1.18%) 🔽
/pallets/xcm-core-buyer/src/lib.rs 91.08% (-0.50%) 🔽
/primitives/traits/src/lib.rs 68.42% (-2.49%) 🔽
/runtime/dancebox/src/lib.rs 89.11% (-0.38%) 🔽
/runtime/dancebox/tests/common/xcm/core_buyer.rs 100.00% (+9.16%) 🔼
/runtime/flashbox/src/lib.rs 45.98% (-0.52%) 🔽
/solo-chains/runtime/starlight/src/genesis_config_presets.rs 10.18% (-10.96%) 🔽
/solo-chains/runtime/starlight/src/lib.rs 12.34% (-5.95%) 🔽
/solo-chains/runtime/starlight/src/validator_manager.rs 21.31% (-27.87%) 🔽

Coverage generated Fri Jul 5 12:16:05 UTC 2024

ParthDesai commented 3 weeks ago

@girazoki If possible, can we modify do_test to either use force_buy_core or buy_core based on flag? Similarly we can have common test body with the flag and two wrapper around it basically one asking the test body to use buy_core and another one to use force_buy_core.

girazoki commented 3 weeks ago

I made everything common but rather I kept tests separate for now