Skip to content

Commit

Permalink
CI : Github action improvement (#744)
Browse files Browse the repository at this point in the history
* enhance sleep

* adding coverall

* add cov-ci

* review
  • Loading branch information
zekth authored and mcollina committed Nov 18, 2019
1 parent edaedec commit 29a2419
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
25 changes: 18 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,22 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm i
- name: Tests
run: npm run test
coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install
run: npm i
- name: run with coverage
if: (!startsWith(matrix.os, 'windows'))
run: npm run ci
# Windows just pass the test without checking the Coverage
# Due to skipped tests
- name: run without coverage
if: startsWith(matrix.os, 'windows')
run: npm run test
run: npm run cov-ci
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"browser-test": "airtap --local 8080 test/browser*test.js",
"test": "standard | snazzy && cross-env NODE_OPTIONS=\"--no-warnings -r qodaa\" tap --no-esm -j 4 --no-cov test/*test.js",
"ci": "standard | snazzy && cross-env TAP_TIMEOUT=480000 NODE_OPTIONS=\"--no-warnings -r qodaa\" tap --no-esm -j 4 --100 test/*test.js",
"cov-ci": "cross-env TAP_TIMEOUT=480000 NODE_OPTIONS=\"--no-warnings -r qodaa\" tap --no-esm -j 4 --100 --coverage-report=lcov test/*test.js",
"cov-ui": "cross-env NODE_OPTIONS=\"--no-warnings -r qodaa\" tap --no-esm -j 4 --coverage-report=html test/*test.js",
"bench": "node benchmarks/utils/runbench all",
"bench-basic": "node benchmarks/utils/runbench basic",
Expand Down
8 changes: 4 additions & 4 deletions test/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ test('pino.destination', async ({ same }) => {
)
const instance = pino(pino.destination(tmp))
instance.info('hello')
await sleep(250)
await sleep(300)
const result = JSON.parse(readFileSync(tmp).toString())
delete result.time
same(result, {
Expand All @@ -498,7 +498,7 @@ test('auto pino.destination with a string', async ({ same }) => {
)
const instance = pino(tmp)
instance.info('hello')
await sleep(250)
await sleep(300)
const result = JSON.parse(readFileSync(tmp).toString())
delete result.time
same(result, {
Expand All @@ -517,7 +517,7 @@ test('auto pino.destination with a string as second argument', async ({ same })
)
const instance = pino(null, tmp)
instance.info('hello')
await sleep(250)
await sleep(300)
const result = JSON.parse(readFileSync(tmp).toString())
delete result.time
same(result, {
Expand All @@ -538,7 +538,7 @@ test('does not override opts with a string as second argument', async ({ same })
timestamp: () => ',"time":"none"'
}, tmp)
instance.info('hello')
await sleep(250)
await sleep(300)
const result = JSON.parse(readFileSync(tmp).toString())
same(result, {
pid: pid,
Expand Down

0 comments on commit 29a2419

Please sign in to comment.