Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

add unit tests to run runtime migrations #5865

Merged
merged 6 commits into from
Aug 11, 2022

Conversation

kianenigma
Copy link
Contributor

We should not replace the try-runtime testing in release process with this, as this is all executing in native and is not realistic. Nonetheless, this can now be toyed with as simple as:

cargo remote -b "RUST_LOG=remote-ext=debug,runtime=debug" test -- --release -p westend-runtime -p polkadot-runtime -p kusama-runtime --features try-runtime

@kianenigma kianenigma added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. labels Aug 8, 2022
@kianenigma kianenigma requested a review from coderobe August 8, 2022 10:30
@paritytech-ci paritytech-ci requested review from a team August 8, 2022 10:31
runtime/westend/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

❤️

.to_string()
.into();
let maybe_state_snapshot: Option<SnapshotConfig> =
std::option_env!("SNAP").map(|s| s.to_string().into());
Copy link
Member

Choose a reason for hiding this comment

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

Why not parse the env variable at runtime? Why at compile time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no particular preference to be honest, I supposedly had the syntax for this on the top of my head 🤷

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 its better to do at runtime, we had CI problems in the past where the CI did not provide the ENV variables.

@paritytech-ci paritytech-ci requested a review from a team August 8, 2022 18:43
Co-authored-by: Mara Robin B. <mara@broda.me>
Copy link
Member

@ggwpez ggwpez left a comment

Choose a reason for hiding this comment

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

So this allows to run the try-runtime as a rust test? Very cool!

@kianenigma
Copy link
Contributor Author

So this allows to run the try-runtime as a rust test? Very cool!

We should not replace the try-runtime testing in release process with this, as this is all executing in native and is not realistic. Nonetheless, this can now be toyed with.

I think this is fine for PR testing, but before release we should still execute stuff with wasm

runtime/westend/src/lib.rs Outdated Show resolved Hide resolved
@kianenigma
Copy link
Contributor Author

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 107456b into master Aug 11, 2022
@paritytech-processbot paritytech-processbot bot deleted the kiz-migration-test-as-unit-test branch August 11, 2022 06:24
ordian added a commit that referenced this pull request Aug 15, 2022
* master:
  Transaction payment runtime apis: query call info and fee details (#5871)
  [ci] Improve cancel-pipeline job (#5874)
  Bump wasmtime from 0.38.1 to 0.38.3 (#5802)
  Incorporate changes from substrate PR #11908 (#5815)
  Add nomination pools to Polkadot runtime (#5582)
  Change request-response protocol names to include genesis hash & fork id (#5870)
  [ci] Run check-runtime only for PRs (#5858)
  Bump tokio from 1.18.2 to 1.19.2 (#5678)
  Zombienet: test disputes with malus garbage candidates (#5857)
  add unit tests to run runtime migrations (#5865)
  Trivial networking changes for Substrate PR #11940 (#5841)
  Renaming CLI prunning and keep-blocks flags (#5863)
  Update yamux to fix a potential crash (#5861)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants