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

Fix integration test #124

Merged
merged 38 commits into from
Jul 23, 2020
Merged

Fix integration test #124

merged 38 commits into from
Jul 23, 2020

Conversation

cecton
Copy link
Contributor

@cecton cecton commented Jun 23, 2020

Fixes #108

Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
@cecton cecton added A3-inprogress B0-silent Changes should not be mentioned in any release notes labels Jun 23, 2020
@cecton cecton self-assigned this Jun 23, 2020
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
cecton added 18 commits June 23, 2020 13:03
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
@cecton
Copy link
Contributor Author

cecton commented Jul 9, 2020

The test is working. I just need to clean-up 😃

Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
Forked at: 8b1fd65
Parent branch: origin/master
@cecton cecton marked this pull request as ready for review July 10, 2020 11:48
@cecton cecton requested a review from bkchr July 10, 2020 11:48
Forked at: 8b1fd65
Parent branch: origin/master

// create and sign transaction
let wasm = fs::read(target_dir().join(
"wbuild/cumulus-test-parachain-runtime/cumulus_test_parachain_runtime.compact.wasm",
Copy link
Member

Choose a reason for hiding this comment

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

Nope ;)

Please import the runtime and use the WASM_BINARY directly. This is the reason this constant exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, ok great!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


// Adapted from
// https://github.com/rust-lang/cargo/blob/485670b3983b52289a2f353d589c57fae2f60f82/tests/testsuite/support/mod.rs#L507
fn target_dir() -> PathBuf {
Copy link
Member

Choose a reason for hiding this comment

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

Can be deleted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

obviously

Copy link
Contributor Author

@cecton cecton Jul 14, 2020

Choose a reason for hiding this comment

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

done

let t2 = async {
let para_id = ParaId::from(100);

future::join(alice.wait_for_blocks(2_usize), bob.wait_for_blocks(2_usize)).await;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
future::join(alice.wait_for_blocks(2_usize), bob.wait_for_blocks(2_usize)).await;
future::join(alice.wait_for_blocks(2), bob.wait_for_blocks(2)).await;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

pin_mut!(t1, t2);

select! {
_ = t1 => {
Copy link
Member

Choose a reason for hiding this comment

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

In general this is something that could be moved to polkadot-test-service as helper function. Especially the generation of t1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 you mean to substrate no? I could probably make a macro to will also handle the runtime using tokio like tokio::test but substrate::test (will do async + timeout for the test)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made this PR to address this: paritytech/substrate#6651

@cecton cecton merged commit bcc6277 into master Jul 23, 2020
@cecton cecton deleted the cecton-fix-int-test-3 branch July 23, 2020 14:12
Maharacha pushed a commit to Maharacha/cumulus that referenced this pull request May 10, 2023
* bump encointer-pallets

* [chain_spec] rename ceremony phase values to CamelCase
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
B0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix integration test
2 participants