[Pkg-javascript-commits] [node-ws] 05/07: Enable tests

Ximin Luo infinity0 at debian.org
Sun Jan 17 12:09:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository node-ws.

commit c1a6a0858993f0ff06b02deae7e39cd281aeb296
Author: Ximin Luo <infinity0 at debian.org>
Date:   Sun Jan 17 12:36:54 2016 +0100

    Enable tests
---
 debian/TODO                                 |  2 --
 debian/changelog                            |  1 +
 debian/control                              |  3 +++
 debian/patches/disable-debian-failing-tests | 29 ++++++++++++++++++++++++++
 debian/patches/fix-failing-tests            | 16 +++++++++++++++
 debian/patches/generalise-makefile          | 32 +++++++++++++++++++++++++++++
 debian/patches/series                       |  3 +++
 debian/rules                                |  2 +-
 8 files changed, 85 insertions(+), 3 deletions(-)

diff --git a/debian/TODO b/debian/TODO
deleted file mode 100644
index d0157cc..0000000
--- a/debian/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-Later:
-- look into enabling tests (deps not yet in debian)
diff --git a/debian/changelog b/debian/changelog
index 01a34c4..28d5151 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ node-ws (1.0.1+ds1.e6ddaae4-1) UNRELEASED; urgency=medium
 
   * Use secure links for Vcs-* fields.
   * New upstream release.
+  * Enable tests.
 
  -- Ximin Luo <infinity0 at debian.org>  Sun, 17 Jan 2016 11:53:58 +0100
 
diff --git a/debian/control b/debian/control
index beceb61..6ac5cbf 100644
--- a/debian/control
+++ b/debian/control
@@ -7,10 +7,13 @@ Build-Depends:
  debhelper (>= 9.0.0),
  dh-buildinfo,
  help2man (>= 1.47.1),
+ mocha,
  nodejs (>= 4.0),
  node-commander,
+ node-expect.js,
  node-nan (>= 2.0.5),
  node-gyp,
+ node-should,
  node-tinycolor
 Standards-Version: 3.9.6
 Homepage: https://github.com/websockets/ws
diff --git a/debian/patches/disable-debian-failing-tests b/debian/patches/disable-debian-failing-tests
new file mode 100644
index 0000000..655f6ba
--- /dev/null
+++ b/debian/patches/disable-debian-failing-tests
@@ -0,0 +1,29 @@
+Description: Disable tests that fail on Debian
+Author: Ximin Luo <infinity0 at debian.org>
+Forwarded: not-needed
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/test/Validation.test.js
++++ b/test/Validation.test.js
+@@ -7,17 +7,19 @@
+       var validBuffer = new Buffer('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque gravida mattis rhoncus. Donec iaculis, metus quis varius accumsan, erat mauris condimentum diam, et egestas erat enim ut ligula. Praesent sollicitudin tellus eget dolor euismod euismod. Nullam ac augue nec neque varius luctus. Curabitur elit mi, consequat ultricies adipiscing mollis, scelerisque in erat. Phasellus facilisis fermentum ullamcorper. Nulla et sem eu arcu pharetra pellentesqu [...]
+       Validation.isValidUTF8(validBuffer).should.be.ok;
+     });
++    /* TODO: fails on node-should 4 (currently in debian) but succeeds on 8 (what package.json requires)
+     it('should return false for an erroneous string', function() {
+       var invalidBuffer = new Buffer([0xce, 0xba, 0xe1, 0xbd, 0xb9, 0xcf, 0x83, 0xce, 0xbc, 0xce, 0xb5, 0xed, 0xa0, 0x80, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64]);
+       Validation.isValidUTF8(invalidBuffer).should.not.be.ok;
+-    });
++    });*/
+     it('should return true for valid cases from the autobahn test suite', function() {
+       Validation.isValidUTF8(new Buffer('\xf0\x90\x80\x80')).should.be.ok;
+       Validation.isValidUTF8(new Buffer([0xf0, 0x90, 0x80, 0x80])).should.be.ok;
+     });
++    /* TODO: fails on node-should 4 (currently in debian) but succeeds on 8 (what package.json requires)
+     it('should return false for erroneous autobahn strings', function() {
+       Validation.isValidUTF8(new Buffer([0xce, 0xba, 0xe1, 0xbd])).should.not.be.ok;
+-    });
++    });*/
+   });
+ });
+ 
diff --git a/debian/patches/fix-failing-tests b/debian/patches/fix-failing-tests
new file mode 100644
index 0000000..68e5b5a
--- /dev/null
+++ b/debian/patches/fix-failing-tests
@@ -0,0 +1,16 @@
+Description: Fix failing tests
+Author: Ximin Luo <infinity0 at debian.org>
+Forwarded: https://github.com/websockets/ws/pull/671
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/test/WebSocketServer.test.js
++++ b/test/WebSocketServer.test.js
+@@ -5,7 +5,7 @@
+   , fs = require('fs')
+   , should = require('should');
+ 
+-var port = 8000;
++var port = 58000;
+ 
+ function getArrayBuffer(buf) {
+   var l = buf.length;
diff --git a/debian/patches/generalise-makefile b/debian/patches/generalise-makefile
new file mode 100644
index 0000000..04aa77f
--- /dev/null
+++ b/debian/patches/generalise-makefile
@@ -0,0 +1,32 @@
+Description: Generalise Makefile
+ Allow Makefile to use system-installed mocha
+Author: Ximin Luo <infinity0 at debian.org>
+Forwarded: https://github.com/websockets/ws/pull/671
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/Makefile
++++ b/Makefile
+@@ -1,5 +1,6 @@
+ ALL_TESTS = $(shell find test/ -name '*.test.js')
+ ALL_INTEGRATION = $(shell find test/ -name '*.integration.js')
++MOCHA = ./node_modules/.bin/mocha
+ 
+ all:
+ 	node-gyp configure build
+@@ -8,14 +9,14 @@
+ 	node-gyp clean
+ 
+ run-tests:
+-	@./node_modules/.bin/mocha \
++	@$(MOCHA) \
+ 		-t 5000 \
+ 		-s 2400 \
+ 		$(TESTFLAGS) \
+ 		$(TESTS)
+ 
+ run-integrationtests:
+-	@./node_modules/.bin/mocha \
++	@$(MOCHA) \
+ 		-t 5000 \
+ 		-s 6000 \
+ 		$(TESTFLAGS) \
diff --git a/debian/patches/series b/debian/patches/series
index 9248826..b1045cc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,6 @@
 nodejs-shebang
+generalise-makefile
 only-use-native
 rm-redundant-legacy-include
+disable-debian-failing-tests
+fix-failing-tests
diff --git a/debian/rules b/debian/rules
index 3bb271c..d70012e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,7 +18,7 @@ override_dh_auto_build:
 	debian/rules debian/wscat.1
 
 override_dh_auto_test:
-	echo "skipping tests; test dependencies not yet in debian"
+	dh_auto_test -- MOCHA=/usr/bin/mocha
 
 override_dh_installexamples:
 	dh_installexamples -X.gitignore

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-ws.git



More information about the Pkg-javascript-commits mailing list