Skip to content

test(nat): Remove unnecessary "tests" submodules#1455

Merged
qmonnet merged 1 commit intomainfrom
pr/qmonnet/test-submodules-nat
Apr 13, 2026
Merged

test(nat): Remove unnecessary "tests" submodules#1455
qmonnet merged 1 commit intomainfrom
pr/qmonnet/test-submodules-nat

Conversation

@qmonnet
Copy link
Copy Markdown
Member

@qmonnet qmonnet commented Apr 13, 2026

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.

@qmonnet qmonnet self-assigned this Apr 13, 2026
@qmonnet qmonnet requested a review from a team as a code owner April 13, 2026 11:01
@qmonnet qmonnet added the area/nat Related to Network Address Translation (NAT) label Apr 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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.rs by removing the inner tests module and using #![cfg(test)] at the module level.
  • Flatten nat/src/stateful/test.rs similarly 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).

Comment thread nat/src/stateless/test.rs Outdated
Comment thread nat/src/stateful/test.rs
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>
@qmonnet qmonnet force-pushed the pr/qmonnet/test-submodules-nat branch from 4620d7b to 5788a7d Compare April 13, 2026 11:50
@qmonnet qmonnet added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit 89fbf00 Apr 13, 2026
26 of 28 checks passed
@qmonnet qmonnet deleted the pr/qmonnet/test-submodules-nat branch April 13, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/nat Related to Network Address Translation (NAT)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants