Skip to content

Commit

Permalink
ci: enable leak tests
Browse files Browse the repository at this point in the history
Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
  • Loading branch information
achrinza committed Nov 26, 2021
1 parent 8343d52 commit f8e8300
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 10 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@ jobs:
github-token: ${{ secrets.github_token }}
parallel-finished: true

test-leak:
name: Test (Leak Detection)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js v16
uses: actions/setup-node@v1
with:
node-version: 16
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.6.0
with:
mongodb-version: 4.4
- name: Update NPM
run: npm install --global npm@8
- name: Bootstrap project
run: npm ci
- name: Run test
run: make leak-detection

code-lint:
name: Code Lint
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ b benchmark benchmarks:

.PHONY: l ld leak leak-detection
l ld leak leak-detection:
npm i @airbnb/node-memwatch --no-save || npm i memwatch-next --no-save
@ITERATIONS=$(ITERATIONS) $(TESTER) leak-detection \
--recursive \
--reporter spec \
Expand Down
8 changes: 1 addition & 7 deletions leak-detection/leak-detector.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@

'use strict';

let memwatch;

try {
memwatch = require('@airbnb/node-memwatch');
} catch (e) {
memwatch = require('memwatch-next');
}
const memwatch = require('@airbnb/node-memwatch');
const sinon = require('sinon');

describe('leak detector', function() {
Expand Down
2 changes: 1 addition & 1 deletion leak-detection/mongodb.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

'use strict';

const memwatch = require('memwatch-next');
const memwatch = require('@airbnb/node-memwatch');
const sinon = require('sinon');
const Todo = require('./fixtures/todo');

Expand Down
69 changes: 68 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"strong-globalize": "^6.0.0"
},
"devDependencies": {
"@airbnb/node-memwatch": "^2.0.0",
"@commitlint/config-conventional": "^13.1.0",
"benchmark": "^2.1.4",
"bluebird": "^3.5.4",
Expand Down

0 comments on commit f8e8300

Please sign in to comment.