Skip to content
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

Remove coverage generation from Shifter #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 0 additions & 1 deletion .shifter.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"silent": false,
"istanbul": true,
"build-dir": "./tests/assets-global/"
}
11 changes: 5 additions & 6 deletions conf/docs/index.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
--quiet to mute stdout from sub build
all other build options accepted here: (--strict, --lint, etc)
--jsstamp/--no-jsstamp Should it stamp the JS with the YUI.add wrapper, defaults to --stamp
--istanbul Use Istanbul code coverage instead of YUITest for coverage build
Experimental Options:
--semi Toggle on the strict semicolon checking in Uglify
--cache/--no-cache Cache the results of the build and bail if building for no reason, defaults to --no-cache
Expand Down Expand Up @@ -100,8 +99,10 @@ directory below `assets`, shifter will do the right thing.

<h2 id="coverage">Code Coverage</h2>

<p>When `shifter` builds a module, it auto generates a `-coverage` file generated with <a href="http://yuilibrary.com/yuitest">YUITest Code Coverage</a></p>
<p>If you pass the `--istanbul` option, `shifter` will use the new <a href="https://github.com/gotwarlost/istanbul">Istanbul Code Coverage</a> tool.</p>
<p>Code coverage used to be automatically generated when `shifter` built a module, but this has been deprecated in favour of generating coverage in
the <a href="https://github.com/yui/yeti">Yeti</a> tool.</p>

<p>If you do not use `yeti`, then you will need to instrument your own coverage files.</p>

<h2 id="meta">meta-data</h2>

Expand Down Expand Up @@ -259,7 +260,6 @@ merge them together, so your results may vary on this.</p>
```
"shifter": {
"jsstamp": false,
"coverage": false,
"lint": "defaults"
}
```
Expand Down Expand Up @@ -306,7 +306,6 @@ Below is an example `.shifter.json`:
"replace-yuivar": "F",
"replace-version": "1.2.3.4",
"lint": false,
"coverage": false,
"regex": "^.*?(?:logger|Y.log).*?(?:;|\\).*;|(?:\\r?\\n.*?)*?\\).*;).*;?.*?\\r?\\n|^.*?(?:\/\\*@DBG\\*\/).*\\r?\\n"
}
```
Expand Down Expand Up @@ -420,7 +419,7 @@ From time to time I will add experimental options to shifter to allow for develo

<p>
You can turn on build time caching with the `--cache` config option. This will write a cache file out with the MD5's of the build. If
the MD5 matches one in the meta file, the build will abort and skip the remaining tasks (`compressor, coverage, etc`) to speed up development.
the MD5 matches one in the meta file, the build will abort and skip the remaining tasks (`yuglify, etc`) to speed up development.
</p>

<p>
Expand Down
2 changes: 1 addition & 1 deletion conf/docs/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"projectName": "shifter - blazingly fast yui builder",
"version": "0.4.5",
"version": "0.4.6",
Copy link
Contributor

Choose a reason for hiding this comment

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

Bumping the version strikes me as premature, and entirely unrelated to this pull request.

Copy link
Member

Choose a reason for hiding this comment

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

agreed, this step is done by the build process triggered by the person doing the release.

"yuiSeedUrl": "http://yui.yahooapis.com/3.6.0/build/yui/yui.js"
}
4 changes: 0 additions & 4 deletions lib/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ var nopt = require('nopt'),
'color': Boolean,
'compressor': Boolean,
'config': require('path'),
'coverage': Boolean,
'csslint': Boolean,
'cssproc': String,
'excludes': Array,
'exec': Boolean,
'fail': Boolean,
'global-config': Boolean,
'help': Boolean,
'istanbul': Boolean,
'jsstamp': Boolean,
'lint': [ 'config', false ],
'lint-stderr': Boolean,
Expand Down Expand Up @@ -101,12 +99,10 @@ var setDefaults = function(parsed) {
}
//Default true
parsed.jsstamp = (parsed.jsstamp === undefined || parsed.jsstamp) ? true : false;
parsed.coverage = (parsed.coverage === undefined || parsed.coverage) ? true : false;
parsed.exec = (parsed.exec === undefined || parsed.exec) ? true : false;
parsed.csslint = (parsed.csslint === undefined || parsed.csslint) ? true : false;
parsed.color = (parsed.color === undefined || parsed.color) ? true : false;
parsed['global-config'] = (parsed['global-config'] === undefined || parsed['global-config']) ? true : false;
parsed.istanbul = (parsed.istanbul === undefined || parsed.istanbul) ? true : false;
parsed.assets = (parsed.assets === undefined || parsed.assets) ? true : false;

//Default false
Expand Down
6 changes: 0 additions & 6 deletions lib/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ var prebuild = function (jobs, options, callback) {
args.push('--no-semi');
}
}
if (options.coverage === false) {
args.push('--no-coverage');
}
if (options.istanbul) {
args.push('--istanbul');
}
args.unshift(util.shifter);

child = spawn(process.execPath, args, {
Expand Down
1 change: 0 additions & 1 deletion lib/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ if (args.help) {
console.log(' --quiet to mute stdout from sub build');
console.log(' all other build options accepted here: (--strict, --lint, etc)');
console.log(' --jsstamp/--no-jsstamp Should it stamp the JS with the YUI.add wrapper, defaults to --stamp');
console.log(' --istanbul Use Istanbul code coverage instead of YUITest for coverage build');
console.log('Experimental Options:');
console.log(' --semi Toggle on the strict semicolon checking in Uglify');
console.log(' --cache/--no-cache Cache the results of the build and bail if building for no reason, defaults to --no-cache');
Expand Down
39 changes: 1 addition & 38 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ var Stack = require('./stack').Stack,
compressor: 'YUICompressor',
jsminify: 'UglifyJS'
},
coverageType = 'yuitest',
compressorFn,
compressorConfig,
configCompressor = function (options) {
Expand Down Expand Up @@ -379,38 +378,6 @@ var buildJS = function (mod, name, callback) {

exports.js = buildJS;

var buildCoverage = function (mod, name, callback) {
log.info('shifting for coverage');
var queue = new Queue({
logger: log,
registry: registry
}),
fileName = mod.basefilename || name;

queue.read([
path.join(mod.buildDir, fileName, fileName + '.js')
])
.log('coverage file read, starting coverage for: ' + fileName + '/' + fileName + '.js')
.coverage({
type: coverageType,
charset: 'utf8',
name: 'build/' + fileName + '/' + fileName + '.js'
})
.replace(replaceOptions)
.check()
.log('writing coverage file to ' + fileName + '/' + fileName + '-coverage.js')
.write(path.join(mod.buildDir, fileName, fileName + '-coverage.js'))
.run(function (err) {
if (err) {
log.err('coverage: ' + err);
}
callback();
});

};

exports.coverage = buildCoverage;

var buildLang = function (mod, name, callback) {
var langs = [''].concat(mod.config.lang),
stack = new Stack();
Expand Down Expand Up @@ -682,7 +649,6 @@ var build = function (mod, name, options, callback) {
cacheBuild = options.cache;
strictMode = (options.strict);
cssLint = options.csslint;
coverageType = (options.istanbul) ? 'istanbul' : 'yuitest';
lintFail = options.fail;
lintSTDError = options['lint-stderr'];
mod.stamp = mod.shifter && typeof mod.shifter.jsstamp === 'boolean' ? mod.shifter.jsstamp : options.jsstamp;
Expand All @@ -692,11 +658,8 @@ var build = function (mod, name, options, callback) {
if ((mod.jsfiles && mod.jsfiles.length) || mod.yuifile) {
exports.js(mod, name, stack.add(function (err) {
if (err) {
log.warn('skipping coverage file build due to previous build error');
log.warn('skipping asset copy due to previous build error');
} else {
if (options.coverage) {
exports.coverage(mod, name, stack.add(noop));
}
if (options.cssproc) {
mod.cssproc = options.cssproc;
}
Expand Down
41 changes: 0 additions & 41 deletions lib/tasks/coverage.js

This file was deleted.

6 changes: 0 additions & 6 deletions lib/walk.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,9 @@ exports.run = function (options, callback) {
if (options.semi === false) {
args.push('--no-semi');
}
if (options.coverage === false) {
args.push('--no-coverage');
}
if (options.cache) {
args.push('--cache');
}
if (options.istanbul) {
args.push('--istanbul');
}
if (options.lint) {
args.push('--lint');
args.push(options.lint);
Expand Down
17 changes: 8 additions & 9 deletions output/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1><img src="http://yuilibrary.com/img/yui-logo.png"> shifter - blazingly fast
<div class="yui3-g">
<div class="yui3-u-3-4">
<div id="main">
<div class="content"><h2 id="welcome-to-shifter-045">welcome to shifter 0.4.5!</h2>
<div class="content"><h2 id="welcome-to-shifter-046">welcome to shifter 0.4.6!</h2>

<div class="intro">
<center>
Expand Down Expand Up @@ -51,7 +51,7 @@ <h2 id="help">command line arguments</h2>

<pre class="code terminal"><span class="noselect">$ </span>shifter -h

blazingly fast builds with [email protected].5
blazingly fast builds with [email protected].6

pass no arguments and shifter will build the module from the current directory

Expand All @@ -71,7 +71,6 @@ <h2 id="help">command line arguments</h2>
--quiet to mute stdout from sub build
all other build options accepted here: (--strict, --lint, etc)
--jsstamp&#x2F;--no-jsstamp Should it stamp the JS with the YUI.add wrapper, defaults to --stamp
--istanbul Use Istanbul code coverage instead of YUITest for coverage build
Experimental Options:
--semi Toggle on the strict semicolon checking in Uglify
--cache&#x2F;--no-cache Cache the results of the build and bail if building for no reason, defaults to --no-cache
Expand Down Expand Up @@ -123,8 +122,10 @@ <h2 id="skins">skin handling</h2>

<h2 id="coverage">Code Coverage</h2>

<p>When <code>shifter</code> builds a module, it auto generates a <code>-coverage</code> file generated with <a href="http://yuilibrary.com/yuitest">YUITest Code Coverage</a></p>
<p>If you pass the <code>--istanbul</code> option, <code>shifter</code> will use the new <a href="https://github.com/gotwarlost/istanbul">Istanbul Code Coverage</a> tool.</p>
<p>Code coverage used to be automatically generated when <code>shifter</code> built a module, but this has been deprecated in favour of generating coverage in
the <a href="https://github.com/yui/yeti">Yeti</a> tool.</p>

<p>If you do not use <code>yeti</code>, then you will need to instrument your own coverage files.</p>

<h2 id="meta">meta-data</h2>

Expand Down Expand Up @@ -277,7 +278,6 @@ <h3 id="build.json-root">root properties</h3>
<br>
<pre class="code prettyprint">&quot;shifter&quot;: {
&quot;jsstamp&quot;: false,
&quot;coverage&quot;: false,
&quot;lint&quot;: &quot;defaults&quot;
}</pre>

Expand Down Expand Up @@ -323,7 +323,6 @@ <h3 id="build.config">global config file</h3>
&quot;replace-yuivar&quot;: &quot;F&quot;,
&quot;replace-version&quot;: &quot;1.2.3.4&quot;,
&quot;lint&quot;: false,
&quot;coverage&quot;: false,
&quot;regex&quot;: &quot;^.*?(?:logger|Y.log).*?(?:;|\\).*;|(?:\\r?\\n.*?)*?\\).*;).*;?.*?\\r?\\n|^.*?(?:\&#x2F;\\*@DBG\\*\&#x2F;).*\\r?\\n&quot;
}</pre>

Expand Down Expand Up @@ -436,7 +435,7 @@ <h3 id="exp.cache">build file caching</h3>

<p>
You can turn on build time caching with the <code>--cache</code> config option. This will write a cache file out with the MD5's of the build. If
the MD5 matches one in the meta file, the build will abort and skip the remaining tasks (<code>compressor, coverage, etc</code>) to speed up development.
the MD5 matches one in the meta file, the build will abort and skip the remaining tasks (<code>yuglify, etc</code>) to speed up development.
</p>

<p>
Expand Down Expand Up @@ -536,7 +535,7 @@ <h2 class="no-toc">Table of Contents</h2>
<div class="bd">
<ul class="toc">
<li>
<a href="#welcome-to-shifter-045">welcome to shifter 0.4.5!</a>
<a href="#welcome-to-shifter-046">welcome to shifter 0.4.6!</a>
</li>
<li>
<a href="#what">what is shifter?</a>
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,21 @@
"gear": "~0.8.0",
"gear-lib": "~0.8.0",
"nopt": "*",
"yuitest-coverage": ">=0.0.5",
"yuicompressor": "2.4.7",
"yui-lint": "~0.1.1",
"jshint": "~0.9.0",
"watch": "~0.8.0",
"cpr": "~0.0.6",
"mkdirp": "*",
"rimraf": "*",
"istanbul": "0.1.37",
"which": "*",
"yuglify": "~0.1.0",
"timethat": "~0.0.1",
"cssproc": "~0.0.1",
"walkdir": "~0.0.5"
},
"devDependencies": {
"istanbul": "0.1.37",
"selleck": "*",
"vows": "*"
},
Expand Down
27 changes: 0 additions & 27 deletions tests/1-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ var argsTests = {
'--list': 'list',
'--exec': 'exec',
'--semi': 'semi',
'--istanbul': 'istanbul',
'--progress': 'progress',
'--assets': 'assets',
'--csslint': 'csslint',
'--coverage': 'coverage',
'--clean': 'clean',
'--lint-stderr': 'lint-stderr',
'-w': 'walk'
Expand Down Expand Up @@ -94,14 +92,6 @@ var tests = {
assert.isFalse(topic.progress);
}
},
'should parse --no-istanbul': {
topic: function() {
return args.parse(['', '', '--no-istanbul']);
},
'istanbul should be false': function(topic) {
assert.isFalse(topic.istanbul);
}
},
'should parse --no-semi': {
topic: function() {
return args.parse(['', '', '--no-semi']);
Expand Down Expand Up @@ -189,22 +179,6 @@ var tests = {
assert.isFalse(topic.exec);
}
},
'should parse --no-coverage': {
topic: function() {
return args.parse(['', '', '--no-coverage']);
},
'parsed as false': function(topic) {
assert.isFalse(topic.coverage);
}
},
'should have coverage by default': {
topic: function() {
return args.parse(['', '']);
},
'parsed as true': function(topic) {
assert.isTrue(topic.coverage);
}
},
'should have exec by default': {
topic: function() {
return args.parse(['', '']);
Expand Down Expand Up @@ -260,7 +234,6 @@ var tests = {
'should do something': function(topic) {
assert.ok(topic.spec); //from vows
assert.ok(topic.jsstamp);
assert.ok(topic.coverage);
assert.ok(topic.exec);
assert.isFalse(topic.quiet);
assert.isFalse(topic.cache);
Expand Down
Loading