Skip to content

Commit

Permalink
test/integration: clean up hanging 'threads' (#995)
Browse files Browse the repository at this point in the history
Resolves need for mocha's `--exit` flag, which the docs say:

> enables a set of potential problems; it’s indicative of tests (or fixtures,
> harnesses, code under test, etc.) which don’t clean up after themselves
> properly. Ultimately, "dirty" tests can (but not always) lead to _false
> positive_ or _false negative_ results.

Flag originally introduced in:

* 472383e
* ca08b53

Problems resolved:

1. shut down db pool cleanly
2. clean up yauzl streams (by avoiding them?)
  • Loading branch information
alxndrsn authored Oct 9, 2024
1 parent afbd30c commit f7be9dd
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 105 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,27 @@ debug: base

.PHONY: test
test: lint
BCRYPT=insecure npx mocha --recursive --exit
BCRYPT=insecure npx mocha --recursive

.PHONY: test-ci
test-ci: lint
BCRYPT=insecure npx mocha --recursive --exit --reporter test/ci-mocha-reporter.js
BCRYPT=insecure npx mocha --recursive --reporter test/ci-mocha-reporter.js

.PHONY: test-fast
test-fast: node_version
BCRYPT=insecure npx mocha --recursive --exit --fgrep @slow --invert
BCRYPT=insecure npx mocha --recursive --fgrep @slow --invert

.PHONY: test-integration
test-integration: node_version
BCRYPT=insecure npx mocha --recursive test/integration --exit
BCRYPT=insecure npx mocha --recursive test/integration

.PHONY: test-unit
test-unit: node_version
BCRYPT=insecure npx mocha --recursive test/unit --exit
BCRYPT=insecure npx mocha --recursive test/unit

.PHONY: test-coverage
test-coverage: node_version
npx nyc -x "**/migrations/**" --reporter=lcov node_modules/.bin/_mocha --exit --recursive test
npx nyc -x "**/migrations/**" --reporter=lcov node_modules/.bin/_mocha --recursive test

.PHONY: lint
lint: node_version
Expand Down
Loading

0 comments on commit f7be9dd

Please sign in to comment.