From 41fdf2777183d85a5cdeb86874ec94ce3a6a3fe4 Mon Sep 17 00:00:00 2001 From: kdivya153 <121901963+kdivya153@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:24:35 -0400 Subject: [PATCH 1/4] fix: Add Manage,Discovery to end-to-end Functional Testing (#318) * fix: MFOS Sanity for Manage,discovery MFOS Sanity for Manage,discovery * fix: Fixed run-standalone * fix * fix: updated module * Added echo * added logs * Added more loogs * updated module * added echo * replaced string literals * updated with runTest * Changes to FCA * Teesting * update * updated * cloning * updated port * updated dynamic module * removed core * updated manage * Update run-standalone-mfos-tests.yml * Update run-standalone-mfos-tests.yml * Added checking port back * Update run-standalone-mfos-tests.yml * Update run-standalone-mfos-tests.yml * Update utils.sh * Update utils.sh * Update utils.sh * Update run-standalone-mfos-tests.yml * Update run-standalone-mfos-tests.yml * Update utils.sh * Update run-standalone-mfos-tests.yml * Aded intent * Update run-standalone-mfos-tests.yml * Running for all 3 * Update run-standalone-mfos-tests.yml * Update utils.sh * Update utils.sh * Update pr-comment.yml * Changed the workflow name * updated PR comments * changed the yml name * Added * Update utils.sh * Update run-standalone-mfos-tests.yml * Changes to the workflow name --------- Co-authored-by: kschrief --- .github/workflows/pr-comment.yml | 2 +- .github/workflows/run-standalone-mfos-tests.yml | 14 +++++++++----- .github/workflows/utils.cjs | 4 ++-- .github/workflows/utils.sh | 7 ++++++- 4 files changed, 18 insertions(+), 9 deletions(-) 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 From e9acde008aa41975e65768a6eef1cf5cce5058d9 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 25 Sep 2024 14:28:44 +0000 Subject: [PATCH 2/4] chore(release): 1.4.1-next.1 [skip ci] ## [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)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- src/sdks/core/package.json | 2 +- src/sdks/discovery/package.json | 2 +- src/sdks/manage/package.json | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc880284e..75e859385 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [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..747aa65e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@firebolt-js/sdks", - "version": "1.4.0", + "version": "1.4.1-next.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@firebolt-js/sdks", - "version": "1.4.0", + "version": "1.4.1-next.1", "license": "Apache-2.0", "workspaces": [ "src/sdks/core", diff --git a/package.json b/package.json index c1e75befc..9f53e7292 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/sdks", - "version": "1.4.0", + "version": "1.4.1-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..88b845283 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.4.1-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..1dc3a3e56 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.4.1-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/manage/package.json b/src/sdks/manage/package.json index fa73c3f90..6c14a2d50 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.4.1-next.1", "description": "The Firebolt Manage JS SDK", "main": "./dist/lib/firebolt-manage.mjs", "types": "./dist/lib/firebolt-manage.d.ts", From 93bc083f76fc03c95c6f7c595259e3c78e7436f7 Mon Sep 17 00:00:00 2001 From: Keaton Sentak <54916859+ksentak@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:02:16 -0400 Subject: [PATCH 3/4] feat: Add native discovery test app (#324) Co-authored-by: kschrief --- .../src/cpp/sdk/cpptest/DiscoverySDKTest.cpp | 40 +++++++++++++++++-- .../src/cpp/sdk/cpptest/DiscoverySDKTest.h | 10 ++++- .../discovery/src/cpp/sdk/cpptest/Main.cpp | 5 ++- 3 files changed, 49 insertions(+), 6 deletions(-) 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; From e1f846a50920b860f63635cbb792ee03f31ffea4 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 25 Sep 2024 15:06:31 +0000 Subject: [PATCH 4/4] chore(release): 1.5.0-next.1 [skip ci] # [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)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- src/sdks/core/package.json | 2 +- src/sdks/discovery/package.json | 2 +- src/sdks/manage/package.json | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75e859385..6f40f9880 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [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) diff --git a/package-lock.json b/package-lock.json index 747aa65e5..e2c496250 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@firebolt-js/sdks", - "version": "1.4.1-next.1", + "version": "1.5.0-next.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@firebolt-js/sdks", - "version": "1.4.1-next.1", + "version": "1.5.0-next.1", "license": "Apache-2.0", "workspaces": [ "src/sdks/core", diff --git a/package.json b/package.json index 9f53e7292..adc3c1187 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@firebolt-js/sdks", - "version": "1.4.1-next.1", + "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 88b845283..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.1-next.1", + "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 1dc3a3e56..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.1-next.1", + "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/manage/package.json b/src/sdks/manage/package.json index 6c14a2d50..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.1-next.1", + "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",