Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Google CI config changes #1

Merged
merged 5 commits into from
Oct 7, 2012
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ lib-cov
pids
logs
results
build

node_modules
npm-debug.log
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
bootstrap-ui
============

Directives specific to twitter bootstrap
Directives specific to twitter bootstrap

## Development
### Prepare your environment
* Install [Node.js](http://nodejs.org/) and NPM (should come with)
* Install global dev dependencies: `npm install -g [email protected] [email protected]`

### Run unit tests
* Start testacular server: `grunt server`
* Run test: `grunt test-run`

### Before commit
* Build the whole project: `grunt` - this will run `lint`, `test`, and `concat` targets
67 changes: 31 additions & 36 deletions grunt.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

var testacular = require('testacular');

module.exports = function(grunt) {

// Project configuration.
Expand All @@ -10,7 +7,7 @@ module.exports = function(grunt) {
},
watch: {
files: '<config:lint.files>',
tasks: 'lint test-run concat'
tasks: 'lint test-run'
},
concat: {
build: {
Expand All @@ -32,47 +29,45 @@ module.exports = function(grunt) {
}
});

// Default task.
grunt.registerTask('default', 'lint test concat');
//register before and after test tasks so we've don't have to change cli options on the goole's CI server
grunt.registerTask('before-test', 'lint');
grunt.registerTask('after-test', 'concat');

grunt.registerTask('server', 'start testacular server', function() {
var done = this.async();
testacular.server.start({configFile: 'test/test-config.js'});
});
// Default task.
grunt.registerTask('default', 'before-test test after-test');

function spawnTestacular(args, callback) {
grunt.utils.spawn({
cmd: __dirname + "/node_modules/.bin/" +
(process.platform === 'win32' ? 'testacular.cmd' : 'testacular'),
// Testacular configuration
var runTestacular = function(command, options) {
var testacularCmd = process.platform === 'win32' ? 'testacular.cmd' : 'testacular';
var args = [command, 'test/test-config.js'].concat(options);
var done = grunt.task.current.async();
var child = grunt.utils.spawn({
cmd: testacularCmd,
args: args
}, callback);
}

grunt.registerTask('test-run', 'run tests against continuous testacular server', function() {
var done = this.async();
spawnTestacular(['run'], function(error, result, code) {
if (error) {
grunt.warn("Make sure the testacular server is online: run `grunt server`.\n" +
"Also make sure you have a browser open to http://localhost:9018/.\n" +
grunt.warn(error.stdout + error.stderr));
setTimeout(done,1000);
}, function(err, result, code) {
if (code) {
done(false);
} else {
grunt.log.write(result.stdout);
done();
}
});
});
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
};

grunt.registerTask('test', 'run tests on single-run server', function() {
var done = this.async();
spawnTestacular(['start', 'test/test-config.js','--single-run', '--log-level=warn'], function(error, result, code) {
if (error) {
grunt.warn(error.stdout + error.stderr);
} else {
grunt.log.write(result.stdout);
}
done();
});
//Can augment options with command line arguments
var options = ['--single-run', '--no-auto-watch'].concat(this.args);
runTestacular('start', options);
});

grunt.registerTask('server', 'start testacular server', function() {
var options = ['--no-single-run', '--no-auto-watch'].concat(this.args);
runTestacular('start', options);
});

grunt.registerTask('test-run', 'run tests against continuous testacular server', function() {
var options = ['--single-run', '--no-auto-watch'].concat(this.args);
runTestacular('run', options);
});
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"name": "angular-ui-bootstrap",
"version": "0.1.0",
"dependencies": {
"testacular": "~0.2.1"
},
"devDependencies": {
"testacular": "~0.2.0"
}
}
2 changes: 1 addition & 1 deletion test/test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ files = [
'test/lib/angular-1.0.2.js',
'test/lib/angular-1.0.2-mocks.js',
'common/*.js',
'directives/**/*.js',
'directives/**/*.js'
];

// list of files to exclude
Expand Down