Skip to content

Commit

Permalink
Remove code coverage from pr diff bot
Browse files Browse the repository at this point in the history
This is getting stuck somewhere while running the tests, so I've
temporarily disabled the code coverage checks to allow the browser size
check to run
  • Loading branch information
imjoehaines committed Dec 2, 2022
1 parent 8d607ca commit 4cb3ed8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/pr-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ jobs:
npm ci
npx lerna bootstrap
npm run build
npm run test:coverage
cat packages/browser/dist/bugsnag.min.js | wc -c > .diff/size-before-minified
cat packages/browser/dist/bugsnag.min.js | gzip | wc -c > .diff/size-before-gzipped
cp coverage/coverage-summary.json .diff/coverage-before.json
- name: Checkout PR branch
uses: actions/checkout@v1
Expand All @@ -41,10 +39,8 @@ jobs:
npm ci
npx lerna bootstrap
npm run build
npm run test:coverage
cat packages/browser/dist/bugsnag.min.js | wc -c > .diff/size-after-minified
cat packages/browser/dist/bugsnag.min.js | gzip | wc -c > .diff/size-after-gzipped
cp coverage/coverage-summary.json .diff/coverage-after.json
- name: Run danger
uses: danger/[email protected]
Expand Down
9 changes: 3 additions & 6 deletions dangerfile.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
/* global markdown */

const { readFileSync } = require('fs')
const coverageDiff = require('coverage-diff')

const before = {
minified: parseInt(readFileSync(`${__dirname}/.diff/size-before-minified`, 'utf8').trim()),
gzipped: parseInt(readFileSync(`${__dirname}/.diff/size-before-gzipped`, 'utf8').trim()),
coverage: JSON.parse(readFileSync(`${__dirname}/.diff/coverage-before.json`, 'utf8'))
gzipped: parseInt(readFileSync(`${__dirname}/.diff/size-before-gzipped`, 'utf8').trim())
}

const after = {
minified: parseInt(readFileSync(`${__dirname}/.diff/size-after-minified`, 'utf8').trim()),
gzipped: parseInt(readFileSync(`${__dirname}/.diff/size-after-gzipped`, 'utf8').trim()),
coverage: JSON.parse(readFileSync(`${__dirname}/.diff/coverage-after.json`, 'utf8'))
gzipped: parseInt(readFileSync(`${__dirname}/.diff/size-after-gzipped`, 'utf8').trim())
}

const formatKbs = (n) => `${(n / 1000).toFixed(2)} kB`
Expand All @@ -36,5 +33,5 @@ markdown(`
### code coverage diff
${coverageDiff.diff(before.coverage, after.coverage).results}
<_temporarily disabled_>
`)

0 comments on commit 4cb3ed8

Please sign in to comment.