Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code coverage script #74

Merged
merged 4 commits into from
May 30, 2024
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
8 changes: 4 additions & 4 deletions code-coverage.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test
grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/coverage/html
rm *.profraw
CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test --manifest-path=./stellar_rust_sdk/Cargo.toml
grcov . --binary-path ./stellar_rust_sdk/target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o ./stellar_rust_sdk/target/coverage/html
rm ./stellar_rust_sdk/*.profraw
# open the coverage report in the browser
xdg-open target/coverage/html/index.html
xdg-open ./stellar_rust_sdk/target/coverage/html/index.html
5 changes: 2 additions & 3 deletions stellar_rust_sdk/src/order_book/details_request.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::{models::Request};

use crate::models::Request;
pub struct SellingAsset(AssetType);
pub struct NoSellingAsset;
pub struct BuyingAsset(AssetType);
Expand Down Expand Up @@ -157,7 +156,7 @@ impl Request for DetailsRequest<SellingAsset, BuyingAsset> {

mod tests {
use crate::models::Request;
use crate::order_book::prelude::{Asset, AssetType, DetailsRequest};
use super::{Asset, AssetType, DetailsRequest};

#[test]
fn test_details_request() {
Expand Down
6 changes: 3 additions & 3 deletions stellar_rust_sdk/src/order_book/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ pub mod tests {

#[tokio::test]
async fn get_order_bookdetails() {
const BIDS_N: &u32 = &250000;
const BIDS_D: &u32 = &21749;
const BIDS_PRICE: &str = "11.4947814";
const BIDS_N: &u32 = &1000;
const BIDS_D: &u32 = &87;
const BIDS_PRICE: &str = "11.4942529";
const BIDS_AMOUNT: &str = "2556626.8467920";

const ASKS_N: &u32 = &2299;
Expand Down