Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 49 additions & 19 deletions .github/workflows/cxx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
.github/workflows/utils.sh cloneAndInstallThunder

- name: Upload the library artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: thunder
path: /__w/firebolt-apis/install/
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.npm
key: deps-node-modules-${{ hashFiles('package-lock.json') }}
key: deps-node-modules-${{ hashFiles('package.json') }}

- name: Install dependencies
run: npm install
Expand All @@ -85,19 +85,19 @@ jobs:
npm run dist

- name: Upload Core SDK
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: core
path: src/sdks/core

- name: Upload Manage SDK
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: manage
path: src/sdks/manage

- name: Upload Discovery SDK
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: discovery
path: src/sdks/discovery
Expand All @@ -113,13 +113,13 @@ jobs:
uses: actions/checkout@v2

- name: Download Core SDK
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: core
path: /__w/firebolt-apis/firebolt-apis/src/sdks/core

- name: Download Thunder
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: thunder
path: /__w/thunder/install/
Expand Down Expand Up @@ -151,6 +151,12 @@ jobs:

- name: Test and Generate coverage report
run: .github/workflows/utils.sh generate_core_sdk_coverage_report

- name: Upload Core coverage report
uses: actions/upload-artifact@v4
with:
name: core-coverage
path: ./coverage

- name: Display coverage report
uses: irongut/[email protected]
Expand All @@ -163,12 +169,16 @@ jobs:
hide_complexity: true
indicators: true
output: both
thresholds: '80 40'

thresholds: '50 20'

- name: Replace badge title in PR comment
run: sed -i 's/Code%20Coverage/Core%20Coverage%20Report/g' code-coverage-results.md

- name: Add coverage PR comment
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
recreate: false
append: true
path: code-coverage-results.md


Expand All @@ -183,13 +193,13 @@ jobs:
uses: actions/checkout@v2

- name: Download Manage SDK
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: manage
path: /__w/firebolt-apis/firebolt-apis/src/sdks/manage

- name: Download Thunder
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: thunder
path: /__w/thunder/install/
Expand Down Expand Up @@ -221,6 +231,12 @@ jobs:

- name: Test and Generate coverage report
run: .github/workflows/utils.sh generate_manage_sdk_coverage_report

- name: Upload Manage coverage report
uses: actions/upload-artifact@v4
with:
name: manage-coverage
path: ./coverage

- name: Display coverage report
uses: irongut/[email protected]
Expand All @@ -233,12 +249,16 @@ jobs:
hide_complexity: true
indicators: true
output: both
thresholds: '80 40'
thresholds: '50 20'

- name: Replace badge title in PR comment
run: sed -i 's/Code%20Coverage/Manage%20Coverage%20Report/g' code-coverage-results.md

- name: Add coverage PR comment
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
recreate: false
append: true
path: code-coverage-results.md

discovery_sdk:
Expand All @@ -252,13 +272,13 @@ jobs:
uses: actions/checkout@v2

- name: Download Discovery SDK
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: discovery
path: /__w/firebolt-apis/firebolt-apis/src/sdks/discovery

- name: Download Thunder
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: thunder
path: /__w/thunder/install/
Expand All @@ -278,6 +298,12 @@ jobs:
- name: Generate discovery SDK source code
run: |
.github/workflows/utils.sh generate_cpp_discovery_sdk_source_code

- name: Upload Discovery coverage report
uses: actions/upload-artifact@v4
with:
name: discovery-coverage
path: ./coverage

- name: Build CXX Discovery SDK
run: |
Expand All @@ -302,11 +328,15 @@ jobs:
hide_complexity: true
indicators: true
output: both
thresholds: '80 40'

thresholds: '50 20'

- name: Replace badge title in PR comment
run: sed -i 's/Code%20Coverage/Discovery%20Coverage%20Report/g' code-coverage-results.md

- name: Add coverage PR comment
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
recreate: false
append: true
path: code-coverage-results.md

