-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Test configuration types:
polkadot-ecosystem-tests/packages/shared/src/helpers/index.ts
Lines 490 to 518 in 6ad4944
| /** | |
| * Configuration for relay chain tests. | |
| */ | |
| export interface RelayTestConfig { | |
| testSuiteName: string | |
| addressEncoding: number | |
| blockProvider: 'Local' | |
| chainEd?: ChainED | |
| } | |
| /** | |
| * Configuration for parachain tests. | |
| * Async backing is relevant due to the step size of `parachainSystem.lastRelayChainBlockNumber`. | |
| * | |
| * Recall that with the AHM, the scheduler pallet's agenda will be keyed by this block number. | |
| * It is, then, relevant for tests to know whether AB is enabled. | |
| */ | |
| export interface ParaTestConfig { | |
| testSuiteName: string | |
| addressEncoding: number | |
| blockProvider: BlockProvider | |
| asyncBacking: AsyncBacking | |
| chainEd?: ChainED | |
| } | |
| /** | |
| * Union type for all test configurations, whether relay or parachain. | |
| */ | |
| export type TestConfig = RelayTestConfig | ParaTestConfig |
were originally meant to facilitate the specification of network-specific information such as a test suite name and the network's SS58 address encoding, to be used in tests when comparing addresses in events and data queries.
However, this is repetitive, brittle and at times hindering and unexpressive:
polkadot-ecosystem-tests/packages/kusama/src/peopleKusama.system.e2e.test.ts
Lines 14 to 21 in 6ad4944
| const testConfigForAssetHub: ParaTestConfig = { | |
| testSuiteName: 'Kusama People System', | |
| addressEncoding: 2, | |
| blockProvider: 'NonLocal', | |
| asyncBacking: 'Enabled', | |
| } | |
| registerTestTree(systemE2ETestsViaRemoteScheduler(assetHubKusama, peopleKusama, testConfigForAssetHub)) |
| const testConfigForAssetHub: ParaTestConfig = { | |
| testSuiteName: 'Polkadot System', | |
| addressEncoding: 2, | |
| blockProvider: 'NonLocal', | |
| asyncBacking: 'Enabled', | |
| } | |
| registerTestTree(systemE2ETestsViaRemoteScheduler(assetHubPolkadot, polkadot, testConfigForAssetHub)) |
polkadot-ecosystem-tests/packages/polkadot/src/bridgeHubPolkadot.system.e2e.test.ts
Lines 4 to 11 in 6ad4944
| const testConfigForAssetHub: ParaTestConfig = { | |
| testSuiteName: 'Polkadot BridgeHub System', | |
| addressEncoding: 0, | |
| blockProvider: 'NonLocal', | |
| asyncBacking: 'Enabled', | |
| } | |
| registerTestTree(systemE2ETestsViaRemoteScheduler(assetHubPolkadot, bridgeHubPolkadot, testConfigForAssetHub)) |
Consider the last 3 examples, introduced as part of #411. These system suites, which test runtime upgrades, have configuration data related to the network's asset hub chain, but also:
- the network's address encoding
- whether or not the tested chain's block provider is local
- whether or not AB is enabled
- the test suite's name
The configuration's semantic value is confusing: from the above data, some is related to the chain being tested, other to the network's AH, some is metadata (suite name).
This issue is about improving this situation.