pvf: use test-utils feature to export test only (#7538)

* pvf: use test-utils feature to export test only

* adding comment to test-utils feature

* make prepare-worker and execute-worker as optional dependencies and add comments to test-utils

* remove doc hidden from pvf testing

* add prepare worker and execute worker entrypoints to test-utils feature

* pvf: add sp_tracing as optional dependency of test-utils

* add test-utils for polkadot and malus

* add test-utils feature to prepare and execute workers script

* remove required features from prepare and executing

* Try to trigger CI again to fix broken jobs

---------

Co-authored-by: Marcin S <marcin@realemail.net>
This commit is contained in:
jserrat
2023-08-14 06:48:15 -03:00
committed by GitHub
parent 26adab4f7c
commit d4ad8d5e74
12 changed files with 52 additions and 21 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ pub mod worker;
pub use cpu_time::ProcessTime;
// Used by `decl_worker_main!`.
#[doc(hidden)]
#[cfg(feature = "test-utils")]
pub use sp_tracing;
const LOG_TARGET: &str = "parachain::pvf-common";
@@ -34,7 +34,7 @@ const LOG_TARGET: &str = "parachain::pvf-common";
use std::mem;
use tokio::io::{self, AsyncRead, AsyncReadExt as _, AsyncWrite, AsyncWriteExt as _};
#[doc(hidden)]
#[cfg(feature = "test-utils")]
pub mod tests {
use std::time::Duration;
+3 -3
View File
@@ -84,7 +84,7 @@ impl PvfPrepData {
}
/// Creates a structure for tests.
#[doc(hidden)]
#[cfg(feature = "test-utils")]
pub fn from_discriminator_and_timeout(num: u32, timeout: Duration) -> Self {
let descriminator_buf = num.to_le_bytes().to_vec();
Self::from_code(
@@ -96,13 +96,13 @@ impl PvfPrepData {
}
/// Creates a structure for tests.
#[doc(hidden)]
#[cfg(feature = "test-utils")]
pub fn from_discriminator(num: u32) -> Self {
Self::from_discriminator_and_timeout(num, crate::tests::TEST_PREPARATION_TIMEOUT)
}
/// Creates a structure for tests.
#[doc(hidden)]
#[cfg(feature = "test-utils")]
pub fn from_discriminator_precheck(num: u32) -> Self {
let mut pvf =
Self::from_discriminator_and_timeout(num, crate::tests::TEST_PREPARATION_TIMEOUT);