-
Notifications
You must be signed in to change notification settings - Fork 23
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
the grunt execution is stuck #71
Comments
OK, I found the error. it is a webpack folder the src, it is like this: coverage.src = [
`${process.cwd()}/${builder.config.folder.src.root}config/grunt/**`,
`${process.cwd()}/${builder.config.folder.src.root}config/karma/**`,
`${process.cwd()}/${builder.config.folder.src.root}config/protractor/**`,
// `${process.cwd()}/${builder.config.folder.src.root}config/webpack/**`,
`${process.cwd()}/${builder.config.folder.src.root}task/**`,
`${process.cwd()}/${builder.config.folder.test.mocha.root}**`
]; Is there an exclude in the |
I added this: {
"cory-coverage": {
"src": [
"!/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/src/config/webpack",
"/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/bin/",
"/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/src/",
"/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/test/mocha/"
],
"options": {
"mask": "**/*.js",
"includes": [
"/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/bin/**",
"/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/src/**",
"/home/patrikx3/Projects/patrikx3/corifeus/corifeus-builder-angular/test/mocha/**"
],
"coverageFolder": "build/coverage/",
"reportFormats": [
"clover",
"html",
"text"
]
}
}
} But it doesn't allow me to exclude with |
I found the file that stops, do you have an idea why it stops the processing? (function(window, document, navigator) {
'use strict';
if (window.corifeusCssFiles === undefined && window.corifeusScriptFiles === undefined) {
window.corifeusCssFiles = [];
window.corifeusScriptFiles = [];
}
window.corifeus = {
booted: false,
core: {
http: {
counter: 0
}
}
}
window.corifeusPreloader = {
wait: navigator.userAgent === 'corifeus-server-renderer',
status: {
corifeus: window.corifeus
}
}
'GENERATED-HEAD';
if (!document.getElementById) {
document.getElementById = function() {};
}
var cssFiles = window.corifeusCssFiles;
var scriptFiles = window.corifeusScriptFiles;
var files = cssFiles.concat(scriptFiles);
var progress = {};
var responseText = {};
var started = new Date().getTime();
function formatBytes(bytes,decimals) {
if(bytes == 0) return '0 Byte';
var k = 1000; // or 1024 for binary
var dm = decimals + 1 || 3;
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
var i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
}
var formatTime = function(time) {
var seconds = Math.floor(time / 1000);
var minutes = Math.floor(seconds / 60);
var hours = Math.floor(minutes / 60);
var days = Math.floor(hours / 24);
hours = hours - (days * 24);
minutes = minutes - (days * 24 * 60) - (hours * 60);
seconds = seconds - (days * 24 * 60 * 60) - (hours * 60 * 60) - (minutes * 60);
if (days < 10) days = '0' + days;
if (hours < 10) hours = '0' + hours;
if (minutes < 10) minutes = '0' + minutes;
if (seconds < 10) seconds = '0' + seconds;
var template = '';
if (days != '00') {
template += days + ':';
}
if (hours != '00' || days != '00') {
template += hours + ':';
}
template += minutes + ':';
template += seconds
return template;
}
function loadFile(url) {
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.onreadystatechange = function() {
if (this.readyState == this.DONE) {
responseText[url] = xhr.responseText;
fire(true, this.responseText);
}
};
xhr.onprogress = function(event) {
progress[url] = event;
fire();
}
xhr.send();
}
function iterate(cb) {
for(var index = 0; index < files.length; index++) {
var file = files[index];
cb(file);
}
}
function includesCss(file) {
for(var index = 0; index < cssFiles.length; index++) {
var cssFile = cssFiles[index];
if (cssFile === file) {
return true;
}
}
return false;
}
var total = 0;
var loaded = 0;
var counter = 0;
var totalDone = false;
var frame = 33;
var computable = true;
var overlayPercent = function(percent) {
document.getElementById('cory-loader-progress-overlay').style.height = Math.round(percent) + '%';
document.getElementById('cory-loader-progress-overlay').style.width = '100%';
}
var loop = (function() {
if (totalDone) {
return;
}
if (document.getElementById('cory-loader-progress-bottom')) {
var percentRaw = (loaded / total);
var percent = (percentRaw * 100).toFixed(2);
var totalMB = formatBytes(total, 1);
var loadedMB = formatBytes(loaded, 1);
if (isNaN(percent)) {
percent = 0.5;
}
var current = new Date().getTime() - started;
var maxTime = current / percent * 100;
var left = maxTime - current;
overlayPercent(percent);
var top = document.getElementById('cory-loader-progress-top');
var bottom = document.getElementById('cory-loader-progress-bottom');
if (computable) {
top.innerHTML = formatTime(left);
bottom.innerHTML = percent + '%' + '<div class="cory-loader-progress-info">' + loadedMB + ' / ' + totalMB + '</br>' + formatTime(current) + ' / ' + formatTime(maxTime) + '</div>';
} else {
top.innerHTML = '<div class="cory-loader-progress-info">gzip</div>';
bottom.innerHTML = formatTime(current) + '</br></br>' + loadedMB;
}
}
setTimeout(loop, frame);
});
loop();
function fire(isDone) {
total = 0;
loaded = 0;
iterate(function(file) {
if (progress[file] !== undefined) {
if (progress[file].lengthComputable === false) {
computable = false;
total += progress[file].loaded;
} else {
total += progress[file].total;
}
loaded += progress[file].loaded;
}
})
totalDone = isDone === true && ++counter == files.length;
}
var final = function() {
// document.getElementById('cory-loader-progress-top').innerHTML = '<div></div>';
// document.getElementById('cory-loader-progress-bottom').innerHTML = '<span class="cory-loader-progress-start">START</span>';
overlayPercent(100);
setTimeout(function() {
iterate(function(file) {
var body = document.querySelector('body');
var head = document.querySelector('head');
// it is important so that the css is in the head
if (includesCss(file)) {
/*
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = responseText[file];
head.appendChild(style)
*/
var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = file;
link.type = 'text/css';
head.appendChild(link);
} else {
var script = document.createElement("script");
script.type = 'text/javascript';
script.defer = true;
script.src = file;
/*
script.innerHTML= responseText[file];
*/
body.appendChild(script);
}
})
var booted = function() {
if (window.corifeus.booted === true) {
var removeMe = document.getElementById('cory-loader');
if (removeMe !== null) {
removeMe.parentNode.removeChild(removeMe);
}
}
else {
setTimeout(booted, 100);
}
}
booted();
}, frame)
}
iterate(function(file) {
loadFile(file, fire)
})
var waitForDone = function() {
if (totalDone && !window.corifeusPreloader.wait) {
final();
return;
}
window.corifeusPreloader.status.corifeus = window.corifeus;
setTimeout(waitForDone, frame);
}
waitForDone();
})(typeof(window) === 'undefined' ? this : window, typeof(document) === 'undefined' ? {} : document, typeof(navigator) === 'undefined' ? { userAgent : 'corifeus-server-renderer'} : navigator); |
This is a plugin client side function. |
weird, maybe it's a mocha issue, but the only line that is awkward "js-wise" speaking is |
yeah i removed it, but still it keeps the stuck. i guess mocha 4 changed something that i don't know. |
because this grunt plugin is actually just a "exec thin layer", with only a few utilities added, it's either mocha or istanbul that is crapping out |
I am having exact same issue. I pushed some minor change to my code today, and Travis is failing on all nodejs versions. |
@p3x-robot you are right: they changed a default behavior in v4 to not "exit" but rather let the test program end. So if you use some libraries and don't clean up after them, your test program will be stuck indefinitely. To change the behavior to be like v3, we need to add flag
More info: mochajs/mocha#2879 |
ahh. thanks |
yeah, it works, just added 👍 mocha_istanbul: {
'cory-coverage': {
src: [
// `${process.cwd()}/${folder.bin.root}` ,
`${process.cwd()}/${folder.src.root}` ,
`${process.cwd()}/${folder.test.mocha.root}`,
], // the folder, not the files
options: {
mochaOptions: ['--exit'],
mask: '**/*.js',
includes: [
// `${process.cwd()}/${folder.bin.root}**` ,
`${process.cwd()}/${folder.src.root}**` ,
`${process.cwd()}/${folder.test.mocha.root}**`,
],
/*
to add more local files, outside directories
mochaOptions: [
'cli.js'
],
*/
coverageFolder: folder.build.coverage.root,
reportFormats: [
'clover',
'html',
'text'
]
}
}
}, |
Ciao!
How are you today?
It is very weird. I use it in like 33 projects, but I have a repo
patrikx3/corifeus-builder-angular
and it just stuck, it waits for something but I do not know what it does. Like 2 weeks ago it was working, not it is stuck.All that happens is this:
That's it and it doesn't go to the next task in
grunt
.Do you have an idea what it could be?
In the
patrikx3/corifues-builder
it is the exact structure and it works:No idea it is stuck. :(
With
It works though, just shows no coverage.
The text was updated successfully, but these errors were encountered: