Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,22 +193,13 @@ test-linux-stable: &test-linux
variables:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: -Cdebug-assertions=y
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
except:
variables:
- $DEPLOY_TAG
script:
- WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked |&
tee output.log
- WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked
- sccache -s
- echo "____Test job successful, checking for warnings____"
- awk '/^warning:/,/^$/ { print }' output.log > ${CI_COMMIT_SHORT_SHA}_warnings.log
- if [ -s ${CI_COMMIT_SHORT_SHA}_warnings.log ]; then
cat ${CI_COMMIT_SHORT_SHA}_warnings.log;
exit 1;
else
echo "___No warnings___";
fi

test-dependency-rules:
stage: test
Expand Down
2 changes: 0 additions & 2 deletions primitives/api/test/tests/ui/declaring_old_block.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use sp_runtime::traits::Block as BlockT;

sp_api::decl_runtime_apis! {
pub trait Api<Block: BlockT> {
fn test();
Expand Down
16 changes: 4 additions & 12 deletions primitives/api/test/tests/ui/declaring_old_block.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro! If you try to use a different trait than the substrate `Block` trait, please rename it locally.
--> $DIR/declaring_old_block.rs:4:23
--> $DIR/declaring_old_block.rs:2:23
|
4 | pub trait Api<Block: BlockT> {
2 | pub trait Api<Block: BlockT> {
| ^^^^^^

error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro!
--> $DIR/declaring_old_block.rs:4:16
--> $DIR/declaring_old_block.rs:2:16
|
4 | pub trait Api<Block: BlockT> {
2 | pub trait Api<Block: BlockT> {
| ^^^^^

warning: unused import: `sp_runtime::traits::Block as BlockT`
--> $DIR/declaring_old_block.rs:1:5
|
1 | use sp_runtime::traits::Block as BlockT;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use sp_runtime::traits::Block as BlockT;

sp_api::decl_runtime_apis! {
pub trait Api<B: BlockT> {
fn test();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
error: `Block: BlockT` generic parameter will be added automatically by the `decl_runtime_apis!` macro! If you try to use a different trait than the substrate `Block` trait, please rename it locally.
--> $DIR/declaring_own_block_with_different_name.rs:4:19
--> $DIR/declaring_own_block_with_different_name.rs:2:19
|
4 | pub trait Api<B: BlockT> {
2 | pub trait Api<B: BlockT> {
| ^^^^^^

warning: unused import: `sp_runtime::traits::Block as BlockT`
--> $DIR/declaring_own_block_with_different_name.rs:1:5
|
1 | use sp_runtime::traits::Block as BlockT;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ sp_api::decl_runtime_apis! {
}

mod second {
use super::*;

sp_api::decl_runtime_apis! {
pub trait Api {
fn test2(data: u64);
Expand Down
12 changes: 2 additions & 10 deletions primitives/api/test/tests/ui/impl_two_traits_with_same_name.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
error: Two traits with the same name detected! The trait name is used to generate its ID. Please rename one trait at the declaration!
--> $DIR/impl_two_traits_with_same_name.rs:32:15
--> $DIR/impl_two_traits_with_same_name.rs:30:15
|
32 | impl second::Api<Block> for Runtime {
30 | impl second::Api<Block> for Runtime {
| ^^^

warning: unused import: `super::*`
--> $DIR/impl_two_traits_with_same_name.rs:18:6
|
18 | use super::*;
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
2 changes: 0 additions & 2 deletions primitives/api/test/tests/ui/mock_only_one_block_type.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use substrate_test_runtime_client::runtime::Block;

struct Block2;

sp_api::decl_runtime_apis! {
Expand Down
16 changes: 4 additions & 12 deletions primitives/api/test/tests/ui/mock_only_one_block_type.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
error: Block type should be the same between all runtime apis.
--> $DIR/mock_only_one_block_type.rs:22:12
--> $DIR/mock_only_one_block_type.rs:20:12
|
22 | impl Api2<Block2> for MockApi {
20 | impl Api2<Block2> for MockApi {
| ^^^^^^

error: First block type found here
--> $DIR/mock_only_one_block_type.rs:18:11
--> $DIR/mock_only_one_block_type.rs:16:11
|
18 | impl Api<Block> for MockApi {
16 | impl Api<Block> for MockApi {
| ^^^^^

warning: unused import: `substrate_test_runtime_client::runtime::Block`
--> $DIR/mock_only_one_block_type.rs:1:5
|
1 | use substrate_test_runtime_client::runtime::Block;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
2 changes: 0 additions & 2 deletions primitives/api/test/tests/ui/mock_only_one_self_type.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use substrate_test_runtime_client::runtime::Block;

sp_api::decl_runtime_apis! {
pub trait Api {
fn test(data: u64);
Expand Down
16 changes: 4 additions & 12 deletions primitives/api/test/tests/ui/mock_only_one_self_type.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
error: Self type should not change between runtime apis
--> $DIR/mock_only_one_self_type.rs:21:23
--> $DIR/mock_only_one_self_type.rs:19:23
|
21 | impl Api2<Block> for MockApi2 {
19 | impl Api2<Block> for MockApi2 {
| ^^^^^^^^

error: First self type found here
--> $DIR/mock_only_one_self_type.rs:17:22
--> $DIR/mock_only_one_self_type.rs:15:22
|
17 | impl Api<Block> for MockApi {
15 | impl Api<Block> for MockApi {
| ^^^^^^^

warning: unused import: `substrate_test_runtime_client::runtime::Block`
--> $DIR/mock_only_one_self_type.rs:1:5
|
1 | use substrate_test_runtime_client::runtime::Block;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default