fix(lifecycle_client): link lifecycle_mock against lifecyclemanager t…#337
fix(lifecycle_client): link lifecycle_mock against lifecyclemanager t…#337Chahult wants to merge 3 commits into
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
@Chahult some checks are failing,are you planning to adapt or delete the PR? |
bd15106 to
73c9454
Compare
73c9454 to
2da00ec
Compare
2da00ec to
4e403ba
Compare
|
The created documentation from the pull request is available at: docu-html |
4e403ba to
9ae0e52
Compare
|
@NicolasFussberger Could you please review |
Adapt the changes for config management |
9ae0e52 to
2de1db3
Compare
lifecycle_mock provides a mock of LifeCycleManager which inherits from the concrete class. Without :lifecyclemanager in its deps the vtable symbol is undefined when building lifecycle_mock as a shared library (--no-allow-shlib-undefined). Also guard all ApplicationContext callbacks against null to prevent std::bad_function_call when a global ApplicationContext is constructed before any ApplicationContextMock instance exists.
2de1db3 to
5ddb37e
Compare
| strip_include_prefix = "/score/launch_manager/src/lifecycle_client/src", | ||
| tags = ["FUSA"], | ||
| visibility = ["//score/launch_manager:__subpackages__"], | ||
| visibility = ["//visibility:public"], |
There was a problem hiding this comment.
Is this necessary for the current mocking to work?
In the score meeting we had discussed that ideally we would like to just expose a single bazel target for the lifecycle API
There was a problem hiding this comment.
No, now instead of making individual targets public, I've added a single lifecycle_test_mocks facade target with //visibility:public, reverting all internal targets back to //score/launch_manager:subpackages. External packages should now depend only on :lifecycle_test_mocks.
|
@Chahult In the lifecycle repo we have a bit the problem that these mocks were contributed but we have no tests for them at the moment and its also not really obvious how to use them. Would it be possible for you to contribute some tests based on your usage of these mocks? E.g. for some example application we have in the examples folder? |
Sure, Done — added examples/cpp_lifecycle_app/lifecycle_mocks_UT.cpp with tests that mirror how config_management uses the mocks (argument injection via ApplicationContextMock, lifecycle flow via LifeCycleManagerMock). These also serve as usage documentation for future contributors. |
80d7948 to
f619102
Compare
…o resolve vtable
lifecycle_mock provides a mock implementation of LifeCycleManager, which inherits from the concrete class defined in lifecyclemanager.cpp. Without linking against the :lifecyclemanager target, the vtable symbol is undefined when building lifecycle_mock as a shared library (--no-allow-shlib-undefined).
Added :lifecyclemanager to lifecycle_mock's deps to provide the vtable.