How to run tests in bmcweb

James Feist james.feist at linux.intel.com
Sat Nov 2 03:21:01 AEDT 2019


On 11/1/19 1:59 AM, Lei YU wrote:
> I am trying to add a unit test case in bmcweb and run it.
> With local CI, the tests are not run:
> 
>   WORKSPACE=$(pwd) UNIT_TEST_PKG=bmcweb
> ./openbmc-build-scripts/run-unit-test-docker.sh
>   ...
>   [100%] Built target bmcweb
>   /home/leiyu/work/bmcweb > ctest .
>   Test project /home/leiyu/work/bmcweb
>   No tests were found!!!
>   ...
> 
> So the question is, how do I run tests in bmcweb? Should
> openbmc-build-scripts be updated to support that?

I believe the tests in bmcweb have degraded and stopped working, so they 
were disabled. I haven't run them myself, so I'm not sure how bad they 
degraded. If you want to try to run them locally you need to pass
-DBMCWEB_BUILD_UT=1 when you run the cmake command.

https://github.com/openbmc/bmcweb/blob/c78d791eb1fa9d12e987e7b1ad885ada92d0757a/CMakeLists.txt#L292


openbmc-build-scripts is fine the way it is, if the unit tests are fixed 
then we can simply change if (BMCWEB_BUILD_UT) into if (NOT 
YOCTO_DEPENDENCIES) and the build scripts know how to take over.

https://github.com/openbmc/bmcweb/blob/c78d791eb1fa9d12e987e7b1ad885ada92d0757a/CMakeLists.txt#L206

FWIW Entity-manager has an example of running tests in CMake that works 
with openbmc-build-scripts 
https://github.com/openbmc/entity-manager/blob/f2ad76b32cea5170a5a9a631f49935ae3dd4626d/CMakeLists.txt#L113


-James

> 
> Thanks!
> 


More information about the openbmc mailing list