Skip to content

Commit

Permalink
📦 Update to 0.7.9
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrieseberg committed Apr 20, 2016
1 parent e5af0ff commit 52c085a
Show file tree
Hide file tree
Showing 144 changed files with 99,857 additions and 73,427 deletions.
209 changes: 48 additions & 161 deletions Gruntfile.js
Expand Up @@ -183,65 +183,19 @@ var _ = require('lodash'),
// #### All Unit tests
unit: {
src: [
'core/test/unit/**/*_spec.js'
'core/test/unit/**/*_spec.js',
'core/server/apps/**/tests/*_spec.js'
]
},

// ##### Groups of unit tests
server: {
src: ['core/test/unit/**/server*_spec.js']
},

helpers: {
src: ['core/test/unit/server_helpers/*_spec.js']
},

metadata: {
src: ['core/test/unit/metadata/*_spec.js']
},

middleware: {
src: ['core/test/unit/middleware/*_spec.js']
},

showdown: {
src: ['core/test/unit/**/showdown*_spec.js']
},

perm: {
src: ['core/test/unit/**/permissions_spec.js']
},

migrate: {
src: [
'core/test/unit/**/export_spec.js',
'core/test/unit/**/import_spec.js'
]
},

storage: {
src: ['core/test/unit/**/storage*_spec.js']
},

// #### All Integration tests
integration: {
src: [
'core/test/integration/**/*_spec.js',
'core/test/integration/**/*_spec.js',
'core/test/integration/*_spec.js'
]
},

// ##### Model integration tests
model: {
src: ['core/test/integration/**/model*_spec.js']
},

// ##### API integration tests
api: {
src: ['core/test/integration/**/api*_spec.js']
},

// #### All Route tests
routes: {
src: [
Expand All @@ -262,23 +216,30 @@ var _ = require('lodash'),
// `grunt coverage`.
mocha_istanbul: {
coverage: {
// TODO fix the timing/async & cleanup issues with the route and integration tests so that
// they can also have coverage generated for them & the order doesn't matter
src: ['core/test/unit'],
src: [
'core/test/unit',
'core/server/apps'
],
options: {
mask: '**/*_spec.js',
coverageFolder: 'core/test/coverage/unit',
mochaOptions: ['--timeout=15000'],
excludes: ['core/client/**']
excludes: ['core/client/**', 'core/server/built']
}
},
coverage_integration: {
src: ['core/test/integration/api'],
coverage_all: {
src: [
'core/test/integration',
'core/server/apps',
'core/test/functional',
'core/test/unit'
],
options: {
coverageFolder: 'core/test/coverage/integration',
coverageFolder: 'core/test/coverage/all',
mask: '**/*_spec.js',
mochaOptions: ['--timeout=15000'],
excludes: ['core/client/**', 'core/server/built', 'core/server/apps', 'core/server/config', 'core/server/data']
excludes: ['core/client/**', 'core/server/built']
}

}
Expand Down Expand Up @@ -430,7 +391,9 @@ var _ = require('lodash'),
sourceMap: false
},
files: {
'core/shared/ghost-url.min.js': 'core/shared/ghost-url.js'
'core/shared/ghost-url.min.js': 'core/shared/ghost-url.js',
'core/built/assets/ghost.min.js': 'core/built/assets/ghost.min.js',
'core/built/assets/vendor.min.js': 'core/built/assets/vendor.min.js'
}
}
}
Expand All @@ -439,55 +402,6 @@ var _ = require('lodash'),
// Load the configuration
grunt.initConfig(cfg);

// ## Utilities
//
// ### Spawn Casper.js
// Custom test runner for our Casper.js functional tests
// This really ought to be refactored into a separate grunt task module
grunt.registerTask('spawnCasperJS', function (target) {
target = _.contains(['client', 'setup'], target) ? target + '/' : undefined;

var done = this.async(),
options = ['host', 'noPort', 'port', 'email', 'password'],
args = ['test']
.concat(grunt.option('target') || target || ['client/'])
.concat(['--includes=base.js', '--log-level=debug', '--port=2369']);

// Forward parameters from grunt to casperjs
_.each(options, function processOption(option) {
if (grunt.option(option)) {
args.push('--' + option + '=' + grunt.option(option));
}
});

if (grunt.option('fail-fast')) {
args.push('--fail-fast');
}

// Show concise logs in Travis as ours are getting too long
if (grunt.option('concise') || process.env.TRAVIS) {
args.push('--concise');
} else {
args.push('--verbose');
}

grunt.util.spawn({
cmd: 'casperjs',
args: args,
opts: {
cwd: path.resolve('core/test/functional'),
stdio: 'inherit'
}
}, function (error, result, code) {
/*jshint unused:false*/
if (error) {
grunt.fail.fatal(result.stderr);
}
grunt.log.writeln(result.stdout);
done();
});
});

// # Custom Tasks

// Ghost has a number of useful tasks that we use every day in development. Tasks marked as *Utility* are used
Expand All @@ -506,8 +420,7 @@ var _ = require('lodash'),
grunt.registerTask('help',
'Outputs help information if you type `grunt help` instead of `grunt --help`',
function () {
console.log('Type `grunt --help` to get the details of available grunt tasks, ' +
'or alternatively visit https://github.com/TryGhost/Ghost/wiki/Grunt-Toolkit');
console.log('Type `grunt --help` to get the details of available grunt tasks.');
});

// ### Documentation
Expand Down Expand Up @@ -577,8 +490,7 @@ var _ = require('lodash'),
migration = require('./core/server/data/migration');

migration.reset().then(function () {
return models.init();
}).then(function () {
models.init();
return migration.init();
}).then(function () {
done();
Expand All @@ -587,7 +499,16 @@ var _ = require('lodash'),
});
});

grunt.registerTask('test', function (test) {
// ### Test
// **Testing utility**
//
// `grunt test:unit/apps_spec.js` will run just the tests inside the apps_spec.js file
//
// It works for any path relative to the core/test folder. It will also run all the tests in a single directory
//
// `grunt test:integration/api` - runs the api integration tests
// `grunt test:integration` - runs the integration tests in the root folder and excludes all api & model tests
grunt.registerTask('test', 'Run a particular spec file from the core/test directory e.g. `grunt test:unit/apps_spec.js`', function (test) {
if (!test) {
grunt.fail.fatal('No test provided. `grunt test` expects a filename. e.g.: `grunt test:unit/apps_spec.js`. Did you mean `npm test` or `grunt validate`?');
}
Expand Down Expand Up @@ -652,15 +573,13 @@ var _ = require('lodash'),
// ### Unit Tests *(sub task)*
// `grunt test-unit` will run just the unit tests
//
// Provided you already have a `config.js` file, you can run individual sections from
// [mochacli](#grunt-mocha-cli) by running:
// If you need to run an individual unit test file, you can use the `grunt test:<file_path>` task:
//
// `NODE_ENV=testing grunt mochacli:section`
// `grunt test:unit/config_spec.js`
//
// If you need to run an individual unit test file, you can do so, providing you have mocha installed globally
// by using a command in the form:
// This also works for folders (although it isn't recursive), E.g.
//
// `NODE_ENV=testing mocha --timeout=15000 --ui=bdd --reporter=spec core/test/unit/config_spec.js`
// `grunt test:unit/server_helpers`
//
// Unit tests are run with [mocha](http://mochajs.org/) using
// [should](https://github.com/visionmedia/should.js) to describe the tests in a highly readable style.
Expand All @@ -675,21 +594,19 @@ var _ = require('lodash'),
//
// Provided you already have a `config.js` file, you can run just the model integration tests by running:
//
// `NODE_ENV=testing grunt mochacli:model`
// `grunt test:integration/model`
//
// Or just the api integration tests by running:
//
// `NODE_ENV=testing grunt mochacli:api`
// `grunt test:integration/api`
//
// Integration tests are run with [mocha](http://mochajs.org/) using
// [should](https://github.com/visionmedia/should.js) to describe the tests in a highly readable style.
// Integration tests are different to the unit tests because they make requests to the database.
//
// If you need to run an individual integration test file you can do so, providing you have mocha installed
// globally, by using a command in the form (replace path to api_tags_spec.js with the test file you want to
// run):
// If you need to run an individual integration test file you can use the `grunt test:<file_path>` task:
//
// `NODE_ENV=testing mocha --timeout=15000 --ui=bdd --reporter=spec core/test/integration/api/api_tags_spec.js`
// `grunt test:integration/api/api_tags_spec.js`
//
// Their purpose is to test that both the api and models behave as expected when the database layer is involved.
// These tests are run against sqlite3, mysql and pg on travis and ensure that differences between the databases
Expand All @@ -703,10 +620,9 @@ var _ = require('lodash'),
// ### Route tests *(sub task)*
// `grunt test-routes` will run just the route tests
//
// If you need to run an individual route test file, you can do so, providing you have a `config.js` file and
// mocha installed globally by using a command in the form:
// If you need to run an individual route test file, you can use the `grunt test:<file_path>` task:
//
// `NODE_ENV=testing mocha --timeout=15000 --ui=bdd --reporter=spec core/test/functional/routes/admin_spec.js`
// `grunt test:functional/routes/admin_spec.js`
//
// Route tests are run with [mocha](http://mochajs.org/) using
// [should](https://github.com/visionmedia/should.js) and [supertest](https://github.com/visionmedia/supertest)
Expand Down Expand Up @@ -737,37 +653,6 @@ var _ = require('lodash'),
['test-setup', 'shell:ember:test']
);

// ### Functional tests *(sub task)*
// `grunt test-functional` will run just the functional tests
//
// You can use the `--target` argument to run any individual test file, or the admin or frontend tests:
//
// `grunt test-functional --target=client/editor_test.js` - run just the editor tests
//
// `grunt test-functional --target=client/` - run all of the tests in the client directory
//
// Functional tests are run with [phantom.js](http://phantomjs.org/) and defined using the testing api from
// [casper.js](http://docs.casperjs.org/en/latest/testing.html).
//
// An express server is started with the testing environment set, and then a headless phantom.js browser is
// used to make requests to that server. The Casper.js API then allows us to describe the elements and
// interactions we expect to appear on the page.
//
// The purpose of the functional tests is to ensure that Ghost is working as is expected from a user perspective
// including buttons and other important interactions in the admin UI.
grunt.registerTask('test-functional', 'Run functional interface tests (CasperJS)',
['test-setup', 'shell:ember:dev', 'cleanDatabase', 'express:test', 'spawnCasperJS', 'express:test:stop', 'test-functional-setup']
);

// ### Functional tests for the setup process
// `grunt test-functional-setup will run just the functional tests for the setup page.
//
// Setup only works with a brand new database, so it needs to run isolated from the rest of
// the functional tests.
grunt.registerTask('test-functional-setup', 'Run functional tests for setup',
['test-setup', 'cleanDatabase', 'express:test', 'spawnCasperJS:setup', 'express:test:stop']
);

// ### Coverage
// `grunt coverage` will generate a report for the Unit Tests.
//
Expand All @@ -782,8 +667,8 @@ var _ = require('lodash'),
['test-setup', 'mocha_istanbul:coverage']
);

grunt.registerTask('coverage-integration', 'Generate unit and integration tests coverage report',
['test-setup', 'mocha_istanbul:coverage_integration']
grunt.registerTask('coverage-all', 'Generate unit and integration tests coverage report',
['test-setup', 'mocha_istanbul:coverage_all']
);

// #### Master Warning *(Utility Task)*
Expand All @@ -794,9 +679,11 @@ var _ = require('lodash'),
grunt.registerTask('master-warn',
'Outputs a warning to runners of grunt prod, that master shouldn\'t be used for live blogs',
function () {
console.log('>', chalk.red('Always two there are, no more, no less. A master and a'),
chalk.bold.red('stable') + chalk.red('.'));
console.log('Use the', chalk.bold('stable'), 'branch for live blogs.', chalk.bold('Never'), 'master!');
console.log(chalk.red(
'Use the ' + chalk.bold('stable') + ' branch for live blogs. '
+ chalk.bold.underline('Never') + ' master!'
));
console.log('>', 'Always two there are, no more, no less. A master and a ' + chalk.bold('stable') + '.');
});

// ### Build About Page *(Utility Task)*
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2013-2015 Ghost Foundation
Copyright (c) 2013-2016 Ghost Foundation

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# [Ghost (0.7.8)](https://github.com/TryGhost/Ghost) [![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/)
# [Ghost (0.7.9)](https://github.com/TryGhost/Ghost) [![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/)

Want to install Ghost on Azure? Just click the 'Deploy to Azure' button and you're well on your way to have a Ghost Blog running within a minute or two. Made with :heart: for Ghost by Microsoft DX.

Expand Down

1 comment on commit 52c085a

@MaherJendoubi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.