Skip to content

Update SCM Sensors#579

Closed
pawagh1 wants to merge 1 commit into
facebook:mainfrom
pawagh1:scmsensorupdate
Closed

Update SCM Sensors#579
pawagh1 wants to merge 1 commit into
facebook:mainfrom
pawagh1:scmsensorupdate

Conversation

@pawagh1

@pawagh1 pawagh1 commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@meta-cla

meta-cla Bot commented Oct 8, 2025

Copy link
Copy Markdown

Hi @pawagh1!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla meta-cla Bot added the CLA Signed label Oct 13, 2025
@meta-cla

meta-cla Bot commented Oct 13, 2025

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@pawagh1 pawagh1 closed this Oct 14, 2025
meta-codesync Bot pushed a commit that referenced this pull request Feb 19, 2026
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`

When building only a specific cmake target to save time, getdeps removes
the "built marker” under `$builddir/installed/fboss/.built-by-getdeps`,
which makes it impossible to subsequently run the unit tests as  without
this file getdeps bails out with `project fboss has not been built`.
What’s more, because of a missing `return` the exit code was 0, which
was confusing.
This fix ensures that the return code is propagated properly and also
improves the cmake test runner to automatically detect missing
executables and build them on the fly. This will not rebuild the test
binaries if they've already been built and are merely stale (because the
source code has changed) but that was already the prior behavior. At
least now it's possible to rebuild a single cmake test target and re-run
the tests in one shot.

Pull Request resolved: #722

Test Plan:
- Manually removed one unit test target, running `getdeps.py test` now can detect the missing test executables, and then rebuild such executables before running the tests
```
[root@5f196107a3a6 fboss]# ls -al /var/FBOSS/tmp_bld_dir/build/fboss/fboss2_cmd_test
-rwxr-xr-x 1 root root 116548584 Feb 17 20:48 /var/FBOSS/tmp_bld_dir/build/fboss/fboss2_cmd_test

[root@5f196107a3a6 fboss]# rm -rf /var/FBOSS/tmp_bld_dir/build/fboss/fboss2_cmd_test

[root@5f196107a3a6 fboss]# ./build/fbcode_builder/getdeps.py test --allow-system-packages --extra-cmake-defines='{"CMAKE_BUILD_TYPE": "MinSizeRel", "CMAKE_CXX_STANDARD": "20"}' --scratch-path /var/FBOSS/tmp_bld_dir --num-jobs 16 --src-dir . fboss
Testing ENV[BOOST_ROOT_1_69_0]: None
Building missing test executables: fboss2_cmd_test
...
+ cd /var/FBOSS/tmp_bld_dir/build/fboss && \
+ /usr/bin/cmake \
+      --build \
+      /var/FBOSS/tmp_bld_dir/build/fboss \
+      --target \
+      fboss2_cmd_test \
+      --config \
+      RelWithDebInfo \
+      -j \
+      16
[1/1] Linking CXX executable fboss2_cmd_test
 ---
...
103/689 Test #110: CmdShowAggregatePortTestFixture.queryClient ......................................................................................................   Passed    0.10 sec
        Start 141: CmdShowRouteDetailsTestFixture.queryClient
104/689 Test #113: CmdShowExampleTestFixture.queryClient ............................................................................................................   Passed    0.09 sec
        Start  94: CmdShowArpTestFixture.queryClient
105/689 Test #126: CmdShowInterfaceErrorsTestFixture.queryClient ....................................................................................................   Passed    0.10 sec
        Start  87: CmdSetPortStateTestFixture.enableOnePort
106/689 Test #129: CmdShowMirrorTestFixture.queryClientWithoutTunnel ................................................................................................   Passed    0.10 sec
        Start 123: CmdShowInterfaceCountersTestFixture.queryClient
...
100% tests passed, 0 tests failed out of 689

Total Test time (real) =  20.93 sec
```

- Confirmed the test executable was actually build, noticed timestamp of such binary is different than before
```
[root@5f196107a3a6 fboss]# ls -al /var/FBOSS/tmp_bld_dir/build/fboss/fboss2_cmd_test
-rwxr-xr-x 1 root root 116548584 Feb 17 22:26 /var/FBOSS/tmp_bld_dir/build/fboss/fboss2_cmd_test
```

- Now run the test command again when all the test binaries exist without any issue
```
[root@5f196107a3a6 fboss]# ./build/fbcode_builder/getdeps.py test --allow-system-packages --extra-cmake-defines='{"CMAKE_BUILD_TYPE": "MinSizeRel", "CMAKE_CXX_STANDARD": "20"}' --scratch-path /var/FBOSS/tmp_bld_dir --num-jobs 16 --src-dir . fboss
Testing ENV[BOOST_ROOT_1_69_0]: None
 ---
...
686/689 Test #578: ThriftStructNodeTestSuite.ThriftStructNodeRemovePathOnThriftMapTest<TestParams<true>> ............................................................   Passed    0.01 sec
687/689 Test #579: ThriftStructNodeTestSuite.ThriftStructNodeRemovePathOnThriftListTest<TestParams<true>> ...........................................................   Passed    0.01 sec
688/689 Test #580: ThriftStructNodeTestSuite.ThriftStructNodeRemovePathOnThriftSetTest<TestParams<true>> ............................................................   Passed    0.01 sec
689/689 Test #550: ThriftStructNodeTests.ThriftStructNodeSetAlreadyPublished ........................................................................................   Passed    0.18 sec

100% tests passed, 0 tests failed out of 689

Total Test time (real) =  21.00 sec
```

Reviewed By: bigfootjon

Differential Revision: D93524014

Pulled By: joseph5wu

fbshipit-source-id: d58055430e181f4efa6901985b7b2e7de4626a11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant