Skip to content

Commit

Permalink
ci: adm more sonar coverage params
Browse files Browse the repository at this point in the history
Signed-off-by: BAStos525 <[email protected]>
  • Loading branch information
BAStos525 committed Oct 25, 2024
1 parent bf05f88 commit 75d9ef7
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ jobs:
--all-features
--branch --no-report
- name: Generate lcov report
run: cargo llvm-cov report --text --output-path coverage.txt
run: cargo llvm-cov report --lcov --output-path lcov.info
- name: Upload lcov report
uses: actions/upload-artifact@v4
with:
name: report-coverage
path: coverage.txt
path: lcov.info
- name: Upload test network artifacts
if: failure() && (steps.test_no_features.outcome == 'failure' || steps.test_all_features.outcome == 'failure')
uses: actions/upload-artifact@v4
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/iroha2-dev-sonar-dojo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ jobs:
with:
args: >
-Dcommunity.rust.clippy.reportPaths=lints/clippy.json
-Dsonar.cfamily.llvm-cov.reportPath=lints/coverage.txt
-Dsonar.cfamily.gcov.reportsPath=lints/coverage.txt
-Dcommunity.rust.lcov.reportPaths=lints/lcov.info
-Dsonar.cfamily.llvm-cov.reportPath=lints/lcov.info
-Dsonar.cfamily.gcov.reportsPath=lints/lcov.info
-Dsonar.pullrequest.key=${{ github.event.workflow_run.pull_requests[0].number }}
-Dsonar.pullrequest.base=${{ github.event.workflow_run.pull_requests[0].base.ref }}
-Dsonar.pullrequest.branch=${{ github.event.workflow_run.pull_requests[0].head.ref }}
Expand Down
11 changes: 4 additions & 7 deletions crates/iroha/tests/extra_functional/multiple_blocks_created.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ use std::{num::NonZero, time::Duration};

use eyre::Result;
use futures_util::StreamExt;
use iroha::{
client::{self},
data_model::{
events::pipeline::{BlockEventFilter, TransactionEventFilter},
parameter::BlockParameter,
prelude::*,
},
use iroha::data_model::{
events::pipeline::{BlockEventFilter, TransactionEventFilter},
parameter::BlockParameter,
prelude::*,
};
use iroha_test_network::*;
use iroha_test_samples::gen_account_in;
Expand Down
5 changes: 1 addition & 4 deletions crates/iroha/tests/extra_functional/normal.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use eyre::Result;
use iroha::{
client,
data_model::{asset::AssetDefinitionId, parameter::BlockParameter, prelude::*},
};
use iroha::data_model::{asset::AssetDefinitionId, parameter::BlockParameter, prelude::*};
use iroha_test_network::*;
use nonzero_ext::nonzero;

Expand Down
1 change: 0 additions & 1 deletion crates/iroha/tests/extra_functional/offline_peers.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use eyre::{OptionExt, Result};
use futures_util::stream::{FuturesUnordered, StreamExt};
use iroha::{
client::{self},
crypto::KeyPair,
data_model::{
peer::{Peer as DataModelPeer, PeerId},
Expand Down
5 changes: 1 addition & 4 deletions crates/iroha/tests/extra_functional/restart_peer.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use eyre::Result;
use iroha::{
client::{self},
data_model::prelude::*,
};
use iroha::data_model::prelude::*;
use iroha_test_network::*;
use iroha_test_samples::ALICE_ID;
use tokio::{task::spawn_blocking, time::timeout};
Expand Down
1 change: 0 additions & 1 deletion crates/iroha/tests/extra_functional/unregister_peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::time::Duration;
use assert_matches::assert_matches;
use eyre::Result;
use iroha::{
client,
client::Client,
data_model::{parameter::BlockParameter, prelude::*},
};
Expand Down
2 changes: 1 addition & 1 deletion crates/iroha/tests/queries/account.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashSet;

use eyre::Result;
use iroha::{client, data_model::prelude::*};
use iroha::data_model::prelude::*;
use iroha_test_network::*;
use iroha_test_samples::{gen_account_in, ALICE_ID};

Expand Down
2 changes: 1 addition & 1 deletion crates/iroha/tests/queries/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use iroha::{
client::{self, QueryError},
client::QueryError,
data_model::{
prelude::*,
query::{error::QueryExecutionFail, parameters::MAX_FETCH_SIZE},
Expand Down
6 changes: 3 additions & 3 deletions crates/iroha/tests/queries/query_errors.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use iroha::{
client,
data_model::{prelude::QueryBuilderExt, query::builder::SingleQueryError},
use iroha::data_model::{
prelude::{FindAccounts, QueryBuilderExt},
query::builder::SingleQueryError,
};
use iroha_test_network::NetworkBuilder;
use iroha_test_samples::gen_account_in;
Expand Down
5 changes: 1 addition & 4 deletions crates/iroha/tests/queries/role.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
use std::collections::HashSet;

use eyre::Result;
use iroha::{
client,
data_model::{prelude::*, query::builder::SingleQueryError},
};
use iroha::data_model::{prelude::*, query::builder::SingleQueryError};
use iroha_executor_data_model::permission::account::CanModifyAccountMetadata;
use iroha_test_network::*;
use iroha_test_samples::ALICE_ID;
Expand Down
1 change: 0 additions & 1 deletion crates/iroha/tests/triggers/by_call_trigger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::{sync::mpsc, thread, time::Duration};
use executor_custom_data_model::mint_rose_args::MintRoseArgs;
use eyre::{eyre, Result, WrapErr};
use iroha::{
client::{self},
crypto::KeyPair,
data_model::{
prelude::*,
Expand Down
3 changes: 1 addition & 2 deletions crates/iroha/tests/triggers/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use assert_matches::assert_matches;
use iroha::{
client,
client::Client,
data_model::{
asset::{AssetId, AssetValue},
prelude::{Numeric, QueryBuilderExt},
prelude::{FindAssets, Numeric, QueryBuilderExt},
},
};

Expand Down
2 changes: 1 addition & 1 deletion crates/iroha/tests/triggers/time_trigger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::time::Duration;

use eyre::Result;
use iroha::{
client::{self, Client},
client::Client,
data_model::{
asset::AssetId,
events::pipeline::{BlockEventFilter, BlockStatus},
Expand Down
9 changes: 2 additions & 7 deletions crates/iroha/tests/triggers/trigger_rollback.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use eyre::Result;
use iroha::{
client,
data_model::{prelude::*, trigger::TriggerId},
};
use iroha::data_model::{prelude::*, trigger::TriggerId};
use iroha_test_network::*;
use iroha_test_samples::ALICE_ID;

Expand Down Expand Up @@ -36,9 +33,7 @@ fn failed_trigger_revert() -> Result<()> {
client.submit_blocking(call_trigger)?;

//Then
let query_result = client
.query(FindAssetsDefinitions::new())
.execute_all()?;
let query_result = client.query(FindAssetsDefinitions::new()).execute_all()?;
assert!(query_result
.iter()
.all(|asset_definition| asset_definition.id() != &asset_definition_id));
Expand Down

0 comments on commit 75d9ef7

Please sign in to comment.