test(nat): Remove unnecessary "tests" submodules#1455
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies NAT unit test module structure by removing redundant nested tests submodules and moving test helpers/tests to the module root (guarded by cfg(test)), improving readability and making cross-module test helper reuse more straightforward.
Changes:
- Flatten
nat/src/stateless/test.rsby removing the innertestsmodule and using#![cfg(test)]at the module level. - Flatten
nat/src/stateful/test.rssimilarly and update imports to the new stateless test helper path. - Minor comment cleanup / rustfmt-driven formatting changes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| nat/src/stateless/test.rs | Removes nested tests module; exposes helpers/tests at module root under cfg(test) and keeps shared helper build_gwconfig_from_overlay accessible to other test modules. |
| nat/src/stateful/test.rs | Removes nested tests module; updates references to stateless test helper and reflows test helper functions/tests at module root under cfg(test). |
The whole files are already test submodules, no need to embed the tests into some yet more deeply-nested "tests" submodules. Note: There's no other change in the commit apart from automatic re-formatting (and a comment clean-up); this commit is best reviewed with the option for ignoring whitespace changes, "-w" in git. Signed-off-by: Quentin Monnet <qmo@qmon.net>
4620d7b to
5788a7d
Compare
mvachhar
approved these changes
Apr 13, 2026
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 whole files are already test submodules, no need to embed the tests into some yet more deeply-nested "tests" submodules.
Note: There's no other change in the commit apart from automatic re-formatting (and a comment clean-up); this commit is best reviewed with the option for ignoring whitespace changes, "-w" in git.
Moved out of #1419 because it doesn't really belong in there, and it's a pain to rebase every time we edit NAT tests.