Skip to content

Commit 6646926

Browse files
committed
Completed migration to mocha for integration tests
1 parent 244e959 commit 6646926

File tree

203 files changed

+3134
-23763
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+3134
-23763
lines changed

.github/actions/setup-integration-test/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ When an integration test or a browser compatibility test runs on GitHub actions,
55
To better perform these steps in a reusable manner we created this composite action. The composite action is called by other workflows to setup the host and then the workflows will run whatever test they are running.
66

77
## Steps Performed
8+
- Check if integration tests are needed based on changes
89
- Pack the Chime JS SDK and install the tarball into demo
9-
- Create a job ID
10+
- Create a job ID for SauceLabs
1011
- Set the job ID as an ENV variable
1112
- Echo job ID
1213
- Configure AWS credentials
13-
- Setup Sauce Connect
14-
- Install KITE
14+
- Setup Sauce Connect (for SauceLabs testing)
15+
- Setup Chrome (for local testing)
1516
- Clean install
17+
- Add testsite host to /etc/hosts (Linux only)
1618

1719
## Sauce Rest URL
1820
Sauce rest url is the datacenter endpoint used by Sauce Connect Proxy action as a parameter. The default url is https://saucelabs.com/rest/v1 and it is applicable for US-West region. The default url will be overwritten by calling workflows. You can learn more at [Data Center Endpoints](https://docs.saucelabs.com/basics/data-center-endpoints/#headless-us-east-data-center).

.github/actions/setup-integration-test/action.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,44 @@ runs:
3535
- name: Check if integration tests are needed
3636
id: test_needed
3737
run: |
38-
source ${GITHUB_WORKSPACE}/integration/js/script/need-integ-test
39-
check_if_integ_tests_required
38+
# Check if integration tests are required based on changed files
39+
base_branch=$(head -n 1 ${GITHUB_WORKSPACE}/.base-branch 2>/dev/null || echo "main")
40+
commits=$(git rev-list $base_branch.. 2>/dev/null || echo "")
41+
echo 'Commits:' $commits
42+
43+
requires_integration_test=false
44+
if [ -n "$commits" ]; then
45+
for commit in $commits
46+
do
47+
commit_files=$(git diff-tree --no-commit-id --name-only -r ${commit})
48+
echo 'Committed files are:' $commit_files
49+
matches=false
50+
for committed_file in $commit_files
51+
do
52+
while read -r stem
53+
do
54+
if [[ $stem =~ ^#.* ]]; then
55+
continue
56+
elif [[ $stem = "" ]]; then
57+
continue
58+
elif [[ $stem =~ ^!.* ]]; then
59+
stem_string="${stem:1}"
60+
if [[ $committed_file = $stem_string* ]]; then
61+
matches=false
62+
fi
63+
elif [[ $committed_file = $stem* ]]; then
64+
matches=true
65+
fi
66+
done < "${GITHUB_WORKSPACE}/.integration-watchlist"
67+
if [[ $matches = true ]]; then
68+
requires_integration_test=true
69+
break
70+
fi
71+
done
72+
done
73+
fi
74+
75+
echo 'Need integration test:' $requires_integration_test
4076
echo "integ_test_required=$requires_integration_test" >> $GITHUB_OUTPUT
4177
echo "Integration tests required: $requires_integration_test"
4278
shell: bash

.github/workflows/browser-compatibility-test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,7 @@ jobs:
4343
run: npm run test -- --test-name AudioTest --host saucelabs --test-type browser-compatibility
4444
- name: Run Video Test
4545
working-directory: ./integration/mocha-tests
46-
run: npm run test -- --test-name VideoTest --host saucelabs --test-type browser-compatibility
46+
run: npm run test -- --test-name VideoTest --host saucelabs --test-type browser-compatibility
47+
- name: Run Video Processing Test
48+
working-directory: ./integration/mocha-tests
49+
run: npm run test -- --test-name VideoProcessingTest --host saucelabs --test-type browser-compatibility

.github/workflows/continuous-integration.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,22 @@ jobs:
6767
if: steps.setup.outputs.integ_test_required == 'true'
6868
working-directory: ./integration/mocha-tests
6969
run: npm run test -- --test-name VideoTest --host local --test-type integration-test --headless true
70+
71+
video-processing-test:
72+
name: Video Processing Test
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Checkout Package
76+
uses: actions/checkout@v2
77+
with:
78+
fetch-depth: 0
79+
- name: Setup GitHub Actions Host
80+
id: setup
81+
uses: ./.github/actions/setup-integration-test
82+
with:
83+
aws-role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_SDK_DEV }}
84+
aws-role-session-name: ${{ env.TEST_TYPE }}
85+
- name: Run Video Processing Test
86+
if: steps.setup.outputs.integ_test_required == 'true'
87+
working-directory: ./integration/mocha-tests
88+
run: npm run test -- --test-name VideoProcessingTest --host local --test-type integration-test --headless true

