提交 b1993e51 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Add `gulp test` that runs both the API test and the worker test.

上级 1f46601f
...@@ -63,12 +63,12 @@ before_script: ...@@ -63,12 +63,12 @@ before_script:
- npm install -g gulp-cli - npm install -g gulp-cli
script: script:
- gulp test-api - gulp test
- gulp test-worker
notifications: notifications:
email: email:
recipients: recipients:
- ibc@aliax.net - ibc@aliax.net
- jmillan@aliax.net
on_success: change on_success: change
on_failure: always on_failure: always
...@@ -62,16 +62,20 @@ Validates the JavaScript code. ...@@ -62,16 +62,20 @@ Validates the JavaScript code.
Reads **mediasoup** [supported RTP capabilities](https://github.com/ibc/mediasoup/blob/master/lib/supportedRtpCapabilities.js) and inserts them into the worker C++ code. After that, `make Release` and/or `make Debug` must be called. Reads **mediasoup** [supported RTP capabilities](https://github.com/ibc/mediasoup/blob/master/lib/supportedRtpCapabilities.js) and inserts them into the worker C++ code. After that, `make Release` and/or `make Debug` must be called.
### `gulp test-api` ### `gulp test:api`
Runs the JavaScript [test units](test/). Before it, it invokes the `make` command. Runs the JavaScript [test units](test/). Before it, it invokes the `make` command.
In order to run the JavaScript test units with the mediasoup worker in `Debug` mode the `MEDIASOUP_BUILDTYPE` environment variable must be set to `Debug`: In order to run the JavaScript test units with the mediasoup worker in `Debug` mode the `MEDIASOUP_BUILDTYPE` environment variable must be set to `Debug`:
```bash ```bash
$ MEDIASOUP_BUILDTYPE=Debug gulp test-debug $ MEDIASOUP_BUILDTYPE=Debug gulp test:debug
``` ```
### `gulp test-worker` ### `gulp test:worker`
Runs the mediasoup worker [test units](worker/test/) in `Debug` mode. Before it, it invokes the `make test` command. Runs the mediasoup worker [test units](worker/test/) in `Debug` mode. Before it, it invokes the `make test` command.
### `gulp test`
Runs both the `test:api` and `test:worker` gulp tasks.
...@@ -9,12 +9,12 @@ const shell = require('gulp-shell'); ...@@ -9,12 +9,12 @@ const shell = require('gulp-shell');
let tests = let tests =
[ [
'test/test_mediasoup.js', 'test/test_mediasoup.js',
// 'test/test_Server.js', 'test/test_Server.js',
// 'test/test_Room.js', 'test/test_Room.js',
// 'test/test_Peer.js', 'test/test_Peer.js',
// 'test/test_Transport.js', 'test/test_Transport.js',
// 'test/test_RtpReceiver.js', 'test/test_RtpReceiver.js',
// 'test/test_extra.js' 'test/test_extra.js'
// NOTE: Disable this test until fixed // NOTE: Disable this test until fixed
// 'test/test_scene_1.js' // 'test/test_scene_1.js'
]; ];
...@@ -46,7 +46,7 @@ gulp.task('rtpcapabilities', () => ...@@ -46,7 +46,7 @@ gulp.task('rtpcapabilities', () =>
.pipe(touch()); .pipe(touch());
}); });
gulp.task('test-api', shell.task( gulp.task('test:api', shell.task(
[ [
'if type make &> /dev/null; then make; fi', 'if type make &> /dev/null; then make; fi',
`tap --bail --color --reporter=spec ${tests.join(' ')}` `tap --bail --color --reporter=spec ${tests.join(' ')}`
...@@ -57,7 +57,7 @@ gulp.task('test-api', shell.task( ...@@ -57,7 +57,7 @@ gulp.task('test-api', shell.task(
} }
)); ));
gulp.task('test-worker', shell.task( gulp.task('test:worker', shell.task(
[ [
'if type make &> /dev/null; then make test; fi', 'if type make &> /dev/null; then make test; fi',
'worker/out/Debug/mediasoup-worker-test' 'worker/out/Debug/mediasoup-worker-test'
...@@ -66,3 +66,5 @@ gulp.task('test-worker', shell.task( ...@@ -66,3 +66,5 @@ gulp.task('test-worker', shell.task(
verbose : true verbose : true
} }
)); ));
gulp.task('test', gulp.series('test:api', 'test:worker'));
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论