Repository: ergoplatform/sigma-rust (language: rust)

Issue:
fix 19.4% drop in test coverage after switching to new CI job
at https://github.com/ergoplatform/sigma-rust/commit/ce02ad15c70897bc695030a0f653f6eeb9f8549d


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 634878ec9..46567a2e5 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -70,7 +70,7 @@ jobs:
         uses:                   actions/checkout@v2
       - name:                   Generate code coverage
         run: |
-          cargo tarpaulin --verbose --all-features --workspace --timeout=360 --out Lcov --exclude-files bindings/* ergo-rest/src/reqwest.rs ergo-rest/src/reqwest/* ergo-rest/src/wasm_timer.rs ergo-rest/src/wasm_timer/*
+          cargo tarpaulin --avoid-cfg-tarpaulin --timeout=360 -v --out Lcov --exclude-files 'bindings/**/*.*' --exclude-files 'ergo-rest/src/reqwest.rs' --exclude-files 'ergo-rest/src/reqwest/**/*.*' --exclude-files 'ergo-rest/src/wasm_timer.rs' --exclude-files 'ergo-rest/src/wasm_timer/**/*.*'
       - name: Push code coverage results to coveralls.io
         uses: coverallsapp/github-action@master
         with:
diff --git a/bindings/ergo-lib-ios/Tests/ErgoLibTests/RestNodeApiTests.swift b/bindings/ergo-lib-ios/Tests/ErgoLibTests/RestNodeApiTests.swift
index c07acfa2c..da4787bfd 100644
--- a/bindings/ergo-lib-ios/Tests/ErgoLibTests/RestNodeApiTests.swift
+++ b/bindings/ergo-lib-ios/Tests/ErgoLibTests/RestNodeApiTests.swift
@@ -5,7 +5,7 @@ import XCTest
 final class RestNodeApiTests: XCTestCase {
     func testGetNipopowProofByHeaderIdNonAsync() throws {
         let expectation = self.expectation(description: "getNipopowByHeaderIdNonAsync")
-        let nodeConf = try NodeConf(withAddrString: "147.229.186.144:9053")
+        let nodeConf = try NodeConf(withAddrString: "213.239.193.208:9053")
         let restNodeApi = try RestNodeApi()
         let blockHeaders = try HeaderTests.generateBlockHeadersFromJSON()
         let _ = try restNodeApi.getNipopowProofByHeaderId(
@@ -26,7 +26,7 @@ final class RestNodeApiTests: XCTestCase {
     }
     
     func testGetNipopowProofByHeaderAbort() throws {
-        let nodeConf = try NodeConf(withAddrString: "147.229.186.144:9053")
+        let nodeConf = try NodeConf(withAddrString: "213.239.193.208:9053")
         let restNodeApi = try RestNodeApi()
         let blockHeaders = try HeaderTests.generateBlockHeadersFromJSON()
         let handle = try restNodeApi.getNipopowProofByHeaderId(
@@ -41,7 +41,7 @@ final class RestNodeApiTests: XCTestCase {
     }
     
     func testGetNipopowProofByHeaderIdAsync() async throws {
-        let nodeConf = try NodeConf(withAddrString: "147.229.186.144:9053")
+        let nodeConf = try NodeConf(withAddrString: "213.239.193.208:9053")
         let restNodeApi = try RestNodeApi()
         let blockHeaders = try HeaderTests.generateBlockHeadersFromJSON()
         let proof = try await restNodeApi.getNipopowProofByHeaderIdAsync(
@@ -110,7 +110,7 @@ final class RestNodeApiTests: XCTestCase {
                 return [proof]
             }
             group.addTask {
-                let proof = try await getNipopowProof(url: URL(string: "147.229.186.144:9053")!, headerId: headerId)!
+                let proof = try await getNipopowProof(url: URL(string: "213.239.193.208:9053")!, headerId: headerId)!
                 return [proof]
             }
             return try await group.reduce(into: [NipopowProof]()) { $0 += $1 }
diff --git a/ergo-rest/src/api/node.rs b/ergo-rest/src/api/node.rs
index 8af7792f5..730dd0bc1 100644
--- a/ergo-rest/src/api/node.rs
+++ b/ergo-rest/src/api/node.rs
@@ -187,7 +187,7 @@ mod tests {
             .build()
             .unwrap();
         let node_conf = NodeConf {
-            addr: PeerAddr::from_str("147.229.186.144:9053").unwrap(),
+            addr: PeerAddr::from_str("213.239.193.208:9053").unwrap(),
             api_key: None,
             timeout: Some(Duration::from_secs(5)),
         };
@@ -209,7 +209,7 @@ mod tests {
             .build()
             .unwrap();
         let node_conf = NodeConf {
-            addr: PeerAddr::from_str("147.229.186.144:9053").unwrap(),
+            addr: PeerAddr::from_str("213.239.193.208:9053").unwrap(),
             api_key: None,
             timeout: Some(Duration::from_secs(5)),
         };
diff --git a/ergo-rest/src/api/peer_discovery_internals/non_chrome.rs b/ergo-rest/src/api/peer_discovery_internals/non_chrome.rs
index b2631ccc3..e0ab5999e 100644
--- a/ergo-rest/src/api/peer_discovery_internals/non_chrome.rs
+++ b/ergo-rest/src/api/peer_discovery_internals/non_chrome.rs
@@ -432,7 +432,7 @@ mod tests {
             .build()
             .unwrap();
         let node_conf = NodeConf {
-            addr: PeerAddr::from_str("147.229.186.144:9053").unwrap(),
+            addr: PeerAddr::from_str("213.239.193.208:9053").unwrap(),
             api_key: None,
             timeout: Some(Duration::from_secs(5)),
         };


Test patch:
diff --git a/bindings/ergo-lib-wasm/tests_browser/test_rest_api.js b/bindings/ergo-lib-wasm/tests_browser/test_rest_api.js
index 71ec454e4..e11350ee6 100644
--- a/bindings/ergo-lib-wasm/tests_browser/test_rest_api.js
+++ b/bindings/ergo-lib-wasm/tests_browser/test_rest_api.js
@@ -38,7 +38,7 @@ it('node REST API: peer_discovery endpoint (INCREMENTAL VERSION)', async () => {
 });
 
 it('node REST API: get_nipopow_proof_by_header_id endpoint', async () => {
-    let node_conf = new ergo_wasm.NodeConf(new URL("http://147.229.186.144:9053")); //active_peers.get(0));
+    let node_conf = new ergo_wasm.NodeConf(new URL("http://213.239.193.208:9053")); //active_peers.get(0));
     assert(node_conf != null);
     const header_id = ergo_wasm.BlockId.from_str("4caa17e62fe66ba7bd69597afdc996ae35b1ff12e0ba90c22ff288a4de10e91b");
     let res = await ergo_wasm.get_nipopow_proof_by_header_id(node_conf, 3, 4, header_id);
@@ -55,7 +55,7 @@ it('node REST API: example SPV workflow', async () => {
     // Get NiPoPow proofs from 2 separate ergo nodes
     let proofs = await Promise.all([
         get_nipopow_proof(new URL("http://159.65.11.55:9053"), header_id),
-        get_nipopow_proof(new URL("http://147.229.186.144:9053"), header_id),
+        get_nipopow_proof(new URL("http://213.239.193.208:9053"), header_id),
     ]);
 
     const genesis_block_id = ergo_wasm.BlockId.from_str("b0244dfc267baca974a4caee06120321562784303a8a688976ae56170e4d175b");