Skip to content

Commit

Permalink
Merge remote-tracking branch 'c2fo/master' into node12
Browse files Browse the repository at this point in the history
Conflicts:
	Gruntfile.js
	docs-md/coverage.html
	docs/History.html
	docs/coverage.html
	docs/index.html
	package.json
	test/adapters/redshift.test.js
	test/associations/manyToMany/camelize.test.js
	test/associations/manyToMany/customFIlter.eager.test.js
	test/associations/manyToMany/customFilter.lazy.test.js
	test/associations/manyToMany/eager.test.js
	test/associations/manyToMany/hashKey.test.js
	test/associations/manyToMany/lazy.test.js
	test/associations/manyToMany/stringKey.test.js
	test/associations/manyToOne/camelize.test.js
	test/associations/manyToOne/customFilter.lazy.test.js
	test/associations/manyToOne/eager.test.js
	test/associations/manyToOne/hashKey.test.js
	test/associations/manyToOne/lazy.test.js
	test/associations/manyToOne/stringKey.test.js
	test/associations/oneToOne/camelize.test.js
	test/data/classTableInheritance.helper.js
	test/data/manyToMany.helper.js
	test/data/manyToOne.helper.js
	test/data/mappedColumnPlugin.helper.js
	test/data/model.helper.js
	test/data/oneToOne.helper.js
	test/data/timestampPlugin.helper.js
	test/data/validator.helper.js
	test/database/database.test.js
	test/migrations.test.js
	test/models/camelCase.test.js
	test/models/customAccessors.test.js
	test/models/customDataset.test.js
	test/models/model.test.js
	test/models/multipleDbs.test.js
	test/patio.test.js
	test/plugins/columnMapper.test.js
	test/plugins/timestamp.customColumns.test.js
	test/plugins/timestamp.default.test.js
	test/plugins/timestamp.updateOnCreate.test.js
  • Loading branch information
doug-martin committed Jun 9, 2015
2 parents 9ad9daf + 0bd2f13 commit 690347b
Show file tree
Hide file tree
Showing 151 changed files with 241 additions and 47,565 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -5,4 +5,5 @@ lib-cov
*.iml
*.project
.idea
atlassian-ide-plugin.xml
atlassian-ide-plugin.xml
.coveralls.yml
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -8,6 +8,9 @@ before_script:
- psql -c 'create database sandbox;' -U postgres
- psql -c 'create database sandbox2;' -U postgres

after_script:
- grunt coveralls

language: node_js
node_js:
- 0.10
80 changes: 42 additions & 38 deletions Gruntfile.js
Expand Up @@ -2,6 +2,9 @@
/*global module:false*/
module.exports = function (grunt) {
// Project configuration.

var DEFAULT_COVERAGE_ARGS = ["cover", "-x", "Gruntfile.js", "--report", "none", "--print", "none", "--include-pid", "grunt", "--", "it"];

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
Expand All @@ -12,10 +15,8 @@ module.exports = function (grunt) {
},

exec: {
runMySqlCov: "export NODE_PATH=lib-cov:$NODE_PATH && export NODE_ENV=test-coverage && export PATIO_DB=mysql && ./node_modules/it/bin/it -r dotmatrix --cov-html ./docs-md/coverage.html",
runPsqlCov: "export NODE_PATH=lib-cov:$NODE_PATH && export NODE_ENV=test-coverage && export PATIO_DB=pg && ./node_modules/it/bin/it -r dotmatrix --cov-html ./docs-md/coverage.html",
installCoverage: "cd support/jscoverage && ./configure && make && mv jscoverage node-jscoverage",
createCoverage: "rm -rf ./lib-cov && node-jscoverage ./lib ./lib-cov",
sendToCoveralls: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
removeCoverage: "rm -rf ./coverage",
removeDocs: "rm -rf docs/*",
createDocs: 'coddoc -f multi-html -d ./lib --dir ./docs'
},
Expand All @@ -31,11 +32,10 @@ module.exports = function (grunt) {
}
});

