Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 843e57f

Browse files
authored
Merge pull request #1234 from fluent-ffmpeg/chore/coverage
chore: coverage using nyc+coveralls
2 parents 4bb6643 + 1ebc5eb commit 843e57f

File tree

8 files changed

+1288
-384
lines changed

8 files changed

+1288
-384
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: CI Testing
2-
on: pull_request
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
37
jobs:
48
test:
59
runs-on: ubuntu-latest
@@ -12,7 +16,7 @@ jobs:
1216
- name: Install flvtool2
1317
run: sudo gem install flvtool2
1418
- name: Install ffmpeg
15-
run: sudo apt update && sudo apt install -y ffmpeg
19+
run: sudo apt install -y ffmpeg
1620
- name: Setup node
1721
uses: actions/setup-node@v3
1822
with:
@@ -22,3 +26,21 @@ jobs:
2226
run: yarn
2327
- name: Run tests
2428
run: yarn test
29+
- name: Generate coverage report
30+
run: yarn coverage
31+
- name: Store coverage
32+
uses: coverallsapp/github-action@v2
33+
with:
34+
flag-name: linux-node-${{ matrix.node }}
35+
parallel: true
36+
37+
finish:
38+
needs: test
39+
if: ${{ always() }}
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Coveralls Finished
43+
uses: coverallsapp/github-action@v2
44+
with:
45+
parallel-finished: true
46+
carryforward: "linux-node-18,linux-node-20,linux-node-21"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.project
22
node_modules
3-
lib-cov
3+
.nyc_output
44
*.swp
55
.idea
66
*.iml
7+
coverage

Makefile

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ test:
77
test-colors:
88
@NODE_ENV=test $(MOCHA) --require should --reporter $(REPORTER) --colors
99

10-
test-cov: test/coverage.html
11-
12-
test/coverage.html: lib-cov
13-
@FLUENTFFMPEG_COV=1 NODE_ENV=test $(MOCHA) --require should --reporter html-cov > test/coverage.html
14-
15-
lib-cov:
16-
@rm -fr ./$@
17-
@jscoverage lib $@
18-
1910
publish:
2011
@npm version patch -m "version bump"
2112
@npm publish
@@ -26,4 +17,4 @@ JSDOC_CONF = tools/jsdoc-conf.json
2617
doc:
2718
$(JSDOC) --configure $(JSDOC_CONF)
2819

29-
.PHONY: test test-cov lib-cov test-colors publish doc
20+
.PHONY: test test-colors publish doc

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,12 +1459,6 @@ To run unit tests, first make sure you installed npm dependencies (run `npm inst
14591459
$ make test
14601460
```
14611461

1462-
If you want to re-generate the test coverage report (filed under test/coverage.html), run
1463-
1464-
```sh
1465-
$ make test-cov
1466-
```
1467-
14681462
Make sure your ffmpeg installation is up-to-date to prevent strange assertion errors because of missing codecs/bugfixes.
14691463

14701464
## Main contributors

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require(`./lib${process.env.FLUENTFFMPEG_COV ? '-cov' : ''}/fluent-ffmpeg`);
1+
module.exports = require('./lib/fluent-ffmpeg');

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
},
2020
"repository": "git://github.com/fluent-ffmpeg/node-fluent-ffmpeg.git",
2121
"devDependencies": {
22+
"jsdoc": "^4.0.0",
2223
"mocha": "^10.0.0",
23-
"should": "^13.0.0",
24-
"jsdoc": "^4.0.0"
24+
"nyc": "^15.1.0",
25+
"should": "^13.0.0"
2526
},
2627
"dependencies": {
2728
"async": "^0.2.9",
@@ -32,6 +33,7 @@
3233
},
3334
"main": "index",
3435
"scripts": {
35-
"test": "make test"
36+
"test": "NODE_ENV=test nyc mocha --require should --reporter spec",
37+
"coverage": "nyc report --reporter=lcov"
3638
}
3739
}

test/coverage.html

Lines changed: 0 additions & 355 deletions
This file was deleted.

0 commit comments

Comments
 (0)