Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove code coverage from pr diff bot #1882

Merged
merged 1 commit into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_>
`)