From 09309485802c8f2ca4d8df78512d9dcea1ceeacb Mon Sep 17 00:00:00 2001 From: Guillaume Thiolliere Date: Mon, 20 Sep 2021 16:49:04 +0200 Subject: [PATCH] add feature and fix ci (#9800) --- substrate/.gitlab-ci.yml | 2 +- substrate/frame/support/test/Cargo.toml | 2 ++ substrate/frame/support/test/tests/construct_runtime_ui.rs | 1 + substrate/frame/support/test/tests/decl_module_ui.rs | 1 + substrate/frame/support/test/tests/decl_storage_ui.rs | 1 + substrate/frame/support/test/tests/derive_no_bound_ui.rs | 1 + substrate/frame/support/test/tests/pallet_ui.rs | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/substrate/.gitlab-ci.yml b/substrate/.gitlab-ci.yml index 70a8fd9bbb..fd7bfe7155 100644 --- a/substrate/.gitlab-ci.yml +++ b/substrate/.gitlab-ci.yml @@ -516,7 +516,7 @@ test-wasmer-sandbox: variables: <<: *default-vars script: - - time cargo test --release --features runtime-benchmarks,wasmer-sandbox + - time cargo test --release --features runtime-benchmarks,wasmer-sandbox,disable-ui-tests - sccache -s cargo-check-macos: diff --git a/substrate/frame/support/test/Cargo.toml b/substrate/frame/support/test/Cargo.toml index e12880871e..863afceac4 100644 --- a/substrate/frame/support/test/Cargo.toml +++ b/substrate/frame/support/test/Cargo.toml @@ -48,3 +48,5 @@ try-runtime = ["frame-support/try-runtime"] # WARNING: CI only execute pallet test with this feature, # if the feature intended to be used outside, CI and this message need to be updated. conditional-storage = [] +# Disable ui tests +disable-ui-tests = [] diff --git a/substrate/frame/support/test/tests/construct_runtime_ui.rs b/substrate/frame/support/test/tests/construct_runtime_ui.rs index a55e800628..ee475e3760 100644 --- a/substrate/frame/support/test/tests/construct_runtime_ui.rs +++ b/substrate/frame/support/test/tests/construct_runtime_ui.rs @@ -18,6 +18,7 @@ use std::env; #[rustversion::attr(not(stable), ignore)] +#[cfg(not(feature = "disable-ui-tests"))] #[test] fn ui() { // As trybuild is using `cargo check`, we don't need the real WASM binaries. diff --git a/substrate/frame/support/test/tests/decl_module_ui.rs b/substrate/frame/support/test/tests/decl_module_ui.rs index 2c097bb6e1..e84025b9f2 100644 --- a/substrate/frame/support/test/tests/decl_module_ui.rs +++ b/substrate/frame/support/test/tests/decl_module_ui.rs @@ -16,6 +16,7 @@ // limitations under the License. #[rustversion::attr(not(stable), ignore)] +#[cfg(not(feature = "disable-ui-tests"))] #[test] fn decl_module_ui() { // As trybuild is using `cargo check`, we don't need the real WASM binaries. diff --git a/substrate/frame/support/test/tests/decl_storage_ui.rs b/substrate/frame/support/test/tests/decl_storage_ui.rs index 99d2da87ac..400ddfc0f9 100644 --- a/substrate/frame/support/test/tests/decl_storage_ui.rs +++ b/substrate/frame/support/test/tests/decl_storage_ui.rs @@ -16,6 +16,7 @@ // limitations under the License. #[rustversion::attr(not(stable), ignore)] +#[cfg(not(feature = "disable-ui-tests"))] #[test] fn decl_storage_ui() { // As trybuild is using `cargo check`, we don't need the real WASM binaries. diff --git a/substrate/frame/support/test/tests/derive_no_bound_ui.rs b/substrate/frame/support/test/tests/derive_no_bound_ui.rs index 434671e19b..22c116931a 100644 --- a/substrate/frame/support/test/tests/derive_no_bound_ui.rs +++ b/substrate/frame/support/test/tests/derive_no_bound_ui.rs @@ -16,6 +16,7 @@ // limitations under the License. #[rustversion::attr(not(stable), ignore)] +#[cfg(not(feature = "disable-ui-tests"))] #[test] fn derive_no_bound_ui() { // As trybuild is using `cargo check`, we don't need the real WASM binaries. diff --git a/substrate/frame/support/test/tests/pallet_ui.rs b/substrate/frame/support/test/tests/pallet_ui.rs index e5f4a54dfb..6f56c1efd6 100644 --- a/substrate/frame/support/test/tests/pallet_ui.rs +++ b/substrate/frame/support/test/tests/pallet_ui.rs @@ -16,6 +16,7 @@ // limitations under the License. #[rustversion::attr(not(stable), ignore)] +#[cfg(not(feature = "disable-ui-tests"))] #[test] fn pallet_ui() { // As trybuild is using `cargo check`, we don't need the real WASM binaries.