Skip to content

Massive pull request #1

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

Merged
merged 43 commits into from
Nov 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1b118c2
setup shared jshint config, ignores, and git ignores.
Sep 12, 2013
69b2e44
added api spec submodule
Sep 12, 2013
a305581
save-point
Sep 16, 2013
0ac81e1
removing mocha, switch to nodeunit
Sep 17, 2013
e21fb21
testing and clients are 'online' and working know to get the tests ru…
Sep 27, 2013
462444c
got the tests running using chai and mocha, I like this a lot more
Sep 27, 2013
9e60822
All tests are passing. Removed the HTML docs
Oct 3, 2013
46aeac5
yaml tests passing using a personl instance of ES, working on specify…
Oct 14, 2013
7e854c8
added a scratch script to the gitignore file
Oct 16, 2013
4703655
tests running again, integration log ignored
Oct 16, 2013
0f9fa9c
added readme to log generator
Oct 16, 2013
8cc8763
modified the config to own the connectionPool, transport, and a few o…
Oct 18, 2013
b063dfd
Added "extends" key to the jshint config files, so there is less repe…
Oct 21, 2013
01763c2
Refactored the API, moving it into a single api.js file which can be
Oct 23, 2013
7fef00d
fixed non-array host config
Oct 23, 2013
0e817aa
updated the cases for files that git was ignoreing
Oct 23, 2013
b4f0f8b
added grunt-cli to the before script so that travis can run grunt
Oct 23, 2013
3d9328b
Commented out the docular stuff from the gruntfile.
Oct 23, 2013
c1c8822
Added explicit test task, which includes the integration tests.
Oct 23, 2013
35209ea
Manually merged the two jshintrc files until issue 1314 in jshint is …
Oct 23, 2013
c14d37a
Slight refactor to the api module, so it will simply extend the clien…
Oct 23, 2013
20462c7
Slight refactor to the api module, so it will simply extend the clien…
Oct 23, 2013
63d0d04
added README to the js_api generator
Oct 23, 2013
e231876
Switched from downloading zips to downloading tarballs, as the unzip …
Oct 24, 2013
d678cfc
fixed a few jshint errors
Oct 24, 2013
cc1509c
removed old dependency on the q lib
Oct 24, 2013
6ae5c30
prevented undefined from getting passed to path.join in the yaml test…
Oct 24, 2013
b139314
fixed some case-related issues
Oct 24, 2013
fdbed86
removing stupid dual case files that are showing up twice in GitHub
Oct 24, 2013
cb35524
readding the files that I deleted in the last commit
Oct 24, 2013
984a55f
Cleaned up the generation script, fixing the doc-blocks above the cli…
Oct 29, 2013
2557202
added valid travis button
Oct 29, 2013
286a08c
Added browser build, including angular version. minified versions ava…
Oct 30, 2013
4273ffc
fixed a few bugs now that the class names are properly being set.
Oct 30, 2013
7e6fa47
Added the browser based test suite, have it running automatically via…
Nov 5, 2013
bb814c2
removed the browser based tests from the build until the issue with D…
Nov 5, 2013
ca29fbe
added some compatability stuff for 0.8. Dropping support for 0.6 whic…
Nov 5, 2013
28e99cf
Switched the color package to one with more reasonable deps, added so…
Nov 7, 2013
e68eeab
extended the README.md [ci skip]
Nov 7, 2013
07eefde
Typos and such
Nov 7, 2013
09a38ab
Typos
Nov 7, 2013
0fa5da3
more typos
Nov 8, 2013
7912ae6
added test runner for jenkins
Nov 11, 2013
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
scripts/scratch*
test/integration/yaml_suite/log
test/integration/yaml_suite/tests
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "spec/es_api"]
path = spec/es_api
url = [email protected]:elasticsearch/elasticsearch-rest-api-spec.git
[submodule "es_api_spec"]
path = es_api_spec
url = [email protected]:elasticsearch/elasticsearch-rest-api-spec.git
28 changes: 28 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"node": true,
"white": true,
"bitwise": false,
"curly": true,
"eqnull": true,
"eqeqeq": true,
"forin": true,
"immed": true,
"expr": true,
"indent": 2,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
"noempty": true,
"undef": true,
"quotmark": "single",
"plusplus": false,
"boss": true,
"trailing": true,
"laxbreak": true,
"laxcomma": true,
"validthis": true,
"sub": true,
"maxlen": 140,
"-W084": true,
"maxerr": 10
}
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js
node_js:
- "0.11"
- "0.10"
- "0.8"
services:
- elasticsearch
before_script:
- npm install -g grunt-cli
255 changes: 212 additions & 43 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,74 +1,243 @@
/* jshint node:true */
'use strict';

