Skip to content

Commit b8b41a4

Browse files
committed
ci: enable leak tests
Signed-off-by: Rifa Achrinza <[email protected]>
1 parent 8343d52 commit b8b41a4

File tree

6 files changed

+91
-9
lines changed

6 files changed

+91
-9
lines changed

.github/workflows/continuous-integration.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,26 @@ jobs:
6363
github-token: ${{ secrets.github_token }}
6464
parallel-finished: true
6565

66+
test-leak:
67+
name: Test (Leak Detection)
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v2
71+
- name: Use Node.js v16
72+
uses: actions/setup-node@v1
73+
with:
74+
node-version: 16
75+
- name: Start MongoDB
76+
uses: supercharge/[email protected]
77+
with:
78+
mongodb-version: 4.4
79+
- name: Update NPM
80+
run: npm install --global npm@8
81+
- name: Bootstrap project
82+
run: npm ci --ignore-scripts
83+
- name: Run test
84+
run: make leak-detection
85+
6686
code-lint:
6787
name: Code Lint
6888
runs-on: ubuntu-latest

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ b benchmark benchmarks:
1919

2020
.PHONY: l ld leak leak-detection
2121
l ld leak leak-detection:
22-
npm i @airbnb/node-memwatch --no-save || npm i memwatch-next --no-save
2322
@ITERATIONS=$(ITERATIONS) $(TESTER) leak-detection \
2423
--recursive \
2524
--reporter spec \

leak-detection/leak-detector.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@
55

66
'use strict';
77

8-
let memwatch;
98

10-
try {
11-
memwatch = require('@airbnb/node-memwatch');
12-
} catch (e) {
13-
memwatch = require('memwatch-next');
14-
}
9+
const memwatch = require('@airbnb/node-memwatch');
1510
const sinon = require('sinon');
1611

1712
describe('leak detector', function() {

leak-detection/mongodb.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
'use strict';
77

8-
const memwatch = require('memwatch-next');
8+
const memwatch = require('@airbnb/node-memwatch');
99
const sinon = require('sinon');
1010
const Todo = require('./fixtures/todo');
1111

package-lock.json

Lines changed: 68 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"strong-globalize": "^6.0.0"
4242
},
4343
"devDependencies": {
44+
"@airbnb/node-memwatch": "^2.0.0",
4445
"@commitlint/config-conventional": "^13.1.0",
4546
"benchmark": "^2.1.4",
4647
"bluebird": "^3.5.4",

0 commit comments

Comments
 (0)