2 changes: 1 addition & 1 deletion .github/workflows/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ function generate_coverage_report(){
echo " ************ Generate coverage report for ${sdk_name^} CPP SDK ************"

cd /__w/firebolt-apis/firebolt-apis/firebolt-${sdk_name}-native-sdk-${FIREBOLT_VERSION}
cmake --build build --target coverage
cmake --build build --target coverage || exit 9999

mv /__w/firebolt-apis/firebolt-apis/firebolt-${sdk_name}-native-sdk-${FIREBOLT_VERSION}/build/test/coverage /__w/firebolt-apis/firebolt-apis/
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@firebolt-js/openrpc": "3.1.1",
"@firebolt-js/openrpc": "3.2.0-next.13",
"@firebolt-js/schemas": "2.0.0",
"@saithodev/semantic-release-backmerge": "^3.2.0",
"@semantic-release/changelog": "^6.0.1",
Expand Down
58 changes: 56 additions & 2 deletions src/sdks/discovery/src/cpp/sdk/cpptest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ endif ()

find_package(WPEFramework CONFIG REQUIRED)
find_package(${NAMESPACE}Core CONFIG REQUIRED)
find_package(Firebolt CONFIG REQUIRED)
find_package(${FIREBOLT_NAMESPACE}SDK CONFIG REQUIRED)

set(TESTAPP TestFireboltDiscovery)

Expand Down Expand Up @@ -79,3 +77,59 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${TESTAPP} ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin
)

if(ENABLE_UNIT_TESTS)
set(UNIT_TESTS_APP FireboltDiscoveryUnitTests)

message("Setup ${UNIT_TESTS_APP}")

add_executable(${UNIT_TESTS_APP}
DiscoverySDKTest.cpp
)

link_directories(${CMAKE_SOURCE_DIR}/../../Thunder/install/usr/lib/)
target_link_libraries(${UNIT_TESTS_APP}
PRIVATE
${NAMESPACE}Core::${NAMESPACE}Core
${FIREBOLT_NAMESPACE}SDK::${FIREBOLT_NAMESPACE}SDK
nlohmann_json_schema_validator
gtest_main
)

target_include_directories(${UNIT_TESTS_APP}
PRIVATE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include/>
)

set_target_properties(${UNIT_TESTS_APP} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
)

include(GoogleTest)
gtest_discover_tests(${UNIT_TESTS_APP})
endif()

if(ENABLE_COVERAGE)
include(${CMAKE_SOURCE_DIR}/cmake/CodeCoverage.cmake)

set(COVERAGE_MAIN "coverage")
set(COVERAGE_EXCLUDES
"${CMAKE_SOURCE_DIR}/build/*"
"${CMAKE_SOURCE_DIR}/cmake/*"
"${CMAKE_SOURCE_DIR}/include/*"
"${CMAKE_SOURCE_DIR}/test/*"
"/usr/include/*")

set(COVERAGE_EXTRA_FLAGS)
set(COVERAGE_DEPENDENCIES ${UNIT_TESTS_APP})

setup_target_for_coverage_gcovr_html(
NAME ${COVERAGE_MAIN}
BASE_DIRECTORY ${CMAKE_SOURCE_DIR}
EXECUTABLE ctest
EXECUTABLE_ARGS "--test-dir ../build/ --output-on-failure"
DEPENDENCIES ${COVERAGE_DEPENDENCIES}
)

endif()
2 changes: 1 addition & 1 deletion src/sdks/manage/src/cpp/sdk/cpptest/ManageSDKTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ void ManageSDKTest::AddLocalizationAdditionalInfo()
{
Firebolt::Error error = Firebolt::Error::None;
std::string key = "testKey";
std::string value = "testValue";
float value = 1.0f;

Firebolt::IFireboltAccessor::Instance().LocalizationInterface().addAdditionalInfo(key, value, &error);
if (error == Firebolt::Error::None) {
Expand Down
Loading