Skip to content

Commit f4c497d

Browse files
committed
Merge branch 'main' into refactor/audio-param-automation-events
2 parents da040a8 + 7f23d22 commit f4c497d

10 files changed

Lines changed: 56 additions & 39 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ runs:
1919

2020
- name: Install cpplint
2121
shell: bash
22-
run: pip install 'cpplint==2.0.0'
22+
run: pip install 'cpplint==2.0.2'
2323

2424
- name: Install ktlint
2525
shell: bash
@@ -28,6 +28,17 @@ runs:
2828
chmod a+x ktlint
2929
sudo mv ktlint /usr/local/bin/
3030
31+
# .clang-format uses options added in clang-format 22 (BreakAfterOpenBracket*).
32+
# ubuntu-latest still defaults to an older binary; install 22
33+
- name: Install clang-format 22
34+
shell: bash
35+
run: |
36+
set -euo pipefail
37+
curl -fsSL https://apt.llvm.org/llvm.sh | sudo bash -s -- 22
38+
sudo apt-get install -y clang-format-22
39+
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-22 200
40+
clang-format --version
41+
3142
- name: Cache dependencies
3243
id: yarn-cache
3344
uses: actions/cache@v4

.github/workflows/tests.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,28 @@ on:
55
workflow_dispatch:
66

77
jobs:
8-
tests:
8+
cpp-tests:
99
runs-on: ubuntu-latest
1010
steps:
11-
1211
- name: Checkout
1312
uses: actions/checkout@v4
1413

1514
- name: Setup
1615
uses: ./.github/actions/setup
1716

18-
- name: Run tests
19-
run: yarn test
17+
- name: Run C++ tests
18+
working-directory: packages/react-native-audio-api
19+
run: yarn test:cpp
20+
21+
js-tests:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup
28+
uses: ./.github/actions/setup
2029

30+
- name: Run JS integration tests
31+
working-directory: packages/react-native-audio-api
32+
run: yarn test:js

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
"format": "yarn workspaces foreach -A -p run format",
1717
"clean": "del-cli packages/**/android/build apps/**/android/build apps/**/android/app/build apps/**/ios/build packages/**/lib node_modules apps/**/node_modules packages/**/node_modules",
1818
"typecheck": "yarn workspaces foreach -A -p run typecheck",
19-
"test": "bash packages/react-native-audio-api/common/cpp/test/RunTests.sh",
20-
"test:graph": "bash packages/react-native-audio-api/common/cpp/test/RunTestsGraph.sh",
21-
"test:graph:docker": "bash packages/react-native-audio-api/common/cpp/test/RunTestsGraphDocker.sh",
19+
"test": "yarn workspace react-native-audio-api run test",
2220
"check-audio-enum-sync": "bash packages/react-native-audio-api/scripts/check-audio-events-sync.sh"
2321
},
2422
"devDependencies": {

packages/react-native-audio-api/.clang-format

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
ColumnLimit: 100
33
AccessModifierOffset: -1
4-
AlignAfterOpenBracket: AlwaysBreak
4+
AlignAfterOpenBracket: false
55
AlignConsecutiveAssignments: false
66
AlignConsecutiveDeclarations: false
77
AlignEscapedNewlines: DontAlign
@@ -70,10 +70,14 @@ SpacesInSquareBrackets: false
7070
UseTab: Never
7171
---
7272
Language: Cpp
73+
BreakAfterOpenBracketBracedList: true
74+
BreakAfterOpenBracketFunction: true
7375
Standard: c++20
7476
---
7577
Language: ObjC
7678
BreakBeforeBraces: WebKit
7779
ObjCBlockIndentWidth: 2
7880
ObjCSpaceAfterProperty: true
7981
ObjCSpaceBeforeProtocolList: true
82+
BreakAfterOpenBracketBracedList: true
83+
BreakAfterOpenBracketFunction: true

packages/react-native-audio-api/.eslintrc.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ module.exports = {
55
{
66
files: ['./src/**/*.{ts,tsx}'],
77
},
8+
{
9+
files: ['./tests/**/*.{ts,tsx}'],
10+
parserOptions: {
11+
project: './tsconfig.test.json',
12+
tsconfigRootDir: __dirname,
13+
},
14+
},
815
],
9-
ignorePatterns: ['lib', 'src/web-core/custom/signalsmithStretch' ],
16+
ignorePatterns: ['lib', 'src/web-core/custom/signalsmithStretch'],
1017
};

packages/react-native-audio-api/common/cpp/test/RunTests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cleanup() {
99

1010
trap cleanup EXIT
1111

12-
cd packages/react-native-audio-api/common/cpp/test
12+
cd common/cpp/test
1313

1414
cmake -S . -B build -Wno-dev
1515

packages/react-native-audio-api/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@
4545
"app.plugin.js"
4646
],
4747
"scripts": {
48-
"test": "jest",
48+
"test": "yarn test:js && yarn test:cpp",
49+
"test:js": "jest",
50+
"test:cpp": "bash common/cpp/test/RunTests.sh",
51+
"test:full": "yarn test && yarn test:graph",
52+
"test:graph": "bash common/cpp/test/RunTestsGraph.sh",
53+
"test:graph:docker": "bash common/cpp/test/RunTestsGraphDocker.sh",
4954
"typecheck": "tsc --noEmit",
5055
"lint": "yarn lint:js && yarn lint:cpp && yarn lint:ios && yarn lint:kotlin",
5156
"lint:js": "eslint src && yarn prettier --check src",

packages/react-native-audio-api/tests/integration.test.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@ describe('Mock Integration Tests', () => {
231231
streamPath: 'https://example.com/audio-stream',
232232
});
233233

234-
expect(streamer.streamPath).toBe('https://example.com/audio-stream');
235-
236234
// Connect to output
237235
streamer.connect(context.destination);
238236

@@ -242,17 +240,6 @@ describe('Mock Integration Tests', () => {
242240
streamer.resume();
243241
streamer.stop();
244242
});
245-
246-
it('should handle streamer initialization errors', () => {
247-
const context = new MockAPI.AudioContext();
248-
const streamer = context.createStreamer();
249-
250-
// First initialization should succeed
251-
expect(streamer.initialize('http://stream1.com')).toBe(true);
252-
253-
// Second initialization should fail
254-
expect(() => streamer.initialize('http://stream2.com')).toThrow();
255-
});
256243
});
257244

258245
describe('System Integration', () => {

packages/react-native-audio-api/tests/mock.test.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -204,22 +204,11 @@ describe('React Native Audio API Mocks', () => {
204204

205205
describe('StreamerNode', () => {
206206
it('should create a StreamerNode', () => {
207-
const streamer = context.createStreamer();
207+
const streamer = context.createStreamer({
208+
streamPath: 'http://example.com/stream',
209+
});
208210
expect(streamer).toBeInstanceOf(MockAPI.StreamerNode);
209211
});
210-
211-
it('should support initialization with stream path', () => {
212-
const streamer = context.createStreamer();
213-
const result = streamer.initialize('http://example.com/stream');
214-
expect(result).toBe(true);
215-
expect(streamer.streamPath).toBe('http://example.com/stream');
216-
});
217-
218-
it('should throw error on duplicate initialization', () => {
219-
const streamer = context.createStreamer();
220-
streamer.initialize('http://example.com/stream');
221-
expect(() => streamer.initialize('http://example.com/other')).toThrow();
222-
});
223212
});
224213

225214
describe('WorkletNodes', () => {
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["src", "tests"]
4+
}

0 commit comments

Comments
 (0)