Skip to content

Remove thunder mocks from test directory#285

Draft
smanes0213 wants to merge 12 commits intodevelopfrom
mock_removal_test
Draft

Remove thunder mocks from test directory#285
smanes0213 wants to merge 12 commits intodevelopfrom
mock_removal_test

Conversation

@smanes0213
Copy link

No description provided.

@smanes0213 smanes0213 requested a review from a team as a code owner March 9, 2026 05:08
Copilot AI review requested due to automatic review settings March 9, 2026 05:08
@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 1 file pending identification.

  • Protex Server Path: /home/blackduck/github/networkmanager/285/rdkcentral/networkmanager

  • Commit: 08bd1c1

Report detail: gist'

@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 1 file pending identification.

  • Protex Server Path: /home/blackduck/github/networkmanager/285/rdkcentral/networkmanager

  • Commit: 009aa69

Report detail: gist'

Copy link
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 removes in-repo Thunder mock/patch artifacts and shifts unit-test dependencies toward fetching Thunder (and GoogleTest) via CMake FetchContent, with corresponding CI workflow simplifications.

Changes:

  • Added tests/thunder FetchContent setup for Thunder + GoogleTest and removed the old Thunder patching approach.
  • Deleted tests/mocks/thunder/* mock headers/sources and introduced new mock/support headers under tests/mocks/.
  • Updated test CMake and GitHub workflows to stop cloning/building Thunder directly and to adjust test build inputs/includes.

Reviewed changes

Copilot reviewed 19 out of 27 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
CMakeLists.txt Adds test-only FetchContent fallback for Thunder when not found via find_package.
tests/thunder/CMakeLists.txt New FetchContent-based provisioning for Thunder + GoogleTest for unit tests.
tests/patches/thunder/SubscribeStub.patch Removes the old Thunder source patch used by CI/tests.
tests/mocks/thunder/SystemInfo.h Removes Thunder-specific subsystem mock.
tests/mocks/thunder/Module.h Removes Thunder-specific module header used by old mocks/tests.
tests/mocks/thunder/Module.cpp Removes Thunder-specific module translation unit used by old mocks/tests.
tests/mocks/thunder/DispatcherMock.h Removes Thunder dispatcher mock.
tests/mocks/thunder/CommunicatorMock.h Removes Thunder communicator client mock.
tests/mocks/thunder/Communicator.h Removes Thunder communicator shim header.
tests/mocks/thunder/Communicator.cpp Removes Thunder communicator shim implementation.
tests/mocks/mockauthservices.h Adds authentication/security-related mock used by legacy tests.
tests/mocks/WorkerPoolImplementation.h Adds a WorkerPool test implementation used by L2 tests.
tests/mocks/ThunderPortability.h Adds portability macros/types used by tests when building against Thunder/WPEFramework headers.
tests/mocks/ServiceMock.h Adds PluginHost::IShell mock used by tests.
tests/mocks/InterfaceIteratorMock.h Adds iterator mock used by legacy/network tests.
tests/mocks/IStringIteratorMock.h Adds string iterator mock template used by legacy/network tests.
tests/mocks/FactoriesImplementation.h Adds PluginHost::IFactories implementation for request/response factories in tests.
tests/mocks/COMLinkMock.h Adds COMLink mock used for RPC instantiation in tests.
tests/l1Test/CMakeLists.txt Makes Core/Plugins find_package conditional on targets already existing.
tests/l2Test/CMakeLists.txt Removes GoogleTest FetchContent provisioning and makes Core/Plugins find_package conditional.
tests/l2Test/rdk/CMakeLists.txt Switches tests to use plugin/Module.cpp and removes Thunder-mocks include dir; conditional find_package.
tests/l2Test/libnm/CMakeLists.txt Removes GoogleTest FetchContent provisioning (now assumed external) and switches to plugin/Module.cpp.
tests/l2Test/legacy/CMakeLists.txt Switches tests to use plugin/Module.cpp and removes Thunder-mocks include dir; conditional find_package.
.github/workflows/rdk_proxy_L1_L2_test.yml Stops cloning/patching/building Thunder in CI.
.github/workflows/libnm_proxy_L1_test.yml Stops cloning/patching/building Thunder in CI.
.github/workflows/legacy_L1_L2_test.yml Stops cloning/patching/building Thunder in CI; adjusts IARM stub generation steps.
.github/workflows/gdbus_proxy_L1_test.yml Stops cloning/patching/building Thunder in CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 22 to +31
find_package(CURL)
find_package(PkgConfig REQUIRED)
find_package(${NAMESPACE}Core REQUIRED)
find_package(${NAMESPACE}Plugins REQUIRED)

include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)

FetchContent_MakeAvailable(googletest)
# Thunder targets may already exist from FetchContent (test-only builds)
if(NOT TARGET ${NAMESPACE}Core::${NAMESPACE}Core)
find_package(${NAMESPACE}Core REQUIRED)
endif()
if(NOT TARGET ${NAMESPACE}Plugins::${NAMESPACE}Plugins)
find_package(${NAMESPACE}Plugins REQUIRED)
endif()
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CMakeLists no longer provides GoogleTest/GoogleMock (it removed the prior FetchContent block), but subtargets under l1Test/l2Test still link against gmock_main and use gtest_SOURCE_DIR include paths. Unless those are guaranteed to be defined earlier by the top-level build, configuring unit tests will fail on environments without system gmock/gtest. Consider adding a local fallback here (FetchContent or find_package(GTest)) or ensuring the top-level unit-test path always brings in GoogleTest before adding tests/ subdirectories.

Copilot uses AI. Check for mistakes.
CMakeLists.txt Outdated
Comment on lines +31 to +41
# If neither is found, use FetchContent for test-only builds
if (NOT WPEFramework_FOUND AND NOT Thunder_FOUND)
message(FATAL_ERROR
"Neither WPEFramework nor Thunder could be found.\n"
"Install one of them and ensure its CMake package is discoverable via CMAKE_PREFIX_PATH or default locations.")
if(ENABLE_UNIT_TESTING)
message(STATUS "Thunder not found via find_package — using FetchContent for test builds")
add_subdirectory(tests/thunder)
else()
message(FATAL_ERROR
"Neither WPEFramework nor Thunder could be found.\n"
"Install one of them and ensure its CMake package is discoverable via CMAKE_PREFIX_PATH or default locations.\n"
"Alternatively, enable ENABLE_UNIT_TESTING to use FetchContent.")
endif()
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When ENABLE_UNIT_TESTING is ON and Thunder/WPEFramework is found via find_package, this path won’t add tests/thunder, so GoogleTest (gmock_main, gtest_SOURCE_DIR) is never provided. The test CMakeLists currently assumes FetchContent has populated these, which can break local/unit-test builds unless the environment happens to provide gmock_main system-wide. Consider fetching GoogleTest unconditionally when ENABLE_UNIT_TESTING is enabled (or moving GoogleTest FetchContent to a dedicated tests CMake module that always runs for unit tests), independent of whether Thunder is discovered via find_package.

Copilot uses AI. Check for mistakes.
@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 1 file pending identification.

  • Protex Server Path: /home/blackduck/github/networkmanager/285/rdkcentral/networkmanager

  • Commit: b7d1f5c

Report detail: gist'

Copilot AI review requested due to automatic review settings March 9, 2026 06:32
@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 1 file pending identification.

  • Protex Server Path: /home/blackduck/github/networkmanager/285/rdkcentral/networkmanager

  • Commit: 6d2e668

Report detail: gist'

@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 1 file pending identification.

  • Protex Server Path: /home/blackduck/github/networkmanager/285/rdkcentral/networkmanager

  • Commit: 2500a4d

Report detail: gist'

Copy link
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

Copilot reviewed 22 out of 30 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

.github/workflows/rdk_proxy_L1_L2_test.yml:82

  • The workflow still creates placeholder IARM artifacts under install/usr/lib, but after removing the Thunder build/install steps this directory may not exist on a cache miss. touch install/usr/lib/libIARMBus.so will fail if install/usr/lib hasn't been created. Add mkdir -p install/usr/lib before touching these files (similar to what was done in legacy_L1_L2_test.yml).
          PATH=${{github.workspace}}/install/usr/bin:${PATH}
          LD_LIBRARY_PATH=${{github.workspace}}/install/usr/lib:${{github.workspace}}/install/usr/lib/wpeframework/plugins:${LD_LIBRARY_PATH}
          rdkproxy_l2_test --gtest_color=yes --gtest_output="xml:/tmp/gtest_log/rdkproxy_l2_test.xml"

.github/workflows/libnm_proxy_L1_test.yml:93

  • After removing the Thunder build/install steps, the workflow may run on a cache miss without install/usr/lib existing. The touch install/usr/lib/libIARMBus.so and touch install/usr/lib/libmfrlib.so commands will fail if that directory isn’t created first. Add mkdir -p install/usr/lib before these touch calls.

      - name: Generate coverage
        run: |
            lcov -c -o coverage.info -d build/networkmanager_libnm/
            lcov -e coverage.info '*/networkmanager/plugin/gnome/*' -o filtered_coverage.info


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 81 to +91
if(ENABLE_UNIT_TESTING)
# Fetch GoogleTest for all test targets
include(FetchContent)
set(GOOGLE_TEST_VERSION "v1.15.2" CACHE STRING "GoogleTest git tag/branch/commit to use")
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG ${GOOGLE_TEST_VERSION}
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENABLE_UNIT_TESTING now triggers FetchContent_MakeAvailable(googletest), which requires a newer CMake (>=3.14). With cmake_minimum_required(VERSION 3.3), unit-test builds will fail on older CMake versions. Consider bumping the project minimum CMake version (or at least gating unit testing with a clear version check/message) so the stated minimum matches actual requirements.

Copilot uses AI. Check for mistakes.
@smanes0213 smanes0213 marked this pull request as draft March 9, 2026 07:16
@smanes0213 smanes0213 marked this pull request as draft March 9, 2026 07:16
@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 1 file pending identification.

  • Protex Server Path: /home/blackduck/github/networkmanager/285/rdkcentral/networkmanager

  • Commit: f7ffae6

Report detail: gist'

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants