Skip to content

Commit 7d202e7

Browse files
committed
add isDarwinCI() and cleanup test cases
1 parent 04b54cb commit 7d202e7

5 files changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ jobs:
151151
OSN_ACCESS_KEY_ID: ${{secrets.AWS_RELEASE_ACCESS_KEY_ID}}
152152
OSN_SECRET_ACCESS_KEY: ${{secrets.AWS_RELEASE_SECRET_ACCESS_KEY}}
153153
RELEASE_NAME: ${{matrix.ReleaseName}}
154+
CI: true
154155
# Run even after test failures so the PR still gets the flaky summary.
155156
- name: Publish flaky test check
156157
if: ${{ always() }}

tests/osn-tests/src/test_osn_audio.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,14 @@ describe(testName, () => {
6666
for (const device of devices) {
6767
expect(device).to.have.property('id');
6868
expect(device).to.have.property('description');
69+
logInfo(testName, `Output Audio Device Found: ${device.description} with id: ${device.id}`);
6970
if (device.id === 'default') {
7071
foundDefaultDevice = true;
7172
}
7273
}
73-
expect(foundDefaultDevice).to.equal(true, GetErrorMessage(ETestErrorMsg.DefaultDeviceNotFound));
74+
if (!obs.isDarwinCI()) { // On virtual mac(s) the default output device is not included in the list of output devices
75+
expect(foundDefaultDevice).to.equal(true, GetErrorMessage(ETestErrorMsg.DefaultDeviceNotFound));
76+
}
7477
});
7578

7679
it('Get input audio devices', function() {
@@ -81,6 +84,7 @@ describe(testName, () => {
8184
for (const device of devices) {
8285
expect(device).to.have.property('id');
8386
expect(device).to.have.property('description');
87+
logInfo(testName, `Input Audio Device Found: ${device.description} with id: ${device.id}`);
8488
if (device.id === 'default') {
8589
foundDefaultDevice = true;
8690
}

tests/osn-tests/src/test_osn_video.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,5 +201,8 @@ describe(testName, () => {
201201
expect(device).to.have.property('description');
202202
logInfo(testName, `Output Video Device Found: ${device.description} with id: ${device.id}`);
203203
}
204+
if (!obs.isCI()) { // On CI the list of video devices is empty since there is no GPU. Just check that we got an array back and not worry about the contents
205+
expect(devices.length).to.be.greaterThan(0, GetErrorMessage(ETestErrorMsg.VideoDevicesEmpty));
206+
}
204207
});
205208
});

tests/osn-tests/util/error_messages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ export const enum ETestErrorMsg {
205205
DefaultDeviceNotFound = 'Did not find the default audio device in the list of audio devices',
206206
VideoDevices = 'Failed to get video devices',
207207
VideoDevicesIsArray = 'Returned video devices value is not an array',
208+
VideoDevicesEmpty = 'Returned video devices array is empty',
208209
}
209210

210211
export function GetErrorMessage(message: string, value1?: string, value2?: string, value3?: string): string {

tests/osn-tests/util/obs_handler.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,16 @@ export class OBSHandler {
553553

554554
isDarwin()
555555
{
556-
// Wrapped this in a function- just incase we want to add more conditions later or disable only within the build agent.
556+
// Wrapped this in a function- just in case we want to add more conditions later or disable only within the build agent.
557557
return this.os === 'darwin';
558558
}
559559

560+
isDarwinCI()
561+
{
562+
// Wrapped this in a function- just in case we want to add more conditions later or disable only within the build agent.
563+
return this.os === 'darwin' && this.ci;
564+
}
565+
560566
// is the build server environment
561567
isCI()
562568
{

0 commit comments

Comments
 (0)