diff --git a/.travis.yml b/.travis.yml index 01e035c..bce0b42 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,9 @@ before_install: - ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N '' - cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys - chmod -R 700 ~/.ssh + - cp sample/core.config.coffee config.coffee -script: npm run test-all-config +script: npm test services: - mongodb diff --git a/core/interface/Node.coffee b/core/interface/Node.coffee index 1656018..c010013 100644 --- a/core/interface/Node.coffee +++ b/core/interface/Node.coffee @@ -12,7 +12,7 @@ module.exports = class Node master: false available_components: [] - constructor: (@info) -> + constructor: (info) -> _.extend @, info for component_type in @available_components @@ -108,7 +108,7 @@ module.exports = class Node callback connection connection.connect - host: @info.host + host: @host username: 'rpadmin' privateKey: id_key diff --git a/core/test/ticket/resource.user.test.coffee b/core/test/ticket/resource.user.test.coffee index 0d2fb98..425794c 100644 --- a/core/test/ticket/resource.user.test.coffee +++ b/core/test/ticket/resource.user.test.coffee @@ -28,13 +28,14 @@ describe 'ticket/user', -> res.body.should.be.a 'array' done err - it 'POST /:id/reply', (done) -> - agent.post "/ticket/resource/#{ticket_id}/reply" + it 'POST /:id/replies', (done) -> + agent.post "/ticket/resource/#{ticket_id}/replies" .send csrf_token: csrf_token content: 'Reply' .expect 201 .end (err, res) -> + console.log res.text res.body._id.should.be.eixst res.body.content.should.be.equal 'Reply' done err diff --git a/plugin/linux/test/linux.test.coffee b/plugin/linux/test/linux.test.coffee index 967788b..ab719cd 100644 --- a/plugin/linux/test/linux.test.coffee +++ b/plugin/linux/test/linux.test.coffee @@ -1,4 +1,4 @@ -ifEnabled('linux') 'plugin/linux', -> +describe.skip 'plugin/linux', -> linux = null cache = null redis = null diff --git a/sample/core.config.coffee b/sample/core.config.coffee index 8ee1271..a366dc2 100644 --- a/sample/core.config.coffee +++ b/sample/core.config.coffee @@ -2,7 +2,7 @@ module.exports = web: t_name: 'RootPanel' url: 'http://rp.rpvhost.net' - listen: '/home/rpadmin/rootpanel.sock' + listen: '/tmp/rootpanel.sock' repo: 'jysperm/RootPanel' google_analytics_id: '' @@ -11,7 +11,6 @@ module.exports = i18n: available_language: ['zh_CN', 'en'] - default_language: 'zh_CN' default_timezone: 'Asia/Shanghai' plugin: @@ -24,15 +23,12 @@ module.exports = when_balance_below: 0 when_arrears_above: 0 - billing_cycle: 10 * 60 * 1000 - plans: sample: t_name: 'plans.sample.name' t_description: 'plans.sample.description' available_components: {} - resource_limit: {} billing_trigger: time: @@ -47,10 +43,10 @@ module.exports = available_components: {} resource_limit: {} - billing: {} + billing_trigger: {} ssh: - id_key: '/home/rpadmin/.ssh/id_rsa' + id_key: './.ssh/id_rsa' nodes: master: diff --git a/test/env.coffee b/test/env.coffee index 97c14dd..af5d826 100644 --- a/test/env.coffee +++ b/test/env.coffee @@ -14,25 +14,22 @@ if process.env.COV_TEST == 'true' path: 'relative' basePath: "#{__dirname}/../.." exclude: do -> - result = ['test', 'node_modules', '.git', 'sample', 'core/static', 'migration/database'] + excludes = ['test', 'node_modules', '.git', 'sample', 'core/static', 'migration'] for plugin_name in _.union config.plugin.available_extensions, config.plugin.available_services - result.push "plugin/#{plugin_name}/test" + excludes.push "plugin/#{plugin_name}/test" - return result + return excludes global.expect = chai.expect chai.should() chai.config.includeStack = true -config.web.listen = 12558 - if process.env.TRAVIS == 'true' config.mongodb.user = undefined config.mongodb.password = undefined config.redis.password = undefined - config.ssh.id_key = '/home/travis/.ssh/id_rsa' global.ifEnabled = (plugin_name) -> if plugin_name in config.plugin.available_plugins