Skip to content

Commit

Permalink
Added travis configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbatista committed Oct 20, 2016
1 parent f2912c4 commit 69bc2a7
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 25 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: node_js

node_js:
- "0.12"

before_install:
- curl -s -L https://www.arangodb.com/repositories/travisCI/setup_arangodb_2.8.11.sh -o setup_arangodb.sh
- chmod +x setup_arangodb.sh
- ./setup_arangodb.sh

install:
- npm install

script:
- npm test
#- npm run build-test-debug
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# loopback-connector-arangodb

[![Build Status](https://travis-ci.org/mrbatista/loopback-connector-arangodb.svg)](https://travis-ci.org/mrbatista/loopback-connector-arangodb)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"aqb": "^2.1.0",
"arangojs": "^4.0.0-alpha8",
"arangojs": "4.0.0-alpha8",
"async": "^1.0.0",
"chance": "^0.7.6",
"debug": "^2.1.1",
Expand Down
13 changes: 3 additions & 10 deletions test/core.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,15 @@ arangojs = require 'arangojs'
qb = require 'aqb'
chance = require('chance').Chance()
arangodb = require '..'
DataSource = require('loopback-datasource-juggler').DataSource
GeoPoint = require('loopback-datasource-juggler').GeoPoint
ArangoDBConnector = arangodb.ArangoDBConnector

describe 'arangodb core functionality:', () ->
ds = null
config = null
before () ->
ds = getDataSource()

describe 'connecting:', () ->
before () ->
# get settings for db from .rc file
config = require('rc')('loopback', {}).test.arangodb
generateConnObject = arangodb.generateConnObject

simple_model = ds.define 'SimpleModel', {
name:
type: String
Expand Down Expand Up @@ -66,7 +59,6 @@ describe 'arangodb core functionality:', () ->
done()

it 'should create an connection using the connection settings when url is not set', (done) ->
settings = require('rc')('loopback').test.arangodb
settings =
host: 'right_host'
port: 32768
Expand All @@ -82,8 +74,9 @@ describe 'arangodb core functionality:', () ->
describe 'authentication:', () ->
wrongAuth = null
it "should throw an error when using wrong credentials", (done) ->
config.password = 'wrong'
wrongAuth = getDataSource config
settings =
password: 'wrong'
wrongAuth = getDataSource settings
`(function(){
wrongAuth.connector.query('FOR year in 2010..2013 RETURN year', function (err, cursor){
if (err)
Expand Down
4 changes: 2 additions & 2 deletions test/crud/document.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ describe 'crud document:', () ->
done()

# MEMO: Import data present into data/users/names_100000.json before running this test.
it 'cursor should returns all documents more then max single default size (1000) ', (done) ->
it.skip 'cursor should returns all documents more then max single default size (1000) ', (done) ->

# Increase timeout only for this test
this.timeout(20000);
Expand All @@ -415,7 +415,7 @@ describe 'crud document:', () ->
names.length.should.be.equal(100000)
done()

it 'cursor should returns all documents more then max single default cursor size (1000) and respect limit filter ', (done) ->
it.skip 'cursor should returns all documents more then max single default cursor size (1000) and respect limit filter ', (done) ->

# Increase timeout only for this test
this.timeout(20000);
Expand Down
24 changes: 12 additions & 12 deletions test/init.coffee
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
module.exports = require('should');

# define global method getDataSource/getSchema, callable with a custom config, falling back to a config that was defined in a .loopbackrc file
global.getDataSource = global.getSchema = (customConfig) ->
DataSource = require('loopback-datasource-juggler').DataSource;
DataSource = require('loopback-datasource-juggler').DataSource

# get fallback config from .loopbackrc
rc_defaults =
test:
arangodb:
host: "127.0.0.1"
port: 8529
db: '_system'
TEST_ENV = process.env.TEST_ENV || 'test'
config = require('rc')('loopback', { test: { arangodb: {}}})[TEST_ENV].arangodb;

global.config = config;

config = require('rc')('loopback', rc_defaults).test.arangodb
if process.env.CI
config =
host: process.env.ARANGODB_HOST or 'localhost'
port: process.env.ARANGODB_PORT or 8529
database: '_system'
#database: 'lb-ds-arangodb-test-' + (
#process.env.TRAVIS_BUILD_NUMBER or process.env.BUILD_NUMBER or '1'),

global.getDataSource = global.getSchema = (customConfig) ->
db = new DataSource(require('../'), customConfig || config);

db.log = (msg) -> console.log msg

return db

0 comments on commit 69bc2a7

Please sign in to comment.