grunt.registerTask('test_mysql', 'set PATIO_DB to mysql', function () {
grunt.registerTask("spawn-test", "spawn tests", function (db) {
var done = this.async();
var env = process.env;
env.NODE_PATH = "./lib";
env.PATIO_DB = "mysql";
env.PATIO_DB = db;
grunt.util.spawn({cmd: "grunt", args: ["it"], opts: {stdio: 'inherit', env: env}}, function (err) {
if (err) {
done(false);
Expand All @@ -45,12 +45,11 @@ module.exports = function (grunt) {
});
});

grunt.registerTask('test_psql', 'set PATIO_DB to pg', function () {
grunt.registerTask("spawn-test-coverage", "spawn tests with coverage", function (db) {
var done = this.async();
var env = process.env;
env.NODE_PATH = "./lib";
env.PATIO_DB = "pg";
grunt.util.spawn({cmd: "grunt", args: ["it"], opts: {stdio: 'inherit', env: env}}, function (err) {
env.PATIO_DB = db;
grunt.util.spawn({cmd: "istanbul", args: DEFAULT_COVERAGE_ARGS, opts: {stdio: 'inherit', env: env}}, function (err) {
if (err) {
done(false);
} else {
Expand All @@ -59,44 +58,49 @@ module.exports = function (grunt) {
});
});

grunt.registerTask('test_psql_cov', 'set PATIO_DB to pg', function () {
var done = this.async();
var env = process.env;
env.NODE_PATH = "./lib-cov";
env.NODE_ENV = "test-coverage";
env.PATIO_DB = "pg";
grunt.util.spawn({cmd: "grunt", args: ["it"], opts: {stdio: 'inherit', env: env}}, function (err) {
if (err) {
done(false);
} else {
done();
}
grunt.registerTask("process-coverage", "process coverage obects", function () {
var files = grunt.file.expand("./coverage/coverage*.json"),
istanbul = require('istanbul'),
collector = new istanbul.Collector(),
reporter = new istanbul.Reporter(),
sync = false,
done = this.async();

files.forEach(function (file) {
collector.add(grunt.file.readJSON(file));
});
});

grunt.registerTask('test_mysql_cov', 'set PATIO_DB to pg', function () {
var done = this.async();
var env = process.env;
env.NODE_PATH = "./lib-cov";
env.NODE_ENV = "test-coverage";
env.PATIO_DB = "mysql";
grunt.util.spawn({cmd: "grunt", args: ["it"], opts: {stdio: 'inherit', env: env}}, function (err) {
reporter.add('text');
reporter.addAll(['lcovonly']);
reporter.write(collector, sync, function (err) {
if (err) {
done(false);
} else {
done();
console.error(err.stack);
return done(false);
}
console.log('All reports generated');
done();
});
});

grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task.
grunt.registerTask('default', ['jshint', "test", "test-coverage", "docs"]);
grunt.registerTask("test-coverage", ["exec:createCoverage", "exec:runMySqlCov", "exec:runPsqlCov"]);

grunt.registerTask('test', ['jshint', 'test-mysql', 'test-pg']);
grunt.registerTask('test-mysql', ['jshint', "spawn-test:mysql"]);
grunt.registerTask('test-pg', ['jshint', "spawn-test:pg"]);

grunt.registerTask('coveralls', ['exec:removeCoverage', 'test-mysql-coverage', 'test-pg-coverage', 'process-coverage', 'exec:sendToCoveralls', 'exec:removeCoverage']);
grunt.registerTask('test-coverage', ['exec:removeCoverage', 'test-mysql-coverage', 'test-pg-coverage', 'process-coverage', 'exec:removeCoverage']);
grunt.registerTask('test-mysql-coverage', ["spawn-test-coverage:mysql"]);
grunt.registerTask('test-pg-coverage', ["spawn-test-coverage:pg"]);


grunt.registerTask("docs", ["exec:removeDocs", "exec:createDocs"]);

grunt.loadNpmTasks('grunt-it');
grunt.registerTask('mysql', ['jshint', 'mysql_env', 'it']);
grunt.registerTask('pg', ['jshint', 'test_psql']);
grunt.registerTask('test', ['jshint', 'test_mysql', 'test_psql']);
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-exec');

};
5 changes: 5 additions & 0 deletions History.md
@@ -1,3 +1,8 @@
# 0.9.4

* Add [coveralls.io](https://coveralls.io/r/C2FO/patio?branch=master)


# 0.9.3

* Allow for `literal` in dataset `from` clause
Expand Down
6 changes: 5 additions & 1 deletion README.md
@@ -1,4 +1,8 @@
[![Build Status](https://secure.travis-ci.org/C2FO/patio.png)](http://travis-ci.org/C2FO/patio)
[![Build Status](https://travis-ci.org/C2FO/patio.svg?branch=master)](https://travis-ci.org/C2FO/patio)
[![Coverage Status](https://coveralls.io/repos/C2FO/patio/badge.svg?branch=master)](https://coveralls.io/r/C2FO/patio?branch=master)

[![NPM](https://nodei.co/npm/patio.png?downloads=true)](https://nodei.co/npm/patio/)

#[Patio](http://c2fo.github.com/patio)

Patio is a <a href="http://sequel.rubyforge.org/" target="patioapi">Sequel</a> inspired query engine.
Expand Down

0 comments on commit 690347b

Please sign in to comment.