From 96ba588fbaf94c7f0249e61e9810d9534a42a4c5 Mon Sep 17 00:00:00 2001 From: Pedro Nauck Date: Thu, 29 Aug 2024 20:46:04 -0300 Subject: [PATCH] test(repo): fix wasm error on coverage --- .github/workflows/ci.yaml | 3 ++- Cargo.lock | 1 - Cargo.toml | 21 +++++++++++++-------- Makefile | 5 ++++- tarpaulin.toml | 39 +++++++++++++++++---------------------- 5 files changed, 36 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 847b60e9..bfc39143 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,6 +16,7 @@ env: CARGO_TERM_COLOR: always CLICOLOR: 1 RUST_NIGHTLY_VERSION: nightly-2024-07-28 + RUST_NIGHTLY_COV: nightly-2024-06-05 CI: true concurrency: @@ -222,7 +223,7 @@ jobs: - name: Install Rust uses: ./.github/actions/setup-rust with: - toolchain: ${{ env.RUST_NIGHTLY_VERSION }} + toolchain: ${{ env.RUST_NIGHTLY_COV }} target: x86_64-unknown-linux-gnu,wasm32-unknown-unknown cache: false diff --git a/Cargo.lock b/Cargo.lock index 6e10e012..299de3c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2314,7 +2314,6 @@ dependencies = [ "clap 4.5.16", "const_format", "dirs", - "dotenvy", "fuel-core", "fuel-core-chain-config", "fuel-core-poa", diff --git a/Cargo.toml b/Cargo.toml index ec511826..c5f9a799 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,13 +23,18 @@ clap = { version = "4.5", features = ["derive", "env"] } dotenvy = "0.15" displaydoc = "0.2.5" futures = "0.3" -fuel-core-bin = { version = "0.34", features = ["p2p", "relayer", "rocksdb"] } -fuel-core = { version = "0.34", features = ["p2p", "relayer", "rocksdb"] } -fuel-core-client = { version = "0.34" } -fuel-core-importer = { version = "0.34" } -fuel-core-storage = { version = "0.34" } -fuel-core-types = { version = "0.34", features = ["test-helpers", "serde"] } -fuel-core-services = "0.34" +fuel-core-bin = { version = "0.34", default-features = false, features = [ + "p2p", + "relayer", + "rocksdb", +] } +fuel-core = { version = "0.34", default-features = false, features = ["p2p", "relayer", "rocksdb"] } +fuel-core-importer = { version = "0.34", default-features = false } +fuel-core-storage = { version = "0.34", default-features = false } +fuel-core-types = { version = "0.34", default-features = false, features = [ + "test-helpers", + "serde", +] } futures-util = "0.3.30" pretty_assertions = "1.4.0" rand = "0.8" @@ -50,7 +55,7 @@ subject-derive = { version = "0.0.6", path = "crates/fuel-streams-macros/subject # Workspace projects [workspace.metadata.cargo-machete] -ignored = ["fuel-core", "tokio"] +ignored = ["tokio"] [profile.release] opt-level = 3 diff --git a/Makefile b/Makefile index 4e1f9589..ce8b69c7 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ PACKAGE ?= fuel-streams-publisher DOCKER_PROFILE ?= all RUST_NIGHTLY_VERSION ?= nightly-2024-07-28 +RUST_NIGHTLY_COV ?= nightly-2024-06-05 .PHONY: all build clean lint fmt help setup start stop restart clean/docker start/nats stop/nats restart/nats clean/nats start/fuel-core stop/fuel-core restart/fuel-core clean/fuel-core dev-watch fmt-cargo fmt-rust fmt-markdown fmt-yaml check lint-cargo lint-rust lint-clippy lint-markdown audit audit-fix-test audit-fix test doc bench @@ -98,7 +99,9 @@ lint-markdown: # ------------------------------------------------------------ coverage: - RUSTFLAGS="-Z threads=8" cargo +$(RUST_NIGHTLY_VERSION) tarpaulin --config ./tarpaulin.toml + cargo +$(RUST_NIGHTLY_COV) tarpaulin \ + --config ./tarpaulin.toml \ + --rustflags="-Z threads=8" # ------------------------------------------------------------ # Audit crates diff --git a/tarpaulin.toml b/tarpaulin.toml index 1bc0cf6d..99bc62e6 100644 --- a/tarpaulin.toml +++ b/tarpaulin.toml @@ -2,7 +2,7 @@ name = "Fuel Data Parser Coverage Analysis" packages = ["fuel-data-parser"] all-features = true -run-types = ["Lib", "Tests"] +run-types = ["Lib", "Tests", "Doctests"] timeout = "120s" color = "Always" locked = true @@ -18,7 +18,7 @@ engine = "Llvm" name = "Fuel Streams Coverage Analysis" packages = ["fuel-streams"] all-features = true -run-types = ["Lib", "Tests"] +run-types = ["Lib", "Tests", "Doctests"] timeout = "120s" color = "Always" locked = true @@ -34,7 +34,7 @@ engine = "Llvm" name = "Fuel Streams Core Coverage Analysis" packages = ["fuel-streams-core"] all-features = true -run-types = ["Lib", "Tests"] +run-types = ["Lib", "Tests", "Doctests"] timeout = "120s" color = "Always" locked = true @@ -50,7 +50,7 @@ engine = "Llvm" name = "Fuel Streams Macros Coverage Analysis" packages = ["fuel-streams-macros"] all-features = true -run-types = ["Lib", "Tests"] +run-types = ["Lib", "Tests", "Doctests"] timeout = "120s" color = "Always" locked = true @@ -62,24 +62,19 @@ engine = "Llvm" #fail-under = 80 # ========================================== -# ignore due to wasm incompatibility -# [cov_fuel_streams_publisher] -# name = "Fuel Streams Publisher Coverage Analysis" -# packages = [ -# "fuel-streams-publisher" -# ] -# all-features = true -# run-types = [ -# "Tests" -# ] -# timeout = "120s" -# color = "Always" -# locked = true -# count = true -# no-dead-code = true -# fail-immediately = true -# skip-clean = true -# engine = "Llvm" +[cov_fuel_streams_publisher] +name = "Fuel Streams Publisher Coverage Analysis" +packages = ["fuel-streams-publisher"] +all-features = true +run-types = ["Tests"] +timeout = "120s" +color = "Always" +locked = true +count = true +no-dead-code = true +fail-immediately = true +skip-clean = true +engine = "Llvm" #fail-under = 80 # ==========================================