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

update tests to use cargo-nextest if present #1243

Merged
merged 5 commits into from
May 16, 2024
Merged

Conversation

ermalkaleci
Copy link
Contributor

@ermalkaleci ermalkaleci commented May 14, 2024

Make cargo-nextest preferred option to run tests with fallback to cargo test.
cargo-nextest makes it easy to identify slow and leaky test and tests results are easy to read.

@ermalkaleci ermalkaleci added ci This PR/Issue is related to the topic "CI" tests If the PR/issue is related to tests, like xcm-simulator tests, rpc-tests etc. labels May 14, 2024
Copy link
Member

@Dinonard Dinonard left a comment

Choose a reason for hiding this comment

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

Please add a PR summary of why the PR has been made, what it addresses, etc.

Of course, I googled what this is, read about it, and assume you want to speed up the execution. Still, a summary of this info should be available as part of the PR.

Makefile Outdated

.PHONY: test
test:
SKIP_WASM_BUILD= ${cargo_test} --all
Copy link
Member

Choose a reason for hiding this comment

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

I think we want to skip --all since it disables some part of the code (even though I think they're not tested by UTs) that are run outside of evm-tracing context. This is why we specified try-runtime,runtime-benchmarks explicitly before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually --all is deprecated and needs to be replaced with --workspace. I don't understand it disables some part of the code

Copy link
Member

Choose a reason for hiding this comment

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

Some parts of the client code are compiled only when evm-tracing is disabled, and vice-versa. That's what I meant by disabled - poor choice of words from my side.

Since non-evm-tracing client is more important, running tests with disabled evm-tracing makes more sense. But then again, I don't believe we have tests covering client so perhaps this worry is baseless.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't run any test with feature evm-tracing. Will add one

Makefile Outdated
Comment on lines 19 to 21
.PHONY: test-all
test-all: test test-runtimes
SKIP_WASM_BUILD= ${cargo_test} --workspace --features try-runtime,runtime-benchmarks
Copy link
Member

Choose a reason for hiding this comment

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

To make my comment more specific about features...

Why not just run it once with features enabled?
I assume this is because you want to ensure that tests work with no features enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

@@ -194,6 +194,7 @@ pub(crate) mod tests {
use sp_runtime::BuildStorage;

#[test]
#[ignore]
Copy link
Member

Choose a reason for hiding this comment

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

Why this btw? 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will require building wasm which means more time to compile and it's just for local so not that critical if this breaks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok I will let it compile local runtime, will revert this

Copy link
Member

Choose a reason for hiding this comment

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

No need btw, we can just remove that test. But your call.

Copy link

Code Coverage

Package Line Rate Branch Rate Health
chain-extensions/types/unified-accounts/src 0% 0%
chain-extensions/pallet-assets/src 56% 0%
pallets/static-price-provider/src 52% 0%
pallets/dapp-staking-v3/src 92% 0%
chain-extensions/types/assets/src 0% 0%
precompiles/substrate-ecdsa/src 74% 0%
chain-extensions/unified-accounts/src 0% 0%
pallets/dapp-staking-v3/src/benchmarking 99% 0%
precompiles/sr25519/src 64% 0%
pallets/collator-selection/src 92% 0%
pallets/astar-xcm-benchmarks/src 88% 0%
pallets/dapp-staking-v3/src/test 0% 0%
pallets/oracle-benchmarks/src 0% 0%
precompiles/assets-erc20/src 81% 0%
pallets/dynamic-evm-base-fee/src 92% 0%
primitives/src 61% 0%
precompiles/dapp-staking-v3/src/test 0% 0%
pallets/astar-xcm-benchmarks/src/generic 100% 0%
precompiles/xcm/src 73% 0%
pallets/unified-accounts/src 86% 0%
precompiles/xvm/src 75% 0%
precompiles/unified-accounts/src 100% 0%
pallets/inflation/src 83% 0%
pallets/dapp-staking-migration/src 0% 0%
pallets/ethereum-checked/src 79% 0%
pallets/xvm/src 54% 0%
pallets/xc-asset-config/src 64% 0%
pallets/dapp-staking-v3/rpc/runtime-api/src 0% 0%
precompiles/dispatch-lockdrop/src 86% 0%
chain-extensions/types/xvm/src 0% 0%
pallets/price-aggregator/src 72% 0%
chain-extensions/xvm/src 0% 0%
pallets/astar-xcm-benchmarks/src/fungible 100% 0%
primitives/src/xcm 64% 0%
precompiles/dapp-staking-v3/src 90% 0%
Summary 78% (3599 / 4632) 0% (0 / 0)

Minimum allowed line rate is 50%

Copy link
Member

@Dinonard Dinonard left a comment

Choose a reason for hiding this comment

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

LGTM

@ermalkaleci ermalkaleci merged commit dc72150 into master May 16, 2024
8 checks passed
@ermalkaleci ermalkaleci deleted the feat/update-test-ci branch May 16, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci This PR/Issue is related to the topic "CI" tests If the PR/issue is related to tests, like xcm-simulator tests, rpc-tests etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants