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

Integration tests cleanup #1297

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jbesraa
Copy link
Contributor

@jbesraa jbesraa commented Dec 13, 2024

Resolves #1296 #1244 #1181 #1234

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 19.29%. Comparing base (bf68d8e) to head (0a81c0e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1297   +/-   ##
=======================================
  Coverage   19.29%   19.29%           
=======================================
  Files         164      164           
  Lines       10852    10852           
=======================================
  Hits         2094     2094           
  Misses       8758     8758           
Flag Coverage Δ
binary_codec_sv2-coverage 0.00% <ø> (ø)
binary_serde_sv2-coverage 3.65% <ø> (ø)
binary_sv2-coverage 5.48% <ø> (ø)
bip32_derivation-coverage 0.00% <ø> (ø)
buffer_sv2-coverage 25.02% <ø> (ø)
codec_sv2-coverage 0.01% <ø> (ø)
common_messages_sv2-coverage 0.13% <ø> (ø)
const_sv2-coverage 0.00% <ø> (ø)
error_handling-coverage 0.00% <ø> (ø)
framing_sv2-coverage 0.29% <ø> (ø)
jd_client-coverage 0.00% <ø> (ø)
jd_server-coverage 7.79% <ø> (ø)
job_declaration_sv2-coverage 0.00% <ø> (ø)
key-utils-coverage 2.39% <ø> (ø)
mining-coverage 2.51% <ø> (ø)
mining_device-coverage 0.00% <ø> (ø)
mining_proxy_sv2-coverage 0.70% <ø> (ø)
noise_sv2-coverage 4.35% <ø> (ø)
pool_sv2-coverage 1.38% <ø> (ø)
protocols 24.72% <ø> (ø)
roles 6.54% <ø> (ø)
roles_logic_sv2-coverage 8.08% <ø> (ø)
sv2_ffi-coverage 0.00% <ø> (ø)
template_distribution_sv2-coverage 0.00% <ø> (ø)
translator_sv2-coverage 9.60% <ø> (ø)
utils 25.13% <ø> (ø)
v1-coverage 2.47% <ø> (ø)

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.

Copy link
Contributor

github-actions bot commented Dec 13, 2024

🐰 Bencher Report

Branch2024-12-13-int-test-cleanup
Testbedsv2
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
client_sv2_handle_message_common📈 view plot
🚷 view threshold
44.84
(+0.76%)
46.59
(96.26%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
72.97
(-7.13%)
106.14
(68.75%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
14.65
(-0.03%)
14.71
(99.61%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
263.37
(-0.93%)
293.34
(89.78%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
604.82
(-1.27%)
649.75
(93.09%)
client_sv2_open_channel📈 view plot
🚷 view threshold
164.14
(-0.40%)
175.52
(93.52%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
290.83
(+2.16%)
309.54
(93.96%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
383.27
(-0.11%)
411.65
(93.11%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
159.21
(-0.50%)
171.47
(92.85%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
498.90
(+5.37%)
561.36
(88.87%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
1,033.10
(+3.66%)
1,090.08
(94.77%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Dec 13, 2024

🐰 Bencher Report

Branch2024-12-13-int-test-cleanup
Testbedsv2

🚨 2 Alerts

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
client_sv2_mining_message_submit_standard_serialize_deserializeL2 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
99.00
(+19.97%)
95.87
(103.26%)
client_sv2_open_channel_serialize_deserializeL2 Accesses
accesses
📈 plot
🚨 alert (🔔)
🚷 threshold
92.00
(+22.59%)
87.72
(104.87%)
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
estimated cycles
(Result Δ%)
Upper Boundary
estimated cycles
(Limit %)
InstructionsBenchmark Result
instructions
(Result Δ%)
Upper Boundary
instructions
(Limit %)
L1 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
L2 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
RAM AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
client_sv2_handle_message_common📈 view plot
🚷 view threshold
2,129.00
(+1.03%)
2,222.46
(95.79%)
📈 view plot
🚷 view threshold
473.00
(-0.06%)
489.01
(96.73%)
📈 view plot
🚷 view threshold
734.00
(-0.22%)
758.00
(96.83%)
📈 view plot
🚷 view threshold
6.00
(+16.01%)
13.14
(45.66%)
📈 view plot
🚷 view threshold
39.00
(+1.42%)
41.48
(94.02%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
8,322.00
(+1.27%)
8,371.81
(99.40%)
📈 view plot
🚷 view threshold
2,137.00
(-0.02%)
2,142.82
(99.73%)
📈 view plot
🚷 view threshold
3,152.00
(-0.25%)
3,171.13
(99.40%)
📈 view plot
🚷 view threshold
40.00
(+12.75%)
41.68
(95.98%)
📈 view plot
🚷 view threshold
142.00
(+1.83%)
143.69
(98.82%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
6,315.00
(+0.30%)
6,436.94
(98.11%)
📈 view plot
🚷 view threshold
1,750.00
(-0.05%)
1,767.25
(99.02%)
📈 view plot
🚷 view threshold
2,550.00
(-0.09%)
2,575.87
(99.00%)
📈 view plot
🚷 view threshold
18.00
(+5.49%)
24.38
(73.84%)
📈 view plot
🚷 view threshold
105.00
(+0.45%)
108.43
(96.83%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
14,794.00
(+0.47%)
14,939.72
(99.02%)
📈 view plot
🚷 view threshold
4,694.00
(-0.02%)
4,711.25
(99.63%)
📈 view plot
🚷 view threshold
6,744.00
(-0.20%)
6,786.03
(99.38%)
📈 view plot
🚷 view threshold
56.00
(+25.84%)
59.31
(94.42%)
📈 view plot
🚷 view threshold
222.00
(+0.32%)
226.66
(97.94%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
27,820.00
(+0.90%)
27,967.62
(99.47%)
📈 view plot
🚷 view threshold
10,645.00
(+0.43%)
10,677.82
(99.69%)
📈 view plot
🚷 view threshold
15,495.00
(+0.44%)
15,559.82
(99.58%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
99.00
(+19.97%)
95.87
(103.26%)
📈 view plot
🚷 view threshold
338.00
(+0.83%)
342.24
(98.76%)
client_sv2_open_channel📈 view plot
🚷 view threshold
4,447.00
(+1.38%)
4,541.25
(97.92%)
📈 view plot
🚷 view threshold
1,461.00
(-0.02%)
1,477.01
(98.92%)
📈 view plot
🚷 view threshold
2,157.00
(-0.16%)
2,183.64
(98.78%)
📈 view plot
🚷 view threshold
10.00
(+21.10%)
14.50
(68.98%)
📈 view plot
🚷 view threshold
64.00
(+2.54%)
66.83
(95.76%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
14,052.00
(+0.24%)
14,192.56
(99.01%)
📈 view plot
🚷 view threshold
5,064.00
(-0.01%)
5,080.01
(99.68%)
📈 view plot
🚷 view threshold
7,317.00
(-0.13%)
7,351.30
(99.53%)
📈 view plot
🚷 view threshold
45.00
(+26.29%)
46.14
(97.54%)
📈 view plot
🚷 view threshold
186.00
(-0.05%)
191.14
(97.31%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
22,852.00
(+0.77%)
22,972.65
(99.47%)
📈 view plot
🚷 view threshold
8,040.00
(+0.12%)
8,052.26
(99.85%)
📈 view plot
🚷 view threshold
11,682.00
(-0.00%)
11,710.42
(99.76%)
📈 view plot
🚨 view alert (🔔)
🚷 view threshold
92.00
(+22.59%)
87.72
(104.87%)
📈 view plot
🚷 view threshold
306.00
(+0.85%)
310.62
(98.51%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
4,677.00
(-0.19%)
4,783.44
(97.77%)
📈 view plot
🚷 view threshold
1,502.00
(-0.02%)
1,518.01
(98.95%)
📈 view plot
🚷 view threshold
2,277.00
(-0.05%)
2,299.50
(99.02%)
📈 view plot
🚷 view threshold
11.00
(+13.73%)
16.39
(67.11%)
📈 view plot
🚷 view threshold
67.00
(-0.61%)
69.99
(95.73%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
16,180.00
(+0.21%)
16,298.33
(99.27%)
📈 view plot
🚷 view threshold
5,963.00
(-0.00%)
5,979.01
(99.73%)
📈 view plot
🚷 view threshold
8,655.00
(-0.11%)
8,691.40
(99.58%)
📈 view plot
🚷 view threshold
49.00
(+22.50%)
54.14
(90.51%)
📈 view plot
🚷 view threshold
208.00
(-0.03%)
211.75
(98.23%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
35,786.00
(+0.59%)
35,870.68
(99.76%)
📈 view plot
🚷 view threshold
14,888.00
(+0.17%)
14,907.52
(99.87%)
📈 view plot
🚷 view threshold
21,866.00
(+0.13%)
21,905.62
(99.82%)
📈 view plot
🚷 view threshold
110.00
(+18.95%)
113.06
(97.29%)
📈 view plot
🚷 view threshold
382.00
(+0.71%)
384.91
(99.24%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Dec 13, 2024

🐰 Bencher Report

Branch2024-12-13-int-test-cleanup
Testbedsv1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
client-submit-serialize📈 view plot
🚷 view threshold
6,593.70
(-0.51%)
7,070.75
(93.25%)
client-submit-serialize-deserialize📈 view plot
🚷 view threshold
7,264.60
(-2.82%)
8,059.32
(90.14%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle📈 view plot
🚷 view threshold
7,998.60
(-1.81%)
9,434.30
(84.78%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle📈 view plot
🚷 view threshold
866.89
(+0.18%)
936.66
(92.55%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize📈 view plot
🚷 view threshold
675.14
(+0.41%)
716.20
(94.27%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize📈 view plot
🚷 view threshold
246.43
(-0.96%)
271.74
(90.69%)
client-sv1-get-authorize/client-sv1-get-authorize📈 view plot
🚷 view threshold
156.16
(-0.66%)
166.81
(93.62%)
client-sv1-get-submit📈 view plot
🚷 view threshold
6,384.60
(-0.54%)
7,015.98
(91.00%)
client-sv1-get-subscribe/client-sv1-get-subscribe📈 view plot
🚷 view threshold
280.21
(-0.62%)
319.32
(87.75%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle📈 view plot
🚷 view threshold
727.19
(+0.05%)
777.27
(93.56%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize📈 view plot
🚷 view threshold
591.81
(+0.75%)
614.60
(96.29%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize📈 view plot
🚷 view threshold
203.63
(-1.35%)
224.97
(90.51%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Dec 13, 2024

🐰 Bencher Report

Branch2024-12-13-int-test-cleanup
Testbedsv1
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
estimated cycles
(Result Δ%)
Upper Boundary
estimated cycles
(Limit %)
InstructionsBenchmark Result
instructions
(Result Δ%)
Upper Boundary
instructions
(Limit %)
L1 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
L2 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
RAM AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
get_authorize📈 view plot
🚷 view threshold
8,418.00
(-0.48%)
8,678.62
(97.00%)
📈 view plot
🚷 view threshold
3,663.00
(-1.97%)
3,863.81
(94.80%)
📈 view plot
🚷 view threshold
5,108.00
(-2.41%)
5,450.42
(93.72%)
📈 view plot
🚷 view threshold
11.00
(+40.66%)
15.29
(71.95%)
📈 view plot
🚷 view threshold
93.00
(+2.17%)
95.89
(96.98%)
get_submit📈 view plot
🚷 view threshold
95,324.00
(-0.07%)
95,754.35
(99.55%)
📈 view plot
🚷 view threshold
59,263.00
(-0.28%)
59,716.37
(99.24%)
📈 view plot
🚷 view threshold
85,074.00
(-0.33%)
85,831.36
(99.12%)
📈 view plot
🚷 view threshold
48.00
(+8.63%)
59.14
(81.16%)
📈 view plot
🚷 view threshold
286.00
(+1.96%)
290.43
(98.47%)
get_subscribe📈 view plot
🚷 view threshold
7,927.00
(-1.03%)
8,233.19
(96.28%)
📈 view plot
🚷 view threshold
2,758.00
(-2.32%)
2,942.22
(93.74%)
📈 view plot
🚷 view threshold
3,832.00
(-2.79%)
4,141.68
(92.52%)
📈 view plot
🚷 view threshold
14.00
(+17.97%)
19.52
(71.72%)
📈 view plot
🚷 view threshold
115.00
(+0.41%)
117.73
(97.68%)
serialize_authorize📈 view plot
🚷 view threshold
12,211.00
(-0.50%)
12,510.01
(97.61%)
📈 view plot
🚷 view threshold
5,240.00
(-1.30%)
5,428.62
(96.53%)
📈 view plot
🚷 view threshold
7,276.00
(-1.65%)
7,605.79
(95.66%)
📈 view plot
🚷 view threshold
14.00
(+44.98%)
18.26
(76.68%)
📈 view plot
🚷 view threshold
139.00
(+0.80%)
142.11
(97.81%)
serialize_deserialize_authorize📈 view plot
🚷 view threshold
24,640.00
(-0.28%)
25,181.65
(97.85%)
📈 view plot
🚷 view threshold
9,786.00
(-0.87%)
10,030.56
(97.56%)
📈 view plot
🚷 view threshold
13,785.00
(-1.07%)
14,198.15
(97.09%)
📈 view plot
🚷 view threshold
36.00
(+2.40%)
45.26
(79.54%)
📈 view plot
🚷 view threshold
305.00
(+0.70%)
313.50
(97.29%)
serialize_deserialize_handle_authorize📈 view plot
🚷 view threshold
30,257.00
(-0.24%)
30,709.09
(98.53%)
📈 view plot
🚷 view threshold
11,989.00
(-0.62%)
12,200.55
(98.27%)
📈 view plot
🚷 view threshold
16,952.00
(-0.76%)
17,309.21
(97.94%)
📈 view plot
🚷 view threshold
57.00
(+2.70%)
66.88
(85.23%)
📈 view plot
🚷 view threshold
372.00
(+0.38%)
379.51
(98.02%)
serialize_deserialize_handle_submit📈 view plot
🚷 view threshold
126,490.00
(+0.01%)
126,777.63
(99.77%)
📈 view plot
🚷 view threshold
73,117.00
(-0.20%)
73,525.72
(99.44%)
📈 view plot
🚷 view threshold
104,760.00
(-0.26%)
105,490.72
(99.31%)
📈 view plot
🚷 view threshold
111.00
(+4.97%)
124.01
(89.51%)
📈 view plot
🚷 view threshold
605.00
(+1.26%)
607.70
(99.56%)
serialize_deserialize_handle_subscribe📈 view plot
🚷 view threshold
27,875.00
(-0.07%)
28,452.81
(97.97%)
📈 view plot
🚷 view threshold
9,577.00
(-0.66%)
9,755.38
(98.17%)
📈 view plot
🚷 view threshold
13,515.00
(-0.85%)
13,829.54
(97.73%)
📈 view plot
🚷 view threshold
72.00
(+12.96%)
76.46
(94.17%)
📈 view plot
🚷 view threshold
400.00
(+0.40%)
412.23
(97.03%)
serialize_deserialize_submit📈 view plot
🚷 view threshold
115,219.00
(-0.03%)
115,729.06
(99.56%)
📈 view plot
🚷 view threshold
67,894.00
(-0.27%)
68,421.71
(99.23%)
📈 view plot
🚷 view threshold
97,354.00
(-0.34%)
98,288.31
(99.05%)
📈 view plot
🚷 view threshold
73.00
(+14.62%)
83.85
(87.06%)
📈 view plot
🚷 view threshold
500.00
(+1.48%)
501.29
(99.74%)
serialize_deserialize_subscribe📈 view plot
🚷 view threshold
23,252.00
(-0.25%)
23,857.67
(97.46%)
📈 view plot
🚷 view threshold
8,129.00
(-0.81%)
8,312.32
(97.79%)
📈 view plot
🚷 view threshold
11,422.00
(-1.01%)
11,738.38
(97.30%)
📈 view plot
🚷 view threshold
42.00
(+10.66%)
48.38
(86.81%)
📈 view plot
🚷 view threshold
332.00
(+0.33%)
343.90
(96.54%)
serialize_submit📈 view plot
🚷 view threshold
99,789.00
(-0.03%)
100,193.45
(99.60%)
📈 view plot
🚷 view threshold
61,325.00
(-0.25%)
61,743.05
(99.32%)
📈 view plot
🚷 view threshold
87,929.00
(-0.31%)
88,659.89
(99.18%)
📈 view plot
🚷 view threshold
55.00
(+17.16%)
64.72
(84.98%)
📈 view plot
🚷 view threshold
331.00
(+1.76%)
335.69
(98.60%)
serialize_subscribe📈 view plot
🚷 view threshold
11,410.00
(+0.02%)
11,612.54
(98.26%)
📈 view plot
🚷 view threshold
4,111.00
(-1.46%)
4,282.62
(95.99%)
📈 view plot
🚷 view threshold
5,690.00
(-1.89%)
5,994.49
(94.92%)
📈 view plot
🚷 view threshold
17.00
(+29.52%)
22.01
(77.25%)
📈 view plot
🚷 view threshold
161.00
(+1.67%)
163.52
(98.46%)
🐰 View full continuous benchmarking report in Bencher

@@ -343,13 +344,14 @@ pub async fn start_jdc(
std::time::Duration::from_secs(cert_validity_sec),
);
let ret = jd_client::JobDeclaratorClient::new(jd_client_proxy);
tokio::spawn(async move { ret.start().await });
let ret_clone = ret.clone();
Copy link
Contributor

Choose a reason for hiding this comment

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

This ret can be changed to job_declarator_client

@@ -54,6 +54,7 @@ pub static IS_NEW_TEMPLATE_HANDLED: AtomicBool = AtomicBool::new(true);
/// switching to backup Pools in case of declared custom jobs refused by JDS (which is Pool side).
/// As a solution of last-resort, it is able to switch to Solo Mining until new safe Pools appear
/// in the market.
#[derive(Debug, Clone)]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don’t understand the need to make the configuration structure clonable. Why are we returning configuration objects downstream? While this approach does make all our starter APIs consistent, I don’t see any other benefit. Am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right that none of them is currently used beside the Sniffer. I think in the future some of those roles will have some functionality that we might need while testing, thats the main motivation for including them

@jbesraa jbesraa force-pushed the 2024-12-13-int-test-cleanup branch from 1f80f31 to 0a81c0e Compare December 18, 2024 11:42
@plebhash
Copy link
Collaborator

plebhash commented Dec 24, 2024

@jbesraa please see these commits and if they make sense, cherry-pick them into this PR:


with #1317 in mind, I forked this branch and added the following commits:

  • 38dd0b8 renaming the crate (now snake_case with *_sv2 suffix, following the most common pattern on SRI)
  • 0ec0951 making sniffer module externally public, so that other projects can use this crate as a dependency and import sniffer::Sniffer
  • 9ff8bfd adding a derive for Debug on TemplateProvider, which makes it easy to do some quick debugging

if we merge this PR including these commits we can close #1317


the following commit is a simple cleanup of confusing variable naming:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants