update tests to run against some io.js versions. Minor test case fix for io.js slight diff to 0.12.

This commit is contained in:
Trent Mick 2015-06-07 11:06:50 -07:00
parent 3f8ff80c8c
commit 5d666f49f1
4 changed files with 40 additions and 16 deletions

View file

@ -6,8 +6,12 @@ Known issues:
bug](https://github.com/TooTallNate/node-gyp/issues/65). bug](https://github.com/TooTallNate/node-gyp/issues/65).
## bunyan 1.3.7 (not yet released) ## bunyan 1.4.0 (not yet released)
(Bumping minor ver b/c I'm wary of dtrace-provider changes. :)
- [issue #258, pull #259] Update to dtrace-provider 0.5 to fix
install and tests on recent io.js versions.
- safe-json-stringify@1.0.3 changed output, breaking some tests. Fix those. - safe-json-stringify@1.0.3 changed output, breaking some tests. Fix those.

View file

@ -87,22 +87,37 @@ test: $(NODEUNIT)
# Note: 'test10' is last so (if all is well) I end up with a binary # Note: 'test10' is last so (if all is well) I end up with a binary
# dtrace-provider build for node 0.10 (my current version). # dtrace-provider build for node 0.10 (my current version).
.PHONY: testall .PHONY: testall
testall: test11 test08 test10 testall: test22 test20 test18 test012 test08 test010
.PHONY: test11 .PHONY: test22
test11: test22:
@echo "# Test node 0.11.x (with node `$(NODEOPT)/node-0.11/bin/node --version`)" @echo "# Test iojs 2.2.x (with node `$(NODEOPT)/iojs-v2.2/bin/node --version`)"
@$(NODEOPT)/node-0.11/bin/node --version @$(NODEOPT)/iojs-v2.2/bin/node --version | grep '^v2\.2\.'
PATH="$(NODEOPT)/node-0.11/bin:$(PATH)" make distclean all test #PATH="$(NODEOPT)/iojs-v2.2/bin:$(PATH)" make distclean all test
.PHONY: test10 .PHONY: test20
test10: test20:
@echo "# Test iojs 2.0.x (with node `$(NODEOPT)/iojs-v2.0/bin/node --version`)"
@$(NODEOPT)/iojs-v2.0/bin/node --version | grep '^v2\.0\.'
PATH="$(NODEOPT)/iojs-v2.0/bin:$(PATH)" make distclean all test
.PHONY: test18
test18:
@echo "# Test iojs 1.8.x (with node `$(NODEOPT)/iojs-v1.8/bin/node --version`)"
@$(NODEOPT)/iojs-v1.8/bin/node --version | grep '^v1\.8\.'
PATH="$(NODEOPT)/iojs-v1.8/bin:$(PATH)" make distclean all test
.PHONY: test012
test012:
@echo "# Test node 0.12.x (with node `$(NODEOPT)/node-0.12/bin/node --version`)"
@$(NODEOPT)/node-0.12/bin/node --version | grep '^v0\.12\.'
PATH="$(NODEOPT)/node-0.12/bin:$(PATH)" make distclean all test
.PHONY: test010
test010:
@echo "# Test node 0.10.x (with node `$(NODEOPT)/node-0.10/bin/node --version`)" @echo "# Test node 0.10.x (with node `$(NODEOPT)/node-0.10/bin/node --version`)"
@$(NODEOPT)/node-0.10/bin/node --version @$(NODEOPT)/node-0.10/bin/node --version | grep '^v0\.10\.'
PATH="$(NODEOPT)/node-0.10/bin:$(PATH)" make distclean all test PATH="$(NODEOPT)/node-0.10/bin:$(PATH)" make distclean all test
.PHONY: test08 .PHONY: test08
test08: test08:
@echo "# Test node 0.8.x (with node `$(NODEOPT)/node-0.8/bin/node --version`)" @echo "# Test node 0.8.x (with node `$(NODEOPT)/node-0.8/bin/node --version`)"
@$(NODEOPT)/node-0.8/bin/node --version @$(NODEOPT)/node-0.8/bin/node --version | grep '^v0\.8\.'
PATH="$(NODEOPT)/node-0.8/bin:$(PATH)" make distclean all test PATH="$(NODEOPT)/node-0.8/bin:$(PATH)" make distclean all test

View file

@ -1,6 +1,6 @@
{ {
"name": "bunyan", "name": "bunyan",
"version": "1.3.7", "version": "1.4.0",
"description": "a JSON logging library for node.js services", "description": "a JSON logging library for node.js services",
"author": "Trent Mick <trentm@gmail.com> (http://trentm.com)", "author": "Trent Mick <trentm@gmail.com> (http://trentm.com)",
"main": "./lib/bunyan.js", "main": "./lib/bunyan.js",

View file

@ -160,10 +160,15 @@ test('simple.log doesnotexist1.log doesnotexist2.log', function (t) {
// ENOENT, no such file or directory 'asdf.log' // ENOENT, no such file or directory 'asdf.log'
// but node v0.6.14: // but node v0.6.14:
// ENOENT, open 'asdf.log' // ENOENT, open 'asdf.log'
// Somewhat annoying change. // io.js 2.2 (at least):
t.equal(stderr, // ENOENT: no such file or directory, open 'doesnotexist1.log'
'bunyan: ENOENT, open \'doesnotexist1.log\'\nbunyan: ENOENT, ' var matches = [
+ 'open \'doesnotexist2.log\'\n'); /^bunyan: ENOENT.*?, open 'doesnotexist1.log'/m,
/^bunyan: ENOENT.*?, open 'doesnotexist2.log'/m,
];
matches.forEach(function (match) {
t.ok(match.test(stderr), 'stderr matches ' + match.toString());
});
t.end(); t.end();
} }
); );