Skip to content
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

re-enable client integration tests #301

Merged
merged 1 commit into from Jun 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion .travis.yml
@@ -1,4 +1,4 @@
sudo: false
sudo: required

language: node_js

Expand All @@ -8,4 +8,16 @@ node_js:
- '5'
- '6'

before_install:
- sudo apt-get update
- sudo apt-get install prosody # luarocks
- sudo service prosody stop
# - sudo luarocks install luabitop
- sudo cp test/resources/prosody.cfg.lua /etc/prosody/prosody.cfg.lua
- sudo cp test/resources/mod_websocket.lua /usr/lib/prosody/modules/

script:
- npm run test
- npm run integration

after_script: npm run coveralls
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -15,7 +15,8 @@
"lint": "standard",
"unit": "mocha --recursive packages/*/test/ -t 5000",
"bootstrap": "lerna bootstrap",
"test": "npm run unit && npm run lint && lerna run test && npm run coverage",
"integration": "mocha --recursive test/integration -t 5000",
"test": "npm run coverage && npm run lint && lerna run test",
"coverage": "istanbul cover _mocha --report lcovonly -- -R spec --recursive packages/*/test/ -t 5000",
"coveralls": "cat ./coverage/lcov.info | coveralls && rm -rf ./coverage"
}
Expand Down
22 changes: 0 additions & 22 deletions packages/node-xmpp-client/.travis.yml

This file was deleted.

17 changes: 1 addition & 16 deletions packages/node-xmpp-client/Gruntfile.js
Expand Up @@ -5,19 +5,6 @@ var helper = require('./test/helper')
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
mochacli: {
unit: {
options: { files: [ './test/unit/**/*.js' ] }
},
integration: {
options: { files: [ './test/integration/**/*.js' ] }
},
options: {
reporter: 'spec',
ui: 'tdd',
timeout: 10000
}
},
mocha_phantomjs: {
all: ['test/browser/**/*.html']
},
Expand All @@ -37,14 +24,12 @@ module.exports = function (grunt) {
})

// Load the plugins
grunt.loadNpmTasks('grunt-mocha-cli')
grunt.loadNpmTasks('grunt-mocha-phantomjs')
grunt.loadNpmTasks('grunt-contrib-connect')

// Configure tasks
grunt.registerTask('default', ['test'])
grunt.registerTask('test', ['mochacli:unit'])
grunt.registerTask('integration-test', ['mochacli:integration', 'test'])
grunt.registerTask('integration-test', ['test'])
grunt.registerTask('browser-test', ['connect', 'prosody-start', 'mocha_phantomjs', 'prosody-stop'])
grunt.registerTask('full-test', ['test', 'integration-test', 'browser-test'])
grunt.registerTask('dev', ['connect'])
Expand Down
4 changes: 1 addition & 3 deletions packages/node-xmpp-client/lib/Client.js
Expand Up @@ -179,9 +179,7 @@ Client.prototype._connectViaBosh = function () {
debug('load bosh prebind')
var cb = this.options.bosh.prebind
delete this.options.bosh.prebind
var cmd = 'node ' + path.join(__dirname, 'prebind.js')
delete this.options.bosh.prebind
cmd += encodeURI(JSON.stringify(this.options))
var cmd = 'node ' + path.join(__dirname, 'prebind.js') + ' ' + encodeURI(JSON.stringify(this.options))
exec(
cmd,
function (error, stdout, stderr) {
Expand Down
1 change: 0 additions & 1 deletion packages/node-xmpp-client/package.json
Expand Up @@ -32,7 +32,6 @@
"grunt": "^0.4.5",
"grunt-cli": "^1.2.0",
"grunt-contrib-connect": "0.11.2",
"grunt-mocha-cli": "^2.0.0",
"grunt-mocha-phantomjs": "^2.0.0",
"node-xmpp-server": "^2.1.3"
},
Expand Down
Expand Up @@ -2,7 +2,7 @@

'use strict'

var Anonymous = require('../../../../lib/authentication/anonymous')
var Anonymous = require('../../lib/authentication/anonymous')

var mech = new Anonymous()

Expand Down
Expand Up @@ -2,7 +2,7 @@

'use strict'

var DigestMD5 = require('../../../../lib/authentication/digestmd5')
var DigestMD5 = require('../../lib/authentication/digestmd5')

var mech = new DigestMD5()

Expand Down
Expand Up @@ -2,7 +2,7 @@

'use strict'

var External = require('../../../../lib/authentication/external')
var External = require('../../lib/authentication/external')

var mech = new External()

Expand Down
Expand Up @@ -2,7 +2,7 @@

'use strict'

var Plain = require('../../../../lib/authentication/plain')
var Plain = require('../../lib/authentication/plain')

var mech = new Plain()

Expand Down
Expand Up @@ -2,7 +2,7 @@

'use strict'

var XOAuth2 = require('../../../../lib/authentication/xoauth2')
var XOAuth2 = require('../../lib/authentication/xoauth2')

var mech = new XOAuth2()

Expand Down
Expand Up @@ -2,7 +2,7 @@

'use strict'

var Client = require('../../index')
var Client = require('../index')
var assert = require('assert')
var C2SServer = require('node-xmpp-server').C2SServer

Expand Down
Expand Up @@ -7,7 +7,7 @@ var C2SServer = nodexmppserver.C2SServer
var Stanza = require('node-xmpp-core').Stanza
var net = require('net')
var util = require('util')
var Client = require('../../index')
var Client = require('../index')
var Plain = nodexmppserver.auth.Plain
var XOAuth2 = nodexmppserver.auth.XOAuth2
var DigestMD5 = nodexmppserver.auth.DigestMD5
Expand Down
Expand Up @@ -2,7 +2,7 @@

'use strict'

var Client = require('../../index')
var Client = require('../index')
var net = require('net')
var ltx = Client.ltx
require('should')
Expand Down
Expand Up @@ -3,7 +3,7 @@
/* global describe, it, beforeEach, afterEach */

var Server = require('node-xmpp-server').C2S.WebSocketServer
var Client = require('../../index')
var Client = require('../index')

var PORT = 5290
var server
Expand Down
2 changes: 1 addition & 1 deletion packages/node-xmpp-server/lib/serverStop.js
Expand Up @@ -10,7 +10,7 @@ module.exports = function (server) {
}

connections.add(connection)
connection.on('close', function () {
connection.once('close', function () {
connections.delete(connection)
})
})
Expand Down
Expand Up @@ -21,7 +21,7 @@ server.on('connection', function (connection) {
})
})

