Skip to content

Conversation

@benoit-nexthop
Copy link
Contributor

@benoit-nexthop benoit-nexthop commented Nov 4, 2025

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

The fboss2 CLI has a number of unit tests, however none of them are being built/run in the OSS build. Turn the CLI into a library in the cmake build, just like how it’s done in the Buck build, and add a new cmake file for the unit tests that leverages this library.

Various unit tests were including nettools/common/TestUtils.h, which is not open source, however they generally didn’t need that header and only needed a header from thrift from the most part.

Some simple stubs were incomplete. The BGP server is taken out when building with IS_OSS. This change tries to keep the OSS build as close as possible to the internal build, with minimal usage of #ifdefs.

Test Plan

This PR is only enabling new existing unit tests in the OSS build.

@meta-cla meta-cla bot added the CLA Signed label Nov 4, 2025
@benoit-nexthop benoit-nexthop changed the title fboss2-config-test [Nexthop] enable fboss2 CLI tests in the OSS build Nov 4, 2025
@joseph5wu
Copy link
Contributor

@benoit-nexthop : can you add a new github action for running the fboss cli unit tests?

@benoit-nexthop
Copy link
Contributor Author

@benoit-nexthop : can you add a new github action for running the fboss cli unit tests?

I added a new workflow in .github/workflows/fboss2-cli.yml that builds and tests the CLI. I haven't tried it yet so I apologize in advance if it doesn't work.

@benoit-nexthop benoit-nexthop force-pushed the fboss2-config-test branch 5 times, most recently from 3b80ae7 to 144ac03 Compare November 13, 2025 23:15
@benoit-nexthop benoit-nexthop force-pushed the fboss2-config-test branch 3 times, most recently from 4e6ff09 to a6aa99a Compare November 27, 2025 09:47
@benoit-nexthop benoit-nexthop force-pushed the fboss2-config-test branch 2 times, most recently from 02bd96b to 6f663d1 Compare December 17, 2025 22:20
@meta-codesync
Copy link

meta-codesync bot commented Dec 17, 2025

@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D89410954.

@facebook-github-bot
Copy link
Contributor

@benoit-nexthop has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@benoit-nexthop has updated the pull request. You must reimport the pull request before landing.

meta-codesync bot pushed a commit that referenced this pull request Dec 18, 2025
…ly the clang-format

Summary:
When helping Benoit from Nexthop to import PR: #628,
I hit lots of clang-format issue from our phabricator:
 {F1984269569}

This is due to the .clang-format only exist in github:fboss/fboss directory but not in github:fboss/common
As we ship our fbcode fboss to github, we split the two folder as below
https://www.internalfb.com/code/fbsource//fbcode/opensource/fbcode_builder/manifests/fboss?lines=48-51

Therefore, to make sure we honor the same clang-format, I think we should just move the current fboss/.clang-format to github/ in fbcode,
as github/ will be the root directory in github.
Besides, this .clang-format is mainly used for github formatting, we don't need this for our internal. The first diff to introduce this .clang-format is from D62764920

Reviewed By: kevin645

Differential Revision: D89426180

fbshipit-source-id: be37e6f32e7cb29ab8cb277e9cc8958ab75113ca
Tests using the mocked agent connection would often incur a 5-7 second
delay because of the default Thrift configuration. By being more
aggressive we can speed up the tests significantly. The 25 unit tests
now take about 20-22s to complete (I’ve seen as low as 11s) vs 125-135s
before (testing on Intel Xeon Silver 4309Y @ 2.80GHz).
@facebook-github-bot
Copy link
Contributor

@benoit-nexthop has updated the pull request. You must reimport the pull request before landing.

meta-codesync bot pushed a commit to facebook/sapling that referenced this pull request Dec 19, 2025
Summary:
**Pre-submission checklist**
- [x] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running `pip install -r requirements-dev.txt && pre-commit install`
- [x] `pre-commit run`

The `fboss2` CLI has a number of unit tests, however none of them are being built/run in the OSS build. Turn the CLI into a library in the cmake build, just like how it’s done in the Buck build, and add a new cmake file for the unit tests that leverages this library.

Various unit tests were including `nettools/common/TestUtils.h`, which is not open source, however they generally didn’t need that header and only needed a header from thrift from the most part.

Some simple stubs were incomplete. The BGP server is taken out when building with `IS_OSS`. This change tries to keep the OSS build as close as possible to the internal build, with minimal usage of `#ifdef`s.

X-link: facebook/fboss#628

Reviewed By: shiva-menta

Differential Revision: D89410954

Pulled By: joseph5wu

fbshipit-source-id: ee163fdba31b2a0d6768cd927681daba27d4c303
@meta-codesync
Copy link

meta-codesync bot commented Dec 19, 2025

@joseph5wu merged this pull request in 4843538.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants