From bf1ff2ac0dfe5942c96d313c35ae1236626b3996 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Tue, 1 Jul 2014 13:35:50 +0100 Subject: [PATCH] Improve ember casper test stability fixes #3171, fixes #2382, refs #3130 - Moved grunt init from travis into grunt validate, this makes sure we get verbose output from grunt init. - Added `grunt test` task to run just the tests without building if you want - Upgraded grunt-contrib-concat and added nonull property (had to switch to src/dist for this to work) #2382 - Upgraded bower to 1.3.5, which appears to resolve #3171 - Changed bower git assets to all be referenced the same and removed resolutions again #3130 --- .travis.yml | 3 +- Gruntfile.js | 78 +++++++++++++++++++++++++++++----------------------- bower.json | 13 ++++----- package.json | 4 +-- 4 files changed, 52 insertions(+), 46 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87202b059e..5a71c67091 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,5 +18,4 @@ before_install: - if [ $DB == "pg" ]; then npm install pg; psql -c 'create database ghost_testing;' -U postgres; fi before_script: - phantomjs --version - - casperjs --version - - grunt init \ No newline at end of file + - casperjs --version \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 432f9c34ec..dcd60e261e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -384,37 +384,37 @@ var path = require('path'), // concatenate multiple JS files into a single file ready for use concat: { 'dev': { - files: { - 'core/built/scripts/vendor-ember.js': [ - 'bower_components/loader.js/loader.js', - 'bower_components/jquery/dist/jquery.js', - 'bower_components/lodash/dist/lodash.js', - 'bower_components/handlebars/handlebars.js', - 'bower_components/ember/ember.js', - 'bower_components/ember-data/ember-data.js', - 'bower_components/ember-resolver/dist/ember-resolver.js', - 'bower_components/ic-ajax/dist/globals/main.js', - 'bower_components/ember-load-initializers/ember-load-initializers.js', - 'bower_components/validator-js/validator.js', - 'bower_components/codemirror/lib/codemirror.js', - 'bower_components/codemirror/addon/mode/overlay.js', - 'bower_components/codemirror/mode/markdown/markdown.js', - 'bower_components/codemirror/mode/gfm/gfm.js', - 'bower_components/showdown/src/showdown.js', - 'bower_components/moment/moment.js', - 'bower_components/keymaster/keymaster.js', - 'bower_components/device/lib/device.js', - 'bower_components/jquery-ui/ui/jquery-ui.js', - 'bower_components/jquery-file-upload/js/jquery.fileupload.js', - 'bower_components/fastclick/lib/fastclick.js', - 'bower_components/nprogress/nprogress.js', - 'bower_components/ember-simple-auth/ember-simple-auth.js', - 'bower_components/ember-simple-auth/ember-simple-auth-oauth2.js', + nonull: true, + dest: 'core/built/scripts/vendor-ember.js', + src: [ + 'bower_components/loader.js/loader.js', + 'bower_components/jquery/dist/jquery.js', + 'bower_components/lodash/dist/lodash.js', + 'bower_components/handlebars/handlebars.js', + 'bower_components/ember/ember.js', + 'bower_components/ember-data/ember-data.js', + 'bower_components/ember-resolver/dist/ember-resolver.js', + 'bower_components/ic-ajax/dist/globals/main.js', + 'bower_components/ember-load-initializers/ember-load-initializers.js', + 'bower_components/validator-js/validator.js', + 'bower_components/codemirror/lib/codemirror.js', + 'bower_components/codemirror/addon/mode/overlay.js', + 'bower_components/codemirror/mode/markdown/markdown.js', + 'bower_components/codemirror/mode/gfm/gfm.js', + 'bower_components/showdown/src/showdown.js', + 'bower_components/moment/moment.js', + 'bower_components/keymaster/keymaster.js', + 'bower_components/device/lib/device.js', + 'bower_components/jquery-ui/ui/jquery-ui.js', + 'bower_components/jquery-file-upload/js/jquery.fileupload.js', + 'bower_components/fastclick/lib/fastclick.js', + 'bower_components/nprogress/nprogress.js', + 'bower_components/ember-simple-auth/ember-simple-auth.js', + 'bower_components/ember-simple-auth/ember-simple-auth-oauth2.js', - 'core/shared/lib/showdown/extensions/ghostimagepreview.js', - 'core/shared/lib/showdown/extensions/ghostgfm.js', - ] - } + 'core/shared/lib/showdown/extensions/ghostimagepreview.js', + 'core/shared/lib/showdown/extensions/ghostgfm.js' + ] } }, @@ -553,14 +553,24 @@ var path = require('path'), // ### Validate // **Main testing task** // - // `grunt validate` will lint and test your local Ghost codebase. + // `grunt validate` will build, lint and test your local Ghost codebase. // // `grunt validate` is one of the most important and useful grunt tasks that we have available to use. It - // manages the setup and running of jshint as well as the 4 test suites. See the individual sub tasks below - // for details of each of the test suites. + // manages the build of your environment and then calls `grunt test` // - // `grunt validate` is called by `npm test`. + // `grunt validate` is called by `npm test` and is used by Travis. grunt.registerTask('validate', 'Run tests and lint code', + ['init', 'test']); + + // ### Test + // **Main testing task** + // + // `grunt test` will lint and test your pre-built local Ghost codebase. + // + // `grunt test` runs jshint as well as the 4 test suites. See the individual sub tasks below for details of + // each of the test suites. + // + grunt.registerTask('test', 'Run tests and lint code', ['jshint', 'test-routes', 'test-unit', 'test-integration', 'test-functional']); // ### Unit Tests *(sub task)* diff --git a/bower.json b/bower.json index 00ced1c02f..7b3ae43e11 100644 --- a/bower.json +++ b/bower.json @@ -3,12 +3,12 @@ "dependencies": { "codemirror": "4.0.1", "Countable": "2.0.2", - "device": "matthewhudson/device.js#5347a275b66020a0d4dfe9aad81a488f8cce448d", + "device": "git://github.com/matthewhudson/device.js#5347a275b66020a0d4dfe9aad81a488f8cce448d", "ember": "1.5.0", "ember-data": "~1.0.0-beta.8", "ember-load-initializers": "git://github.com/stefanpenner/ember-load-initializers.git#0.0.1", "ember-resolver": "git://github.com/stefanpenner/ember-jj-abrams-resolver.git#181251821cf513bb58d3e192faa13245a816f75e", - "ember-simple-auth": "https://github.com/simplabs/ember-simple-auth-component.git#0.5.3", + "ember-simple-auth": "git://github.com/simplabs/ember-simple-auth-component.git#0.5.3", "fastclick": "1.0.0", "ghost-ui": "0.8.1", "handlebars": "1.3.0", @@ -17,15 +17,12 @@ "jquery-file-upload": "9.5.6", "jquery-hammerjs": "1.0.1", "jquery-ui": "1.10.4", - "keymaster": "madrobby/keymaster#0f09fc1b7e66c2b7e07afe89a419366dcf2d1cd8", - "loader.js": "stefanpenner/loader.js#1.0.0", + "keymaster": "git://github.com/madrobby/keymaster#0f09fc1b7e66c2b7e07afe89a419366dcf2d1cd8", + "loader.js": "git://github.com/stefanpenner/loader.js#1.0.0", "lodash": "2.4.1", "moment": "2.4.0", "nprogress": "0.1.2", - "showdown": "https://github.com/ErisDS/showdown.git#v0.3.2-ghost", + "showdown": "git://github.com/ErisDS/showdown.git#v0.3.2-ghost", "validator-js": "3.4.0" - }, - "resolutions": { - "ember": "~1.4.0" } } diff --git a/package.json b/package.json index a5394db51b..8a8ac8add1 100644 --- a/package.json +++ b/package.json @@ -72,13 +72,13 @@ }, "devDependencies": { "blanket": "~1.1.5", - "bower": "~1.2.8", + "bower": "~1.3.5", "grunt": "~0.4.1", "grunt-cli": "~0.1.13", "grunt-concat-sourcemap": "~0.4.0", "grunt-contrib-clean": "~0.5.0", "grunt-contrib-compress": "~0.5.2", - "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-concat": "~0.4.0", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-jshint": "~0.8.0", "grunt-contrib-uglify": "~0.2.5",