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

Restructure Parachains Integration Tests (Emulated) #2892

Open
muharem opened this issue Jul 18, 2023 · 7 comments
Open

Restructure Parachains Integration Tests (Emulated) #2892

muharem opened this issue Jul 18, 2023 · 7 comments

Comments

@muharem
Copy link
Contributor

muharem commented Jul 18, 2023

Context:

The current structure for the tests based on xcm-emulator under the parachains/integration-tests/emulated/ directory,
./common - setup for all networks (polkadot, kusama, etc) hence imports all runtimes
./%parachain% - tests crate per parachain which imports common

Problem:

  • every tests imports all the runtimes which results a long compilation process while developing locally
  • one common for all networks setup results long names and inconvenient navigation through the xcm-emulator setup

Proposal 1

Per crate per network with all tests cases structured via modules, the xcm-emulator setup located in crate's lib.rs, something like parachains/integration-tests/emulated/:
./polakdot
./polakdot/src/lib.rs - xcm-emulator setup moved from common, only the part concerning Polkadot network
./polakdot/src/assethub - parachain based module
./polakdot/src/treasury - feature based module
...
./kusama
...

Proposal 2

Split parachains/integration-tests/emulated/common into parachains/integration-tests/emulated/network/[polkadot|kusama|...].

@muharem
Copy link
Contributor Author

muharem commented Jul 18, 2023

@NachoPal
Copy link
Contributor

NachoPal commented Jul 19, 2023

I would prefer Proposal 2. It would solve the problem without touching anything else. I like our current directory tree structure which follows parachains/runtimes directory.

In Proposal 1 you are overlooking we will have BridgesHub integrations tests and therefore we'll need runtimes from different networks. If we have one crate per network we would have to import anyway other network crate with its runtimes.

There is also another alternative which is this one: #2752
I would like to see it merged. It could be used also for integration tests.

@muharem
Copy link
Contributor Author

muharem commented Jul 27, 2023

@NachoPal good point about Bridges

@NachoPal
Copy link
Contributor

NachoPal commented Aug 2, 2023

If you agree, what I can do is to split parachains/integration-tests/common into:

  • parachains/integration-tests/common/common/ - integration-tests-common (stuff common to all networks)
  • parachains/integration-tests/common/polkadot/ - integration-tests-common-polkadot
  • parachains/integration-tests/common/kusama/ - integration-tests-common-kusama
  • parachains/integration-tests/common/westend/ - integration-tests-common-westend
  • parachains/integration-tests/common/rococo/ - integration-tests-common-rococo

Then, each parachain will have to import only integration-tests-common and its respective common network crate.

Only BridgeHub parachains will have the need of importing more than one common network crate.

@muharem
Copy link
Contributor Author

muharem commented Aug 2, 2023

yeah, sounds good to me

@bkontur
Copy link
Contributor

bkontur commented Aug 2, 2023

If you agree, what I can do is to split parachains/integration-tests/common into:

* `parachains/integration-tests/common/common/` - `integration-tests-common` (stuff common to all networks)

* `parachains/integration-tests/common/polkadot/` - `integration-tests-common-polkadot`

* `parachains/integration-tests/common/kusama/` - `integration-tests-common-kusama`

* `parachains/integration-tests/common/westend/` - `integration-tests-common-westend`

* `parachains/integration-tests/common/rococo/` - `integration-tests-common-rococo`

Then, each parachain will have to import only integration-tests-common and its respective common network crate.

Only BridgeHub parachains will have the need of importing more than one common network crate.

I am finally coming to adding some integration tests,
but this looks reasonable

@NachoPal are you going to change this in your big PR?

@NachoPal
Copy link
Contributor

NachoPal commented Aug 2, 2023

@NachoPal are you going to change this in your big PR?

No, I will open a new one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants