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

Fix all ignored system parachain integration tests #3027

Open
rphmeier opened this issue Aug 17, 2023 · 1 comment
Open

Fix all ignored system parachain integration tests #3027

rphmeier opened this issue Aug 17, 2023 · 1 comment
Labels
I5-tests Tests need fixing, improving or augmenting.

Comments

@rphmeier
Copy link
Contributor

rphmeier commented Aug 17, 2023

Related discussions: #3026 #3023 - in #2300 I'm simply ignoring the tests to enable a merge, but a fix to the tests should be forthcoming afterwards.

17db1fb <- this commit shows the ignoring of tests.

@rphmeier rphmeier added the I5-tests Tests need fixing, improving or augmenting. label Aug 17, 2023
@bkontur
Copy link
Contributor

bkontur commented Aug 18, 2023

I think that set_validation_data is hack just for opening HRMP channel,
we use different kind of hack for hrmp for benchmarks:

/// Open HRMP channel for using it in tests.
	///
	/// The caller assumes that the pallet will accept regular outbound message to the sibling
	/// `target_parachain` after this call. No other assumptions are made.
	pub fn open_outbound_hrmp_channel_for_tests(_target_parachain: ParaId) {
		// #[cfg(any(test, feature = "runtime-benchmarks"))]
		RelevantMessagingState::<T>::put(MessagingStateSnapshot {
			dmq_mqc_head: Default::default(),
			relay_dispatch_queue_remaining_capacity: Default::default(),
			ingress_channels: Default::default(),
			egress_channels: vec![(
				_target_parachain,
				cumulus_primitives_core::AbridgedHrmpChannel {
					max_capacity: 10,
					max_total_size: 10_000_000_u32,
					max_message_size: 10_000_000_u32,
					msg_count: 5,
					total_size: 5_000_000_u32,
					mqc_head: None,
				},
			)],
		})
	}

so maybe we could just do this hack in emulator like this:

                                                // open hrmp channel to para_id
						<Self as Parachain>::ParachainSystem::open_outbound_hrmp_channel_for_tests(para_id);

						// let _ = <Self as Parachain>::ParachainSystem::set_validation_data(
						// 	<Self as Chain>::RuntimeOrigin::none(),
						// 	<Self as NetworkComponent>::Network::hrmp_channel_parachain_inherent_data(
						// 		para_id.into(),
						// 		relay_block_number,
						// 	),
						// );
						// set `AnnouncedHrmpMessagesPerCandidate`

and we dont need to handle block creation or other stuff,

I will take a try next week

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I5-tests Tests need fixing, improving or augmenting.
Projects
None yet
Development

No branches or pull requests

2 participants