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

run MG tests from new repo #1428

Merged
merged 4 commits into from
Feb 27, 2025

Conversation

plebhash
Copy link
Collaborator

@plebhash plebhash commented Jan 31, 2025

part of #1387, more specifically #1387 (comment)

most adaptations consisted of:

  • execution of llvm-cov was completely removed
  • relative paths had to be fixed

note: during #1298 we forgot to delete one MG test, so I'm doing it here

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 17.89%. Comparing base (28cccd8) to head (49cfdac).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1428      +/-   ##
==========================================
+ Coverage   17.28%   17.89%   +0.60%     
==========================================
  Files         139      132       -7     
  Lines       10422    10067     -355     
==========================================
  Hits         1801     1801              
+ Misses       8621     8266     -355     
Flag Coverage Δ
binary_codec_sv2-coverage 0.00% <ø> (ø)
binary_sv2-coverage 6.96% <ø> (ø)
bip32_derivation-coverage 0.00% <ø> (ø)
buffer_sv2-coverage 37.68% <ø> (+12.80%) ⬆️
codec_sv2-coverage 0.02% <ø> (ø)
common_messages_sv2-coverage 0.17% <ø> (ø)
const_sv2-coverage 0.00% <ø> (ø)
error_handling-coverage 0.00% <ø> (ø)
framing_sv2-coverage 0.37% <ø> (ø)
jd_client-coverage 0.42% <ø> (ø)
jd_server-coverage 13.07% <ø> (ø)
job_declaration_sv2-coverage 0.00% <ø> (ø)
key-utils-coverage 3.61% <ø> (+1.22%) ⬆️
mining-coverage 3.17% <ø> (ø)
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 0.82% <ø> (ø)
noise_sv2-coverage 5.79% <ø> (ø)
pool_sv2-coverage 2.47% <ø> (ø)
protocols 23.91% <ø> (ø)
roles 6.97% <ø> (ø)
roles_logic_sv2-coverage 11.59% <ø> (ø)
sv2_ffi-coverage 0.00% <ø> (ø)
template_distribution_sv2-coverage 0.00% <ø> (ø)
translator_sv2-coverage 9.58% <ø> (ø)
utils 36.39% <ø> (+11.35%) ⬆️
v1-coverage 3.11% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@plebhash plebhash force-pushed the mg-tests-from-new-repo branch 4 times, most recently from 9094877 to 7cf0cec Compare February 4, 2025 18:01
Copy link
Contributor

@Shourya742 Shourya742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor nits, we also an INTEROPERABILITY-TESTS.md, should we modify this in the same PR?

@@ -9,7 +9,7 @@
"frame_builders": [
{
"type": "automatic",
"message_id": "test/message-generator/messages/common_messages.json::setup_connection_job_declarator_with_no_async_flag"
"message_id": "../../test/message-generator/messages/common_messages.json::setup_connection_job_declarator_with_no_async_flag"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need to change the relative path... to me it looks like we are still doing the same stuff, only extra step added is cloning the message generator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the confusion, but unfortunately there's no easy answer for this.

it all started from the fact that most tests launch roles via cargo llvm-cov, which:

  • has no proper documentation on why or how it's used
  • breaks the paths when we use MG from the new repo

the best solution I could come up with was:

  • replace cargo llvm-cov with cargo run
  • adjust some relative paths on the JSON files

that allowed all tests to continue their execution in the same way as before

@plebhash plebhash force-pushed the mg-tests-from-new-repo branch 3 times, most recently from 6f91825 to 956fd31 Compare February 7, 2025 22:07
@plebhash
Copy link
Collaborator Author

plebhash commented Feb 7, 2025

we also an INTEROPERABILITY-TESTS.md, should we modify this in the same PR?

that's a good catch, thanks for pointing it out

I rebased the new repo to make sure this file is not removed from the git history there:
https://github.com/stratum-mining/stratum-message-generator/blob/main/INTEROPERABILITY-TESTS.md

also rebasing here to make sure we delete it from this repo

@plebhash plebhash force-pushed the mg-tests-from-new-repo branch from 956fd31 to 839241b Compare February 7, 2025 22:08
@plebhash plebhash force-pushed the mg-tests-from-new-repo branch 2 times, most recently from 1781478 to 41adec9 Compare February 19, 2025 02:31
@plebhash plebhash force-pushed the mg-tests-from-new-repo branch from 41adec9 to fa29a20 Compare February 25, 2025 22:36
@plebhash plebhash force-pushed the mg-tests-from-new-repo branch 2 times, most recently from b3c7cd8 to c309678 Compare February 27, 2025 14:43
@plebhash plebhash force-pushed the mg-tests-from-new-repo branch from c309678 to 6097cc5 Compare February 27, 2025 18:11
this test has been failing silently (!!!) for a long time
@plebhash
Copy link
Collaborator Author

plebhash commented Feb 27, 2025

while trying to get a green CI for merging this PR, I found some scary insights

interop-jd-translator MG test has been failing silently for a long time (!!!)

by looking at PRs recenlty merged, we can see in the logs:

STD ERR: error: no such command: `llvm-cov`
STD ERR: 
STD ERR: 	View all installed commands with `cargo --list`
STD ERR: 	Find a package to install `llvm-cov` with `cargo search cargo-llvm-cov`
STD ERR: error: no such command: `llvm-cov`
STD ERR: 
STD ERR: 	View all installed commands with `cargo --list`
STD ERR: 	Find a package to install `llvm-cov` with `cargo search cargo-llvm-cov`
STD ERR: error: no such command: `llvm-cov`
STD ERR: 
STD ERR: 	View all installed commands with `cargo --list`
STD ERR: 	Find a package to install `llvm-cov` with `cargo search cargo-llvm-cov`
STD ERR: error: no such command: `llvm-cov`
STD ERR: 
STD ERR: 	View all installed commands with `cargo --list`
STD ERR: 	Find a package to install `llvm-cov` with `cargo search cargo-llvm-cov`
STD ERR:     Finished `dev` profile [optimized + debuginfo] target(s) in 0.12s
STD ERR:      Running `target/debug/mining_device_sv1`
STD ERR: 
STD ERR: thread 'main' panicked at test-utils/mining-device-sv1/src/client.rs:76:62:
STD ERR: called `Result::unwrap()` on an `Err` value: Os { code: 111, kind: ConnectionRefused, message: "Connection refused" }
STD ERR: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
TEST OK

the CI proceeds as if the test was successful and we never notice it


on this PR, we are removing llvm-cov execution, which clears up this silent error and allows CI to actually fail (which was preventing me from merging this PR)

and then shows up something even worse: the jds-config.toml used for this MG test had no RPC configs, so the test would always fail with RPC error while launching JDS

I added a new commit to fix jds-config.toml on this PR 49cfdac

in the end, it's not a big deal since interop-jd-translator is about to be deprecated via #1354 (and it's not broken for deeper reasons, which would have been REALLY bad), but it is still scary to realize that we have been trusting MG CI for so long with this kind of silent problem

@plebhash plebhash merged commit 637ed1e into stratum-mining:main Feb 27, 2025
31 of 33 checks passed
@plebhash plebhash deleted the mg-tests-from-new-repo branch February 27, 2025 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants