Repository navigation
Add first integration tests for metrics tool - #222
Merged
Merged
Conversation
0xB10C
force-pushed
the
2025-08-first-steps-intregration-test
branch
2 times, most recently
from
August 13, 2025 15:35
6a66532 to
1facbc3
Compare
0xB10C
marked this pull request as ready for review
August 13, 2025 15:46
0xB10C
commented
Aug 13, 2025
0xB10C
force-pushed
the
2025-08-first-steps-intregration-test
branch
from
August 13, 2025 21:32
1facbc3 to
ec0eacf
Compare
Collaborator
Author
|
This might not work as is: The metrics are registered as static and we share state between all test cases. There is no way of resetting it. An alternative is a custom registry, but then we'd need to manually define an register the metrics. A macro can probably help out here.. |
Collaborator
Author
done that |
0xB10C
force-pushed
the
2025-08-first-steps-intregration-test
branch
2 times, most recently
from
August 15, 2025 12:16
77ffcb4 to
315182a
Compare
Collaborator
Author
|
I'm a bit puzzled about the CI failure in the Ubuntu job. It seems to be only happening sometimes. The |
0xB10C
added a commit
that referenced
this pull request
Aug 16, 2025
Remove the metric from connectivity-check, because it's currently unused, the docs are wrong, and probably not needed at all. Also, the CI in #222 (comment) seems to be having problems due to this. Possibly only found by a newer rust version on Ubuntu.
0xB10C
added a commit
that referenced
this pull request
Aug 16, 2025
Remove the metric from connectivity-check, because it's currently unused, the docs are wrong, and probably not needed at all. Also, the CI in #222 (comment) seems to be having problems due to this. Possibly only found by a newer rust version on Ubuntu.
Collaborator
Author
|
removed this in #223 |
0xB10C
added a commit
that referenced
this pull request
Aug 16, 2025
Remove the metric from connectivity-check, because it's currently unused, the docs are wrong, and probably not needed at all. Also, the CI in #222 (comment) seems to be having problems due to this. Possibly only found by a newer rust version on Ubuntu.
by splitting up main.rs into lib.rs and adding a run() fn
these shouldn't have been there in the first place
gets rid of all unwraps() and expects()
This allows us to run multiple metrics::run() in paralell. Initializing multiple loggers at the same time is not possible.
This addresses #192 for the metrics tool and allows us to use a select pattern for stopping the metrics tool early in the integration tests.
0xB10C
force-pushed
the
2025-08-first-steps-intregration-test
branch
from
August 16, 2025 11:57
af2cf39 to
921c0d0
Compare
0xB10C
commented
Aug 17, 2025
this is useful for integration test. Allows stopping the tool when done. Currently not used via main.rs
This is part of #26
Static metrics don't work in integration tests since multiple tests change the same metrics. This causes undesirable state between tests. Rather, have a Metrics struct with metrics that each metrics tool instance creates for itself.
implements test cases for all metrics under the handle_p2p_message() function
It's spammy and hasn't been useful yet.
0xB10C
force-pushed
the
2025-08-first-steps-intregration-test
branch
from
August 17, 2025 20:42
921c0d0 to
b32adb7
Compare
This was referenced Aug 18, 2025
edge-smith3tb
added a commit
to edge-smith3tb/peer-observer
that referenced
this pull request
Sep 30, 2025
Remove the metric from connectivity-check, because it's currently unused, the docs are wrong, and probably not needed at all. Also, the CI in peer-observer/peer-observer#222 (comment) seems to be having problems due to this. Possibly only found by a newer rust version on Ubuntu.
forge-dev480lo
added a commit
to forge-dev480lo/peer-observer
that referenced
this pull request
Dec 13, 2025
Remove the metric from connectivity-check, because it's currently unused, the docs are wrong, and probably not needed at all. Also, the CI in peer-observer/peer-observer#222 (comment) seems to be having problems due to this. Possibly only found by a newer rust version on Ubuntu.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The integration tests start a
nats-server(needs to be provided withNATS_SERVER_BINARY) for each test on a random port and check that publishing an event into NATS results in the metrics being set to a certain value.$ cargo test --features nats_integration_testsAs a drive-by, this resolves (partially) #192 for the
metricstool.Part of #26