.github/workflows/prev-version-integration.yaml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ jobs:
5656
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
5757
noSSLBumpDomains: all
5858
tunnelIdentifier: ${{ steps.create-job-id.outputs.uuid }}
59-
- name: Install Kite
60-
run: integration/js/script/install-kite
6159
- name: Setup
6260
run: git checkout tags/v${{ steps.prev.outputs.prev_version }}
6361
- name: Pack the Chime SDK and install the tarball into the Demo
@@ -69,19 +67,9 @@ jobs:
6967
npm install ../../amazon-chime-sdk-js-${{ steps.prev.outputs.prev_version }}.tgz
7068
- name: Clean Install
7169
run: npm ci
72-
- name: Run Audio Integration Test
73-
run: npm run test:integration-audio
74-
- name: Run Video Integ Test
75-
run: npm run test:integration-video
76-
- name: Run Content Share Integration Test Job One
77-
run: npm run test:integration-content-share-test-suite-one
78-
- name: Run Content Share Integration Test Job Two
79-
run: npm run test:integration-content-share-test-suite-two
80-
- name: Run Data Message Integration Test
81-
run: npm run test:integration-data-message
82-
- name: Run Meeting Readiness Checker Integration Test
83-
run: npm run test:integration-meeting-readiness-checker
84-
- name: Setup userArn
85-
run: integration/js/script/test-setup
86-
- name: Run Messaging Integration Test
87-
run: npm run test:integration-messaging
70+
- name: Run Audio Test
71+
working-directory: ./integration/mocha-tests
72+
run: npm run test -- --test-name AudioTest --host saucelabs --test-type browser-compatibility
73+
- name: Run Video Test
74+
working-directory: ./integration/mocha-tests
75+
run: npm run test -- --test-name VideoTest --host saucelabs --test-type browser-compatibility

.github/workflows/release-backwards-compatiblity.yml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,11 @@ jobs:
7474
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
7575
noSSLBumpDomains: all
7676
tunnelIdentifier: ${{ steps.create-job-id.outputs.uuid }}
77-
- name: Install Kite
78-
run: integration/js/script/install-kite
7977
- name: Clean Install
8078
run: npm ci
81-
- name: Run Audio Integration Test
82-
run: npm run test:integration-audio
83-
- name: Run Video Integ Test
84-
run: npm run test:integration-video
85-
- name: Run Content Share Integration Test Job One
86-
run: npm run test:integration-content-share-test-suite-one
87-
- name: Run Content Share Integration Test Job Two
88-
run: npm run test:integration-content-share-test-suite-two
89-
- name: Run Data Message Integration Test
90-
run: npm run test:integration-data-message
91-
- name: Run Meeting Readiness Checker Integration Test
92-
run: npm run test:integration-meeting-readiness-checker
93-
- name: Setup userArn
94-
run: integration/js/script/test-setup
95-
- name: Run Messaging Integration Test
96-
run: npm run test:integration-messaging
79+
- name: Run Audio Test
80+
working-directory: ./integration/mocha-tests
81+
run: npm run test -- --test-name AudioTest --host saucelabs --test-type browser-compatibility
82+
- name: Run Video Test
83+
working-directory: ./integration/mocha-tests
84+
run: npm run test -- --test-name VideoTest --host saucelabs --test-type browser-compatibility

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ demos/react/public/app.js
1717
dist
1818
doc
1919
integration-test-results/
20-
integration/js/logs/
21-
integration/js/node_modules
22-
integration/js/temp
23-
integration/kite-allure-reports
2420
integration/logs
2521
node_modules
2622
src/versioning/version.ts

.integration-watchlist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ integration/
88
!.eslintignore
99
!src/versioning/Versioning.ts
1010
!README.md
11-
!integration/js/README.md
1211
!demos/browser/README.md
1312
!demos/device/README.md
1413
!guides/

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- Updated to Typescript 5.x and node >= 20
2020
- Refactored Encoded Transform management into it's own component for better support of non-redundant audio transforms.
2121
- Add scalability mode fallback when SVC is enabled. Limit SVC for content share to AV1 temporal scalability only.
22+
- Completed migration to mocha tests
2223

2324
### Fixed
2425

demos/browser/app/meetingV2/meetingV2.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
EventAttributes,
4040
EventIngestionConfiguration,
4141
EventName,
42+
EventObserver,
4243
EventReporter,
4344
isAudioTransformDevice,
4445
isDestroyable,
@@ -121,6 +122,7 @@ export let fatal: (e: Error) => void;
121122
declare global {
122123
interface Window {
123124
webkitAudioContext: typeof AudioContext
125+
pendingEventObserver?: EventObserver
124126
}
125127
}
126128

@@ -1890,11 +1892,16 @@ export class DemoMeetingApp
18901892
configuration.keepLastFrameWhenPaused = true;
18911893
}
18921894

1895+
const eventController = new DefaultEventController(configuration, this.meetingLogger, this.eventReporter);
1896+
if (window.pendingEventObserver) {
1897+
eventController.addObserver(window.pendingEventObserver);
1898+
}
1899+
18931900
this.meetingSession = new DefaultMeetingSession(
18941901
configuration,
18951902
this.meetingLogger,
18961903
this.deviceController,
1897-
new DefaultEventController(configuration, this.meetingLogger, this.eventReporter)
1904+
eventController
18981905
);
18991906

19001907
const enableAudioRedundancy = !((document.getElementById('disable-audio-redundancy') as HTMLInputElement).checked);

0 commit comments

Comments
 (0)