-
Notifications
You must be signed in to change notification settings - Fork 743
[tmpnet] Ensure tmpnet methods always have a logger #3893
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
Merged
Merged
Conversation
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
1 task
e05a502
to
ed26001
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR embeds a logger in tmpnet.Network so that all tmpnet methods have consistent logging without requiring an explicit logger parameter in every call. Key changes include:
- Removing the logger parameter from method signatures in tmpnet and updating internal calls to use the network's logger field.
- Updating test files and helper functions to call the new method signatures and to pass a logger only during network initialization.
- Refactoring functions like ReadNetwork, StartNode, RestartNode, and StopNetwork to accommodate these changes.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/upgrade/upgrade_test.go | Updated StartNode call to remove logger argument. |
tests/fixture/tmpnet/tmpnetctl/main.go | Refactored StopNetwork call to create and pass a logger. |
tests/fixture/tmpnet/process_runtime.go | Refactored ProcessRuntime.Start to obtain the logger from the network field. |
tests/fixture/tmpnet/node.go | Removed logger parameter from Node.Start and updated interface accordingly. |
tests/fixture/tmpnet/network_test.go | Updated ReadNetwork call to pass a NoLog logger instance. |
tests/fixture/tmpnet/network.go | Integrated a logger into the Network struct and refactored all logger usage. |
tests/fixture/e2e/helpers.go | Updated StartNode invocation to align with the new signature. |
tests/fixture/e2e/env.go | Revised environment initialization to supply a logger where needed. |
tests/e2e/e2e_test.go | Adapted shared test environment initialization to use the new TestContext. |
qdm12
approved these changes
Apr 18, 2025
joshua-kim
approved these changes
Apr 18, 2025
Previously individual tmpnet methods accepted a log argument where needed. Adding a log field to `tmpnet.Network` ensures that methods will always have access to a logger without the caller having to provide it past network initialization.
ed26001
to
aa5189d
Compare
Rebased |
This was referenced Apr 28, 2025
This was referenced Apr 28, 2025
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.
PR Chain: tmpnet+kube
This PR chain enables tmpnet to deploy temporary networks to Kubernetes. Early PRs refactor tmpnet to support the addition in #3615 of a new tmpnet node runtime for kube.
Why this should be merged
Previously individual tmpnet methods accepted a log argument where needed. Adding a log field to
tmpnet.Network
ensures that methods will always have access to a logger without the caller having to provide it past network initialization.How this was tested
CI
Need to be documented in RELEASES.md?
N/A
TODO