describe.skip('C2S WebSocket server client', function () {
describe('C2S WebSocket server client', function () {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was temporary disabled during the move to WebSocket final RFC and we forgot to re-enable it

describe('server', function () {
it('should listen', function (done) {
server.listen(done)
Expand Down
5 changes: 3 additions & 2 deletions packages/node-xmpp/test/tcp-test.js
Expand Up @@ -12,7 +12,7 @@ describe('TCP client/server', function () {
var svcl = null

beforeEach(function (done) {
sv = new xmpp.server.C2S.TCPServer({port: C2S_PORT})
sv = new xmpp.server.C2S.TCPServer({port: C2S_PORT, autostart: false})
sv.on('connection', function (conn) {
svcl = conn
// Always authenticate
Expand All @@ -25,7 +25,7 @@ describe('TCP client/server', function () {
cl = new xmpp.Client({
jid: 'test@localhost',
password: 'test',
host: '::1',
host: 'localhost',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason I'd get ENETUNREACH on travis

port: C2S_PORT
})
cl.on('online', function () {
Expand Down Expand Up @@ -56,6 +56,7 @@ describe('TCP client/server', function () {
})
cl.send(message)
})

it('should receive a stanza', function (done) {
cl.once('stanza', function (stanza) {
assert.ok(stanza.is('message'), 'Message stanza')
Expand Down
Expand Up @@ -2,7 +2,7 @@

'use strict'

describe.skip('BOSH Browser tests', function () {
describe('BOSH Browser tests', function () {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't run yet

var jid = Math.random().toString(36).substring(7) + '@localhost'
var url = 'http://localhost:5280/http-bind'
var password = 'password'
Expand Down
File renamed without changes.
Expand Up @@ -2,13 +2,13 @@

'use strict'

var Client = require('../../index')
var Client = require('../../packages/node-xmpp-client')
var helper = require('../helper')
var Element = require('node-xmpp-core').Element
var Element = Client.Element

require('should')

describe.skip('BOSH connections', function () {
describe('BOSH connections', function () {
var jid = Math.random().toString(36).substring(7) + '@localhost'
var password = 'password'
var client = null
Expand Down
Expand Up @@ -2,13 +2,13 @@

'use strict'

var Client = require('../../index')
var Client = require('../../packages/node-xmpp-client')
var helper = require('../helper')
var Stanza = require('node-xmpp-core').Stanza
var Stanza = Client.Stanza

require('should')

describe.skip('Socket connections', function () {
describe('Socket connections', function () {
var jid = Math.random().toString(36).substring(7) + '@localhost'
var password = 'password'
var client = null
Expand Down
Expand Up @@ -2,9 +2,9 @@

'use strict'

var Client = require('../../index')
var Client = require('../../packages/node-xmpp-client')
var helper = require('../helper')
var Stanza = require('node-xmpp-core').Stanza
var Stanza = Client.Stanza

require('should')

Expand Down