module.exports = function (grunt) {

var pre = [
'src/pre.js',
'src/shared.js',
'src/serializer.js',
'src/serializer/*',
'src/selector.js',
'src/logger/*',
'src/transport.js'
];
var _ = require('lodash');
var child_process = require('child_process');

var post = ['src/client.js','src/post.js'];
var sharedBrowserfyExclusions = [
'src/lib/connectors/http.js',
'src/lib/loggers/file.js',
'src/lib/loggers/stdio.js',
'src/lib/loggers/stream.js',
'src/lib/loggers/stream.js'
];

// Project configuration.
grunt.initConfig({
distDir: 'dist',
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= pkg.license %> */\n\n'
' Licensed <%= pkg.license %> */\n' +
' // built using browserify\n\n'
},
concat: {
clean: {
dist: {
src: ['<%= distDir %>']
}
},
mochaTest: {
unit: [
'test/unit/**/*.test.js'
],
yaml_suite: [
'test/integration/yaml_suite/index.js'
],
options: {
banner: '<%= meta.banner %>'
},
node: {
src: pre.concat(['src/transport/elasticsearch-node.js'],post),
dest: 'dist/elasticsearch-node.js'
colors: true,
require: 'should',
reporter: 'dot',
bail: true,
timeout: 11000
}
},
nodeunit: {
files: ['test/**/*.js']
},
jshint: {
files: ['Gruntfile.js', '<%= concat.node.dest %>', 'test/**/*.js' ],
source: {
src: [
'src/**/*.js',
'scripts/**/*.js',
'test/**/*.js -test/browser_integration/yaml_tests.js',
'Gruntfile.js'
],
options: {
jshintrc: true
}
}
},
watch: {
source: {
files: [
'src/**/*',
'test/**/*',
'Gruntfile.js'
],
tasks: [
'jshint:source'
]
},
options: {
bitwise: true,
curly: true,
eqeqeq: true,
immed: true,
indent: 2,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
globalstrict: true,
devel: true,
node: true,
globals: {
exports: true,
module: false
interupt: true
}
},
run: {
js_api: {
args: [
'scripts/generate/js_api'
]
},
yaml_tests: {
args: [
'scripts/generate/yaml_tests'
]
},
integration_server: {
args: [
'test/browser_integration/server.js'
],
options: {
wait: false,
ready: /server listening/
}
}
},
browserify: {
client: {
files: {
'<%= distDir %>/elasticsearch.js': 'src/elasticsearch.js'
},
options: {
standalone: 'elasticsearch',
ignore: _.union(sharedBrowserfyExclusions, [
'src/lib/connectors/jquery.js',
'src/lib/connectors/angular.js'
])
}
},
angular_client: {
files: {
'<%= distDir %>/elasticsearch.angular.js': ['src/elasticsearch.angular.js']
},
options: {
standalone: 'elasticsearch',
ignore: _.union(sharedBrowserfyExclusions, [
'src/lib/connectors/jquery.js',
'src/lib/connectors/xhr.js'
])
}
},
yaml_suite: {
files: {
'test/browser_integration/yaml_tests.js': ['test/integration/yaml_suite/index.js']
},
options: {
external: [
'optimist'
]
}
}
},
concat: {
dist_banners: {
files: {
'<%= distDir %>/elasticsearch.js': ['<%= distDir %>/elasticsearch.js'],
'<%= distDir %>/elasticsearch.angular.js': ['<%= distDir %>/elasticsearch.angular.js']
},
options: {
banner: '<%= meta.banner %>'
}
}
},
uglify: {
dist: {
files: {
'<%= distDir %>/elasticsearch.min.js': '<%= distDir %>/elasticsearch.js',
'<%= distDir %>/elasticsearch.angular.min.js': '<%= distDir %>/elasticsearch.angular.js'
},
options: {
report: 'min',
banner: '<%= meta.banner %>'
},
global_defs: {
process: {
browser: true
}
}
}
},
mocha: {
yaml_suite: {
options: {
// log: true,
run: true,
urls: [ 'http://localhost:8888' ],
timeout: 10e3,
'--web-security': false
}
}
}
});

// load plugins
grunt.loadNpmTasks('grunt-run');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');


// Default task.
grunt.registerTask('default', ['concat','nodeunit','jshint']);
grunt.registerTask('default', [
/*jshint scripturl:true*/
'jshint',
'mochaTest:unit',
'build',
'mochaTest:yaml_suite',
// 'start:integration_server',
// 'mocha:yaml_suite' -- this will fail because of the way that PhantomJS handle's DELETE requests with body's
]);

grunt.registerTask('build', [
'clean:dist',
'run:yaml_tests',
'run:js_api',
'browserify',
'uglify:dist',
'concat:dist_banners'
]);

var browsers = {
safari: 'Safari',
chrome: 'Google Chrome',
firefox: 'Firefox'
};

Object.keys(browsers).forEach(function (browser) {
grunt.config.set('open_browser_tests.' + browser, {
appName: browsers[browser]
});
grunt.registerTask('browser_tests:' + browser, [
'build',
'run:integration_server',
'open_browser_tests:' + browser
]);
});

grunt.registerMultiTask('open_browser_tests', function (host, port) {
host = host || 'localhost';
port = port || 9200;

var taskData = this.data;

grunt.task.requires('run:integration_server');

grunt.config.set('open.yaml_suite_' + this.target, {
path: 'http://localhost:8888?es_hostname=' + encodeURIComponent(host) + '&es_port=' + encodeURIComponent(port),
app: taskData.appName
});

grunt.task.run([
'open:yaml_suite_' + this.target,
'wait:integration_server'
]);
});

};
};
Loading