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

Integration tests setup #947

Merged
merged 8 commits into from
Jun 1, 2023
Merged

Integration tests setup #947

merged 8 commits into from
Jun 1, 2023

Conversation

shaunxw
Copy link
Member

@shaunxw shaunxw commented May 31, 2023

Pull Request Summary

Set up integration tests. Moved current pallet-proxy tests into integration tests.

Check list

  • added or updated unit tests
  • updated Astar official documentation
  • added OnRuntimeUpgrade hook for precompile revert code registration
  • updated spec version
  • updated semver

@shaunxw shaunxw added the tests If the PR/issue is related to tests, like xcm-simulator tests, rpc-tests etc. label May 31, 2023
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.

Love this!

Comment on lines 115 to 117
DappsStaking::on_finalize(System::block_number());
System::set_block_number(System::block_number() + 1);
DappsStaking::on_initialize(System::block_number());
Copy link
Member

Choose a reason for hiding this comment

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

Can we run the hooks for all pallets?
AFAIK, they cannot be just fetched and iterated over, while being able to call hooks on them (hope I'm wrong though!).

Copy link
Member Author

Choose a reason for hiding this comment

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

Not a problem. I was originally thinking to add them as needed. After some second thoughts, I agree with you, will do so that we don't need to worry about adding more pallets overtime.

Copy link
Member

Choose a reason for hiding this comment

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

Great! Now that I rethink what I wrote, there has to be a way to do it since it's done when network is live 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated. I checked all pallets manually and added hooks if there are defined. ParachainSystem was skipped as it requires extra mocks but not required for tests. The pallets could be iterated via some tricky way, like macro or the runtime enum definition, but IMO it would be a bit overkill and edge cases would make more complicated.

mod setup;

#[cfg(any(feature = "shibuya", feature = "shiden"))]
mod proxy;
Copy link
Contributor

Choose a reason for hiding this comment

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

I will add astar as well after we merge pallet-proxy-astar PR.

Copy link
Contributor

@gitofdeepanshu gitofdeepanshu left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

@shaunxw shaunxw merged commit 4c99aac into master Jun 1, 2023
@shaunxw shaunxw deleted the feat/integration-tests branch June 1, 2023 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants