From 10fabeb4533f57b9072161de39e7590c4ccc7312 Mon Sep 17 00:00:00 2001 From: burak Date: Mon, 9 Dec 2024 21:32:30 +0300 Subject: [PATCH 01/15] make workflow parallel --- .github/workflows/build-and-deploy.yml | 273 ++++++++++++++++++------- test/test_main.py | 17 +- 2 files changed, 215 insertions(+), 75 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index ebb2b90e..1cbc44af 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -27,17 +27,6 @@ jobs: run: | mkdir $HOME/.kube echo "${{ secrets.KUBE_CONFIG_DATA }}" > $HOME/.kube/config - - - name: Run Unit Test - run: | - cd react - npm install --include=dev - npm test - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - name: Set up JDK 17 uses: actions/setup-java@v3 @@ -113,7 +102,7 @@ jobs: cp target/*.war /tmp/circle-webinar.war cd .. - - name: Build React application + - name: Build React application for conferencing env: CI: false NODE_OPTIONS: '--max-old-space-size=4096' @@ -129,7 +118,7 @@ jobs: rm -r webapp/src/main/webapp/static/* cp -a react/build/. webapp/src/main/webapp - - name: Build Maven project + - name: Build Maven project for conferencing run: | cd webapp mvn clean install -DskipTests -Dgpg.skip=true --quiet @@ -137,73 +126,226 @@ jobs: ls -alh target/ cp target/*.war /tmp/circle-conferencing.war cd .. - - - name: Install Test Tool + + - name: Create Test Tool run: | sudo apt-get update sudo apt-get install -y unzip iproute2 libva-drm2 libva-x11-2 libvdpau-dev ffmpeg git clone https://gitlab.com/Ant-Media/webrtc-test.git cd webrtc-test ./redeploy.sh - cp target/webrtc-load-test-tool-*.zip ../ cd .. - unzip webrtc-load-test-tool-*.zip - mkdir ~/test - mv webrtc-load-test ~/test - - - name: Install Selenium - run: | - wget https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.58/linux64/chromedriver-linux64.zip - unzip chromedriver-linux64.zip - sudo cp chromedriver-linux64/chromedriver /tmp - ls -al /tmp - pip3 install selenium==4.14 - pip3 install requests - pip3 show selenium - pip3 install psutil - - - name: Run Integration Test - run: | - cd test - python3 test_main.py ${{ secrets.STAGING_SERVER_URL }} ${{ secrets.USER_NAME }} ${{ secrets.PASSWORD }} /tmp/circle-conferencing.war false - - name: Run Integration Test for webinar - run: | - cd test - python3 test_main.py ${{ secrets.STAGING_SERVER_URL }} ${{ secrets.USER_NAME }} ${{ secrets.PASSWORD }} /tmp/circle-webinar.war true + - name: Cache Test Tool + uses: actions/cache@v3 + with: + path: webrtc-test/ + key: test-tool-${{ hashFiles('**/tool-source/**') }} + restore-keys: test-tool- - - name: Copy Logs From Pods - if: always() - run: | - for pod in $(kubectl -n circle get pods | grep "ant-media-server" | awk '{print $1}'); do - node_ip=$(kubectl -n circle get pods -o wide | grep "$pod" | awk '{print $6}') - kubectl -n circle cp $pod:/usr/local/antmedia/log/ant-media-server.log /tmp/ant-media-server-$node_ip.log - kubectl -n circle cp $pod:/usr/local/antmedia/log/antmedia-error.log /tmp/antmedia-error-$node_ip.log - done - - name: Upload PNG files as artifacts + - name: Upload conferencing war file as artifact if: always() uses: actions/upload-artifact@v4 with: - name: screenshots - path: ${{ github.workspace }}/test/**/*.png + name: circle-conferencing.war + path: /tmp/circle-conferencing.war - - name: Upload log files as artifacts + - name: Upload webinar war file as artifact if: always() uses: actions/upload-artifact@v4 with: - name: logs - path: /tmp/*.log + name: circle-webinar.war + path: /tmp/circle-webinar.war + + - name: Debug WAR file paths + run: ls -alh /tmp + + unit-tests: + needs: [build] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Run Unit Test + run: | + echo "pwd:" + pwd + echo "ls:" + ls -al + cd react + npm install --include=dev + npm test + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + + conference-integration-tests: + needs: [build] + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Restore Cached Test Tool + uses: actions/cache@v3 + with: + path: webrtc-test/ + key: test-tool-${{ hashFiles('**/tool-source/**') }} + restore-keys: test-tool- + + - name: Locate Test Tool + run: | + pwd + ls + cp webrtc-test/target/webrtc-load-test-tool-*.zip ../ + cd .. + unzip webrtc-load-test-tool-*.zip + mkdir ~/test + mv webrtc-load-test ~/test + + - name: Download circle-conferencing.war Artifact + uses: actions/download-artifact@v4 + with: + name: circle-conferencing.war + path: /tmp + + - name: Debug WAR file paths + run: ls -alh /tmp + + - name: Install Selenium + run: | + wget https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.58/linux64/chromedriver-linux64.zip + unzip chromedriver-linux64.zip + sudo cp chromedriver-linux64/chromedriver /tmp + ls -al /tmp + pip3 install selenium==4.14 + pip3 install requests + pip3 show selenium + pip3 install psutil + + - name: Run Integration Test + run: | + cd test + python3 test_main.py ${{ secrets.STAGING_SERVER_URL }} ${{ secrets.USER_NAME }} ${{ secrets.PASSWORD }} /tmp/circle-conferencing.war false + + - name: Upload PNG files as artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: screenshots + path: ${{ github.workspace }}/test/**/*.png + + webinar-integration-tests: + needs: [build] + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Restore Cached Test Tool + uses: actions/cache@v3 + with: + path: webrtc-test/ + key: test-tool-${{ hashFiles('**/tool-source/**') }} + restore-keys: test-tool- + + - name: Locate Test Tool + run: | + pwd + ls + cp webrtc-test/target/webrtc-load-test-tool-*.zip ../ + cd .. + unzip webrtc-load-test-tool-*.zip + mkdir ~/test + mv webrtc-load-test ~/test + + - name: Download circle-webinar.war Artifact + uses: actions/download-artifact@v4 + with: + name: circle-webinar.war + path: /tmp + + - name: Debug WAR file paths + run: ls -alh /tmp + + - name: Install Selenium + run: | + wget https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.58/linux64/chromedriver-linux64.zip + unzip chromedriver-linux64.zip + sudo cp chromedriver-linux64/chromedriver /tmp + ls -al /tmp + pip3 install selenium==4.14 + pip3 install requests + pip3 show selenium + pip3 install psutil + + - name: Run Integration Test for webinar + run: | + cd test + python3 test_main.py ${{ secrets.STAGING_SERVER_URL }} ${{ secrets.USER_NAME }} ${{ secrets.PASSWORD }} /tmp/circle-webinar.war true + + + collect-and-upload-logs: + needs: [unit-tests, webinar-integration-tests , conference-integration-tests] + if: always() + runs-on: ubuntu-latest + + steps: + - name: Upload PNG files as artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: screenshots + path: ${{ github.workspace }}/test/**/*.png + + - name: Copy Logs From Pods + if: always() + run: | + for pod in $(kubectl -n circle get pods | grep "ant-media-server" | awk '{print $1}'); do + node_ip=$(kubectl -n circle get pods -o wide | grep "$pod" | awk '{print $6}') + kubectl -n circle cp $pod:/usr/local/antmedia/log/ant-media-server.log /tmp/ant-media-server-$node_ip.log + kubectl -n circle cp $pod:/usr/local/antmedia/log/antmedia-error.log /tmp/antmedia-error-$node_ip.log + done + + - name: Upload log files as artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: logs + path: /tmp/*.log + + + deploy: + runs-on: ubuntu-latest + needs: collect-and-upload-logs + if: github.ref == 'refs/heads/main' + + steps: + - uses: actions/checkout@v3 + + - name: Build React application for conferencing + env: + CI: false + NODE_OPTIONS: '--max-old-space-size=4096' + run: | + cd react + mv .env.production.conferencing .env.production + sed -i "s#^REACT_APP_TURN_SERVER_URL=.*#REACT_APP_TURN_SERVER_URL=\"turn:${{ secrets.STAGING_TURN_URL }}\"#" .env.production + sed -i "s#^REACT_APP_TURN_SERVER_USERNAME=.*#REACT_APP_TURN_SERVER_USERNAME=\"${{ secrets.STAGING_TURN_USERNAME }}\"#" .env.production + sed -i "s#^REACT_APP_TURN_SERVER_CREDENTIAL=.*#REACT_APP_TURN_SERVER_CREDENTIAL=\"${{ secrets.STAGING_TURN_PASSWORD }}\"#" .env.production + npm install + npm run build + cd .. + rm -r webapp/src/main/webapp/static/* + cp -a react/build/. webapp/src/main/webapp - - name: Upload war files as artifacts - if: always() - uses: actions/upload-artifact@v4 - with: - name: wars - path: /tmp/*.war - - name: Publish to Maven Central - if: github.ref == 'refs/heads/main' run: | cd webapp ls -alh @@ -214,15 +356,6 @@ jobs: MAVEN_PASSWORD: ${{ secrets.MVN_PASSWORD }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MVN_GPG_PASSPHRASE }} - - deploy: - runs-on: ubuntu-latest - needs: build - if: github.ref == 'refs/heads/main' - - steps: - - uses: actions/checkout@v3 - - name: Get versions data from repo run: wget -O maven-metadata.xml https://oss.sonatype.org/service/local/repositories/snapshots/content/io/antmedia/ant-media-server/maven-metadata.xml - name: Install jq diff --git a/test/test_main.py b/test/test_main.py index 29be86d4..29aa5915 100644 --- a/test/test_main.py +++ b/test/test_main.py @@ -1,6 +1,8 @@ import test_join_leave import test_webinar from test_deployment import TestDeployment +from test_join_leave import TestJoinLeave + import unittest import sys @@ -12,21 +14,26 @@ os.environ['AMS_PASSWORD'] = sys.argv[3] os.environ['WAR_FILE'] = sys.argv[4] use_test_webinar = sys.argv[5].lower() == 'true' -os.environ['TEST_APP_NAME'] = "TestAPP"+str(random.randint(100, 999)) +app_name_prefix = "webinar" if use_test_webinar else "conference" +os.environ['TEST_APP_NAME'] = app_name_prefix + str(random.randint(100, 999)) + +#Keep it True to stop tests immediately after a failed test +fail_fast = False suite = unittest.TestSuite() suite.addTest(TestDeployment('test_install_app')) suite2 = None - if use_test_webinar: suite2 = unittest.TestLoader().loadTestsFromModule(test_webinar) else: suite2 = unittest.TestLoader().loadTestsFromModule(test_join_leave) suite.addTests(suite2) -suite.addTest(TestDeployment('test_delete_app')) -ret = not unittest.TextTestRunner(verbosity=2, failfast=True).run(suite).wasSuccessful() -sys.exit(ret) +#suite.addTest(TestJoinLeave("test_join_without_camera_mic")) + +suite.addTest(TestDeployment('test_delete_app')) +ret = not unittest.TextTestRunner(verbosity=2, failfast=fail_fast).run(suite).wasSuccessful() +sys.exit(ret) \ No newline at end of file From b29f233c8ab30e79f1a4065225e4e02408609069 Mon Sep 17 00:00:00 2001 From: burak Date: Mon, 9 Dec 2024 22:18:20 +0300 Subject: [PATCH 02/15] make fail fast --- test/test_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_main.py b/test/test_main.py index 29aa5915..96a295eb 100644 --- a/test/test_main.py +++ b/test/test_main.py @@ -18,7 +18,7 @@ os.environ['TEST_APP_NAME'] = app_name_prefix + str(random.randint(100, 999)) #Keep it True to stop tests immediately after a failed test -fail_fast = False +fail_fast = True suite = unittest.TestSuite() suite.addTest(TestDeployment('test_install_app')) From 6a5ee5d323bd238ed3ec47d5c2412ebd1b093803 Mon Sep 17 00:00:00 2001 From: burak Date: Mon, 9 Dec 2024 23:13:02 +0300 Subject: [PATCH 03/15] add sleep to webinar start --- .github/workflows/build-and-deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 1cbc44af..c99cfbed 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -287,6 +287,7 @@ jobs: - name: Run Integration Test for webinar run: | + sleep 10 cd test python3 test_main.py ${{ secrets.STAGING_SERVER_URL }} ${{ secrets.USER_NAME }} ${{ secrets.PASSWORD }} /tmp/circle-webinar.war true From ec66d7d4eb1581f984750bc4278bb3df52d24eb1 Mon Sep 17 00:00:00 2001 From: burak Date: Tue, 10 Dec 2024 06:38:02 +0300 Subject: [PATCH 04/15] improve test --- test/test_webinar.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_webinar.py b/test/test_webinar.py index 7e350ab5..def55405 100644 --- a/test/test_webinar.py +++ b/test/test_webinar.py @@ -143,6 +143,8 @@ def join_room_as_player(self, participant, room): app = "" handle = self.chrome.open_in_new_tab(self.url+app+"/"+room+"?playOnly=true&role=listener&streamName="+participant) + wait = self.chrome.get_wait() + #name_text_box = self.chrome.get_element_with_retry(By.ID,"participant_name") #self.chrome.write_to_element(name_text_box, participant) @@ -155,7 +157,7 @@ def join_room_as_player(self, participant, room): time.sleep(5) speedTestCircularProgress = self.chrome.get_element_with_retry(By.ID,"speed-test-modal-circle-progress-bar", retries=20) - assert(speedTestCircularProgress.is_displayed()) + wait.until(lambda x: speedTestCircularProgress.is_displayed()) time.sleep(5) From 2ea7ae52f365032579e6e2fa7fc1bec07e8fbf1c Mon Sep 17 00:00:00 2001 From: burak Date: Tue, 10 Dec 2024 07:09:31 +0300 Subject: [PATCH 05/15] check test tool availibility --- .github/workflows/build-and-deploy.yml | 1 + test/test_join_leave.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index c99cfbed..c411d35b 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -207,6 +207,7 @@ jobs: unzip webrtc-load-test-tool-*.zip mkdir ~/test mv webrtc-load-test ~/test + ls -al ~/test - name: Download circle-conferencing.war Artifact uses: actions/download-artifact@v4 diff --git a/test/test_join_leave.py b/test/test_join_leave.py index b31241d5..61a035e4 100644 --- a/test/test_join_leave.py +++ b/test/test_join_leave.py @@ -48,8 +48,8 @@ def create_participants_with_test_tool(self, participant_name, room, count): process = subprocess.Popen( ["bash", script_path] + parameters, cwd=directory, - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL + #stdout=subprocess.DEVNULL, + #stderr=subprocess.DEVNULL ) return process From 6f41753abd56066f7fed1b27444ebf9656986181 Mon Sep 17 00:00:00 2001 From: burak Date: Tue, 10 Dec 2024 07:22:43 +0300 Subject: [PATCH 06/15] install java 17 --- .github/workflows/build-and-deploy.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index c411d35b..5926e744 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -209,6 +209,17 @@ jobs: mv webrtc-load-test ~/test ls -al ~/test + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_PASSWORD # env variable for token in deploy + gpg-private-key: ${{ secrets.MVN_GPG_KEY }} # Value of the GPG private key to import + gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase + - name: Download circle-conferencing.war Artifact uses: actions/download-artifact@v4 with: From 401b4d14049137edd35e7a4c3ddec19f5ad95f9c Mon Sep 17 00:00:00 2001 From: Mustafa BOLEKEN Date: Tue, 10 Dec 2024 10:10:04 +0300 Subject: [PATCH 07/15] Get subtrack count when playback is started --- react/src/pages/AntMedia.js | 1 + 1 file changed, 1 insertion(+) diff --git a/react/src/pages/AntMedia.js b/react/src/pages/AntMedia.js index 68caf7f7..896774c8 100644 --- a/react/src/pages/AntMedia.js +++ b/react/src/pages/AntMedia.js @@ -1575,6 +1575,7 @@ function AntMedia(props) { setIsPlayed(true); setIsNoSreamExist(false); webRTCAdaptor?.getBroadcastObject(roomName); + webRTCAdaptor?.getSubtrackCount(roomName, null, null); webRTCAdaptor?.getSubtracks(roomName, null, globals.participantListPagination.offset, globals.participantListPagination.pageSize); requestVideoTrackAssignmentsInterval(); From 310b4d7333b21bb543cc3424071f14be30127662 Mon Sep 17 00:00:00 2001 From: Mustafa BOLEKEN Date: Tue, 10 Dec 2024 10:13:05 +0300 Subject: [PATCH 08/15] Update the color of mute button in the participant list --- react/src/Components/ParticipantTab.js | 2 +- react/src/styles/sprite.svg | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/react/src/Components/ParticipantTab.js b/react/src/Components/ParticipantTab.js index 71d73269..4ac7fcc9 100644 --- a/react/src/Components/ParticipantTab.js +++ b/react/src/Components/ParticipantTab.js @@ -63,7 +63,7 @@ function ParticipantTab(props) { onClick={() => { handleToggleMic(micMuted, streamId, name) } } > - + ) } diff --git a/react/src/styles/sprite.svg b/react/src/styles/sprite.svg index a0f984ea..ab5b7cb4 100644 --- a/react/src/styles/sprite.svg +++ b/react/src/styles/sprite.svg @@ -23,7 +23,7 @@ - + @@ -112,7 +112,7 @@ - + From 38aece6cb55071b8ead9dfe6ff328a2edf7a9ff0 Mon Sep 17 00:00:00 2001 From: Mustafa BOLEKEN Date: Tue, 10 Dec 2024 10:21:00 +0300 Subject: [PATCH 09/15] Make video overlay control configurable --- react/.env.production | 1 + react/.env.production.webinar | 1 + react/src/Components/Cards/VideoCard.js | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/react/.env.production b/react/.env.production index 1c31d149..983d5469 100644 --- a/react/.env.production +++ b/react/.env.production @@ -55,6 +55,7 @@ REACT_APP_TIME_ZONE_LIVE_TEXT_VISIBILITY=true # Video Overlay configurations REACT_APP_VIDEO_OVERLAY_ADMIN_MODE_ENABLED=false +REACT_APP_VIDEO_OVERLAY_ADMIN_CAMERA_CONTROL_ENABLED=false # Participant Tab configurations REACT_APP_PARTICIPANT_TAB_ADMIN_MODE_ENABLED=true diff --git a/react/.env.production.webinar b/react/.env.production.webinar index 4bf483ea..41eaf94e 100644 --- a/react/.env.production.webinar +++ b/react/.env.production.webinar @@ -55,6 +55,7 @@ REACT_APP_TIME_ZONE_LIVE_TEXT_VISIBILITY=true # Video Overlay configurations REACT_APP_VIDEO_OVERLAY_ADMIN_MODE_ENABLED=true +REACT_APP_VIDEO_OVERLAY_ADMIN_CAMERA_CONTROL_ENABLED=false # Speed Test configurations REACT_APP_SPEED_TEST_BEFORE_JOINING_THE_ROOM=true diff --git a/react/src/Components/Cards/VideoCard.js b/react/src/Components/Cards/VideoCard.js index bcd174d8..074ff7f8 100644 --- a/react/src/Components/Cards/VideoCard.js +++ b/react/src/Components/Cards/VideoCard.js @@ -113,7 +113,7 @@ function VideoCard(props) { return ( <> - {!useAvatar && ( + {(!useAvatar && process.env.REACT_APP_VIDEO_OVERLAY_ADMIN_MODE_ENABLED === "true") && ( From 0aa0053119b254554b1c52568e79b5c576ee606a Mon Sep 17 00:00:00 2001 From: Mustafa BOLEKEN Date: Tue, 10 Dec 2024 10:43:10 +0300 Subject: [PATCH 10/15] Cleanup removed participants --- react/src/pages/AntMedia.js | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/react/src/pages/AntMedia.js b/react/src/pages/AntMedia.js index 896774c8..10ffd28d 100644 --- a/react/src/pages/AntMedia.js +++ b/react/src/pages/AntMedia.js @@ -2277,6 +2277,8 @@ function AntMedia(props) { let tempVideoTrackAssignmentsNew = []; + let tempAllParticipants = {...allParticipants}; + // This function checks the case 1 and case 2 currentVideoTrackAssignments.forEach(tempVideoTrackAssignment => { let assignment; @@ -2295,14 +2297,13 @@ function AntMedia(props) { } } else { - console.log("---> Removed video track assignment: " + tempVideoTrackAssignment.videoLabel); + console.log("---> Removed video track assignment: " + tempVideoTrackAssignment.videoLabel, tempVideoTrackAssignment.streamId); + delete tempAllParticipants[tempVideoTrackAssignment.streamId]; } }); currentVideoTrackAssignments = [...tempVideoTrackAssignmentsNew]; - //let updateAllParticipants = {...allParticipants}; - // update participants according to current assignments receivedVideoTrackAssignments.forEach(vta => { let existingAssignment = currentVideoTrackAssignments.find(oldVTA => oldVTA.videoLabel === vta.videoLabel); @@ -2311,23 +2312,9 @@ function AntMedia(props) { existingAssignment.isReserved = vta.reserved; } if (!allParticipants[vta.trackId]) { - /* - updateAllParticipants[vta.trackId] = { - streamId: vta.trackId, - name: vta.trackId, - isScreenShared: false, - isPinned: false, - isFake: false, - isMine: false, - status: "livestream" - metaData: "{\"isMicMuted\":true,\"isCameraOn\":false,\"isScreenShared\":false,\"playOnly\":false}" - }; - */ webRTCAdaptor?.getBroadcastObject(vta.trackId); } }); - - //setAllParticipants(updateAllParticipants); checkScreenSharingStatus(); @@ -2335,7 +2322,10 @@ function AntMedia(props) { if (!_.isEqual(currentVideoTrackAssignments, videoTrackAssignments)) { setVideoTrackAssignments(currentVideoTrackAssignments); requestSyncAdministrativeFields(); - setParticipantUpdated(!participantUpdated); + } + if (!_.isEqual(tempAllParticipants, allParticipants)) { + setAllParticipants(tempAllParticipants); + setParticipantUpdated(!participantUpdated); } } else if (eventType === "AUDIO_TRACK_ASSIGNMENT") { From 272fd23e36956a8c5c26e8bfb3ec84af6cda6fd0 Mon Sep 17 00:00:00 2001 From: Mustafa BOLEKEN Date: Tue, 10 Dec 2024 10:59:17 +0300 Subject: [PATCH 11/15] Fix failed unit tests --- react/src/__tests__/pages/AntMedia.test.js | 1 + react/src/pages/AntMedia.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/react/src/__tests__/pages/AntMedia.test.js b/react/src/__tests__/pages/AntMedia.test.js index 42382280..03d61009 100644 --- a/react/src/__tests__/pages/AntMedia.test.js +++ b/react/src/__tests__/pages/AntMedia.test.js @@ -87,6 +87,7 @@ jest.mock('@antmedia/webrtc_adaptor', () => ({ enableEffect: jest.fn(), setSelectedVideoEffect: jest.fn(), setBlurEffectRange: jest.fn(), + getSubtrackCount: jest.fn(), } for (var key in params) { diff --git a/react/src/pages/AntMedia.js b/react/src/pages/AntMedia.js index 10ffd28d..b8ec6ddf 100644 --- a/react/src/pages/AntMedia.js +++ b/react/src/pages/AntMedia.js @@ -2297,7 +2297,7 @@ function AntMedia(props) { } } else { - console.log("---> Removed video track assignment: " + tempVideoTrackAssignment.videoLabel, tempVideoTrackAssignment.streamId); + console.log("---> Removed video track assignment: " + tempVideoTrackAssignment.videoLabel); delete tempAllParticipants[tempVideoTrackAssignment.streamId]; } }); From 9ecdc35c5bef98dbef26b78c7e23983190ab4f66 Mon Sep 17 00:00:00 2001 From: Mustafa BOLEKEN Date: Tue, 10 Dec 2024 11:36:35 +0300 Subject: [PATCH 12/15] Small refactor --- react/src/pages/AntMedia.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/react/src/pages/AntMedia.js b/react/src/pages/AntMedia.js index b8ec6ddf..5dd9d4ef 100644 --- a/react/src/pages/AntMedia.js +++ b/react/src/pages/AntMedia.js @@ -2302,6 +2302,8 @@ function AntMedia(props) { } }); + setAllParticipants(tempAllParticipants); + currentVideoTrackAssignments = [...tempVideoTrackAssignmentsNew]; // update participants according to current assignments @@ -2322,10 +2324,7 @@ function AntMedia(props) { if (!_.isEqual(currentVideoTrackAssignments, videoTrackAssignments)) { setVideoTrackAssignments(currentVideoTrackAssignments); requestSyncAdministrativeFields(); - } - if (!_.isEqual(tempAllParticipants, allParticipants)) { - setAllParticipants(tempAllParticipants); - setParticipantUpdated(!participantUpdated); + setParticipantUpdated(!participantUpdated); } } else if (eventType === "AUDIO_TRACK_ASSIGNMENT") { From 10a2fb2ac3960eae72c6ce31bdbdfcb3ffbd65f7 Mon Sep 17 00:00:00 2001 From: Mustafa BOLEKEN Date: Tue, 10 Dec 2024 11:45:04 +0300 Subject: [PATCH 13/15] Trigger CI From 2c737bafe6ad278dce6900cede35185512bd18a9 Mon Sep 17 00:00:00 2001 From: burak Date: Tue, 10 Dec 2024 21:16:27 +0300 Subject: [PATCH 14/15] install java before deploy --- .github/workflows/build-and-deploy.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 5926e744..0c01c78f 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -342,6 +342,17 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_PASSWORD # env variable for token in deploy + gpg-private-key: ${{ secrets.MVN_GPG_KEY }} # Value of the GPG private key to import + gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase + - name: Build React application for conferencing env: CI: false @@ -364,6 +375,7 @@ jobs: ls -alh ls -alh target/ mvn -e deploy -DskipTests --quiet --settings ../mvn-settings.xml + sleep 60 env: MAVEN_USERNAME: ${{ secrets.MVN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MVN_PASSWORD }} From b6a94af94a69173156a3b7006c028e0ddf93cf3f Mon Sep 17 00:00:00 2001 From: burak Date: Tue, 10 Dec 2024 21:56:20 +0300 Subject: [PATCH 15/15] fix yml file --- .github/workflows/build-and-deploy.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 0c01c78f..59a002db 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -343,15 +343,15 @@ jobs: - uses: actions/checkout@v3 - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: 'temurin' - server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml - server-username: MAVEN_USERNAME # env variable for username in deploy - server-password: MAVEN_PASSWORD # env variable for token in deploy - gpg-private-key: ${{ secrets.MVN_GPG_KEY }} # Value of the GPG private key to import - gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_PASSWORD # env variable for token in deploy + gpg-private-key: ${{ secrets.MVN_GPG_KEY }} # Value of the GPG private key to import + gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - name: Build React application for conferencing env: