-
Notifications
You must be signed in to change notification settings - Fork 474
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
Commit defs #758
base: main
Are you sure you want to change the base?
Commit defs #758
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
*~ | ||
lib/defs.js | ||
scratch | ||
node_modules/ | ||
bin/amqp-rabbitmq-0.9.1.json | ||
etc/ | ||
coverage/ | ||
/.idea/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,33 +9,36 @@ _MOCHA=./node_modules/.bin/_mocha | |
UGLIFY=./node_modules/.bin/uglifyjs | ||
NYC=./node_modules/.bin/nyc | ||
|
||
.PHONY: test test-all-nodejs all clean coverage | ||
.PHONY: test test-all-nodejs coverage lib/defs.js | ||
|
||
all: lib/defs.js | ||
error: | ||
@echo "Please choose one of the following targets: test, test-all-nodejs, coverage, lib/defs.js" | ||
@exit 1 | ||
|
||
clean: | ||
rm lib/defs.js bin/amqp-rabbitmq-0.9.1.json | ||
rm -rf ./coverage | ||
|
||
lib/defs.js: $(UGLIFY) bin/generate-defs.js bin/amqp-rabbitmq-0.9.1.json | ||
(cd bin; node ./generate-defs.js > ../lib/defs.js) | ||
$(UGLIFY) ./lib/defs.js -o ./lib/defs.js \ | ||
-c 'sequences=false' --comments \ | ||
-b 'indent-level=2' 2>&1 | (grep -v 'WARN' || true) | ||
|
||
test: lib/defs.js | ||
test: | ||
$(MOCHA) --check-leaks -u tdd --exit test/ | ||
|
||
test-all-nodejs: lib/defs.js | ||
test-all-nodejs: | ||
for v in $(NODEJS_VERSIONS); \ | ||
do echo "-- Node version $$v --"; \ | ||
nave use $$v $(MOCHA) -u tdd --exit -R progress test; \ | ||
done | ||
|
||
coverage: $(NYC) lib/defs.js | ||
$(NYC) --reporter=lcov --reporter=text $(_MOCHA) -u tdd -R progress test/ | ||
coverage: $(NYC) | ||
$(NYC) --clean --reporter=lcov --reporter=text $(_MOCHA) -u tdd --exit -R progress test/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of the clean target deleting the .coverage directory, I thought it better to have nyc do it. Mocha was hanging so I added the --exit argument There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is causing Mocha to hang? It's generally a good idea to avoid There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll see if I can work it out. Most likely a connection to the broker not being closed in one of the tests. |
||
@echo "HTML report at file://$$(pwd)/coverage/lcov-report/index.html" | ||
|
||
lib/defs.js: clean bin/generate-defs test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to be sure the new lib/defs.js were tested post generation |
||
|
||
clean: | ||
rm -f lib/defs.js bin/amqp-rabbitmq-0.9.1.json | ||
|
||
bin/generate-defs: $(UGLIFY) bin/generate-defs.js bin/amqp-rabbitmq-0.9.1.json | ||
(cd bin; node ./generate-defs.js > ../lib/defs.js) | ||
$(UGLIFY) ./lib/defs.js -o ./lib/defs.js \ | ||
-c 'sequences=false' --comments \ | ||
-b 'indent-level=2' 2>&1 | (grep -v 'WARN' || true) | ||
|
||
bin/amqp-rabbitmq-0.9.1.json: | ||
curl -L $(AMQP_JSON) > $@ | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced the default "all" target with an "error" target because we don't want people running make and unintentionally generating new lib/defs.js