diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml index 03dd88bc5..e27cc3ddc 100644 --- a/.github/workflows/pr-comment.yml +++ b/.github/workflows/pr-comment.yml @@ -5,7 +5,7 @@ on: types: - "completed" workflows: - - "Core SDK - MFOS standalone sanity report" + - "MFOS standalone sanity report - CORE,MANAGE,DISCOVERY" jobs: comment-on-pr: diff --git a/.github/workflows/run-standalone-mfos-tests.yml b/.github/workflows/run-standalone-mfos-tests.yml index 54f281328..073376aa0 100644 --- a/.github/workflows/run-standalone-mfos-tests.yml +++ b/.github/workflows/run-standalone-mfos-tests.yml @@ -1,4 +1,4 @@ -name: Core SDK - MFOS standalone sanity report +name: MFOS standalone sanity report - CORE,MANAGE,DISCOVERY on: pull_request: @@ -14,14 +14,15 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Run tests and create assets + #Run tests + - name: Run Core Manage and Discovery tests and create assets env: EVENT_NAME: ${{ github.event_name }} GITHUB_REF: ${{ github.ref }} PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} - INTENT: ${{ secrets.INTENT }} + INTENT: ${{ vars.INTENT }} run: | - ./.github/workflows/utils.sh runTests + ./.github/workflows/utils.sh runTests - name: Upload report.json as an artifact uses: actions/upload-artifact@v4 @@ -31,4 +32,7 @@ jobs: - name: Get results from report.json run: | - ./.github/workflows/utils.sh getResults \ No newline at end of file + ./.github/workflows/utils.sh getResults + + + \ No newline at end of file diff --git a/.github/workflows/utils.cjs b/.github/workflows/utils.cjs index 32e39a38b..067cc8b9b 100755 --- a/.github/workflows/utils.cjs +++ b/.github/workflows/utils.cjs @@ -34,8 +34,8 @@ async function createComment(github, context) { const { issue_number, Passes, Failures, Pending, Skipped, ARTIFACT_URL, JOB_PATH } = process.env; const body = ` - Core SDK - MFOS standalone sanity report: - Passes - ${Passes} Failures - ${Failures} Pending - ${Pending} Skipped - ${Skipped} + MFOS standalone sanity report - CORE,MANAGE,DISCOVERY: + Total Passes - ${Passes} Failures - ${Failures} Pending - ${Pending} Skipped - ${Skipped} Report JSON/HTML Files: ${ARTIFACT_URL} Job Logs: ${JOB_PATH} `; diff --git a/.github/workflows/utils.sh b/.github/workflows/utils.sh index 13c8e7ff7..772b35866 100755 --- a/.github/workflows/utils.sh +++ b/.github/workflows/utils.sh @@ -36,7 +36,12 @@ function runTests(){ echo "clone fca repo and start it in the background" git clone --branch main https://github.com/rdkcentral/firebolt-certification-app.git cd firebolt-certification-app + echo "Updating Core SDK dependency" jq '.dependencies["@firebolt-js/sdk"] = "file:../firebolt-apis/src/sdks/core"' package.json > package.json.tmp && mv package.json.tmp package.json + echo "Updating Manage SDK dependency" + jq '.dependencies["@firebolt-js/manage-sdk"] = "file:../firebolt-apis/src/sdks/manage"' package.json > package.json.tmp && mv package.json.tmp package.json + echo "Updating Discovery SDK dependency" + jq '.dependencies["@firebolt-js/discovery-sdk"] = "file:../firebolt-apis/src/sdks/discovery"' package.json > package.json.tmp && mv package.json.tmp package.json npm install npm start & sleep 5s @@ -149,7 +154,7 @@ function unzipArtifact(){ # Check argument and call corresponding function if [ "$1" == "runTests" ]; then - runTests + runTests elif [ "$1" == "getResults" ]; then getResults elif [ "$1" == "getArtifactData" ]; then diff --git a/CHANGELOG.md b/CHANGELOG.md index bc880284e..6f40f9880 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# [1.5.0-next.1](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.1-next.1...v1.5.0-next.1) (2024-09-25) + + +### Features + +* Add native discovery test app ([#324](https://github.com/rdkcentral/firebolt-apis/issues/324)) ([93bc083](https://github.com/rdkcentral/firebolt-apis/commit/93bc083f76fc03c95c6f7c595259e3c78e7436f7)) + +## [1.4.1-next.1](https://github.com/rdkcentral/firebolt-apis/compare/v1.4.0...v1.4.1-next.1) (2024-09-25) + + +### Bug Fixes + +* Add Manage,Discovery to end-to-end Functional Testing ([#318](https://github.com/rdkcentral/firebolt-apis/issues/318)) ([41fdf27](https://github.com/rdkcentral/firebolt-apis/commit/41fdf2777183d85a5cdeb86874ec94ce3a6a3fe4)) + # [1.4.0](https://github.com/rdkcentral/firebolt-apis/compare/v1.3.0...v1.4.0) (2024-09-23) diff --git a/package-lock.json b/package-lock.json index f224a65b5..e2c496250 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@firebolt-js/sdks", - "version": "1.4.0", + "version": "1.5.0-next.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@firebolt-js/sdks", - "version": "1.4.0", + "version": "1.5.0-next.1", "license": "Apache-2.0", "workspaces": [ "src/sdks/core", diff --git a/package.json b/package.json index c1e75befc..adc3c1187 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/sdks", - "version": "1.4.0", + "version": "1.5.0-next.1", "description": "The Firebolt JS SDK", "type": "module", "bin": { diff --git a/src/sdks/core/package.json b/src/sdks/core/package.json index c0849b816..2b1a2fc78 100644 --- a/src/sdks/core/package.json +++ b/src/sdks/core/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/sdk", - "version": "1.4.0", + "version": "1.5.0-next.1", "description": "The Firebolt JS SDK", "main": "./dist/lib/firebolt.mjs", "types": "./dist/lib/firebolt.d.ts", diff --git a/src/sdks/discovery/package.json b/src/sdks/discovery/package.json index afcaee23a..c9df78f10 100644 --- a/src/sdks/discovery/package.json +++ b/src/sdks/discovery/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/discovery-sdk", - "version": "1.4.0", + "version": "1.5.0-next.1", "description": "The Firebolt Discovery JS SDK", "main": "./dist/lib/firebolt-discovery.mjs", "types": "./dist/lib/firebolt-discovery.d.ts", diff --git a/src/sdks/discovery/src/cpp/sdk/cpptest/DiscoverySDKTest.cpp b/src/sdks/discovery/src/cpp/sdk/cpptest/DiscoverySDKTest.cpp index 27fe67244..62d3f0282 100644 --- a/src/sdks/discovery/src/cpp/sdk/cpptest/DiscoverySDKTest.cpp +++ b/src/sdks/discovery/src/cpp/sdk/cpptest/DiscoverySDKTest.cpp @@ -23,6 +23,7 @@ using namespace std; bool DiscoverySDKTest::_connected; +DiscoverySDKTest::OnUserInterestNotification DiscoverySDKTest::_userInterestNotification; void DiscoverySDKTest::ConnectionChanged(const bool connected, const Firebolt::Error error) { @@ -89,14 +90,47 @@ inline const T ConvertToEnum(EnumMap enumMap, const string& str) return value; } -void DiscoverySDKTest::SampleTest() +void DiscoverySDKTest::OnUserInterestNotification::onUserInterest( const Firebolt::Content::InterestEvent& interest) { + cout << "User Interest changed notification" << endl; +} + +void DiscoverySDKTest::SubscribeUserInterest() +{ + Firebolt::Error error = Firebolt::Error::None; + Firebolt::IFireboltAccessor::Instance().ContentInterface().subscribe(_userInterestNotification, &error); + if (error == Firebolt::Error::None) { + cout << "Subscribe Content.UserInterest is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("Subscribe Content.UserInterest failed. " + errorMessage); + } +} + +void DiscoverySDKTest::UnsubscribeUserInterest() +{ + Firebolt::Error error = Firebolt::Error::None; + Firebolt::IFireboltAccessor::Instance().ContentInterface().unsubscribe(_userInterestNotification, &error); + if (error == Firebolt::Error::None) { + cout << "Unsubscribe Content.UserInterest is a success." << endl; + } else { + std::string errorMessage = "Error: " + std::to_string(static_cast(error)); + throw std::runtime_error("Unsubscribe Content.UserInterest failed." + errorMessage); + } +} + +void DiscoverySDKTest::RequestUserInterest() +{ + Firebolt::Discovery::InterestType type = Firebolt::Discovery::InterestType::INTEREST; + Firebolt::Discovery::InterestReason reason = Firebolt::Discovery::InterestReason::REACTION; Firebolt::Error error = Firebolt::Error::None; + Firebolt::IFireboltAccessor::Instance().ContentInterface().requestUserInterest(type, reason, &error); + if (error == Firebolt::Error::None) { - cout << "Sample Test Passed!" << endl; + cout << "Content.requestuserInterest call is a success." << endl; } else { std::string errorMessage = "Error: " + std::to_string(static_cast(error)); - throw std::runtime_error("SampleTest failed. " + errorMessage); + throw std::runtime_error("Content.requestUserInterest failed." + errorMessage); } } diff --git a/src/sdks/discovery/src/cpp/sdk/cpptest/DiscoverySDKTest.h b/src/sdks/discovery/src/cpp/sdk/cpptest/DiscoverySDKTest.h index 2fcd2bcc0..cdb70ca65 100644 --- a/src/sdks/discovery/src/cpp/sdk/cpptest/DiscoverySDKTest.h +++ b/src/sdks/discovery/src/cpp/sdk/cpptest/DiscoverySDKTest.h @@ -22,6 +22,10 @@ #include "firebolt.h" class DiscoverySDKTest { + class OnUserInterestNotification : public Firebolt::Content::IContent::IOnUserInterestNotification { + public: + void onUserInterest( const Firebolt::Content::InterestEvent& ) override; + }; public: DiscoverySDKTest() = default; @@ -31,11 +35,15 @@ class DiscoverySDKTest { static void DestroyFireboltInstance(); static void TestDiscoveryStaticSDK(); - static void SampleTest(); + static void SubscribeUserInterest(); + static void UnsubscribeUserInterest(); + static void RequestUserInterest(); static bool WaitOnConnectionReady(); private: static void ConnectionChanged(const bool, const Firebolt::Error); static bool _connected; + static OnUserInterestNotification _userInterestNotification; + }; \ No newline at end of file diff --git a/src/sdks/discovery/src/cpp/sdk/cpptest/Main.cpp b/src/sdks/discovery/src/cpp/sdk/cpptest/Main.cpp index 26e2b5dc6..aee23e31f 100644 --- a/src/sdks/discovery/src/cpp/sdk/cpptest/Main.cpp +++ b/src/sdks/discovery/src/cpp/sdk/cpptest/Main.cpp @@ -42,9 +42,10 @@ void RunAllTests() { // Ensure the connection is ready before running tests if (DiscoverySDKTest::WaitOnConnectionReady()) { - // Add tests here - runTest(DiscoverySDKTest::SampleTest, "SampleTest"); + runTest(DiscoverySDKTest::SubscribeUserInterest, "SubscribeUserInterest"); + runTest(DiscoverySDKTest::UnsubscribeUserInterest, "UnsubscribeUserInterest"); + runTest(DiscoverySDKTest::RequestUserInterest, "RequestUserInterest"); if (allTestsPassed) { cout << "============================" << endl; diff --git a/src/sdks/manage/package.json b/src/sdks/manage/package.json index fa73c3f90..0aa9b8f4c 100644 --- a/src/sdks/manage/package.json +++ b/src/sdks/manage/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/manage-sdk", - "version": "1.4.0", + "version": "1.5.0-next.1", "description": "The Firebolt Manage JS SDK", "main": "./dist/lib/firebolt-manage.mjs", "types": "./dist/lib/firebolt-manage.d.ts",