Merge pull request +14317 from c9/ci-improve-client-tests

Ci improve client tests
This commit is contained in:
Matthijs van Henten 2016-06-20 10:02:33 +02:00 committed by GitHub
commit c7331988dd
9 changed files with 34 additions and 20 deletions

View File

@ -397,13 +397,8 @@ function checkCycles(config, lookup) {
delete unresolved[name];
});
var pluginsList = plugins.map(function(p) { return p.packagePath; }).join("\n");
var unresolvedList = Object.keys(unresolved);
var resolvedList = Object.keys(resolved);
console.warn("Could not resolve dependencies of these plugins:\n"
+ pluginsList + "\n", plugins,
"\nMissing services:\n" + unresolvedList.join("\n") + "\n", unresolved,
"\nResolved services:", resolvedList);
var err = new Error("Could not resolve dependencies\n"
+ (unresolvedList.length ? "Missing services: " + unresolvedList
: "Config contains cyclic dependencies" // TODO print cycles

9
node_modules/kaefer/lib/client.js generated vendored
View File

@ -50,6 +50,9 @@ var connectClient = module.exports = function(connectEio, options) {
});
eioSocket.on("message", function handshakeReply(msg) {
if (reconnectSocket.destroying) return;
if (reconnectSocket.socket && reconnectSocket.socket != eioSocket)
return console.error("reconenct for detached socket");
try {
msg = JSON.parse(msg);
} catch (e) {}
@ -75,11 +78,17 @@ var connectClient = module.exports = function(connectEio, options) {
});
eioSocket.on("error", function(e) {
if (reconnectSocket.destroying) return;
if (reconnectSocket.socket && reconnectSocket.socket != eioSocket)
return console.error("reconenct for detached socket");
console.error("Socket error; reconnecting:", e);
eioSocket.close();
reconnect();
});
eioSocket.on("close", function(e) {
if (reconnectSocket.destroying) return;
if (reconnectSocket.socket && reconnectSocket.socket != eioSocket)
return console.error("reconenct for detached socket");
console.error("Socket close; reconnecting:", e);
reconnect();
});

View File

@ -59,12 +59,12 @@
],
"c9plugins": {
"c9.ide.language": "#0e86345d39",
"c9.ide.language.core": "#10a225e77d",
"c9.ide.language.core": "#dcd180236b",
"c9.ide.language.css": "#46ad561506",
"c9.ide.language.generic": "#b47cbe58f9",
"c9.ide.language.html": "#cdc3960225",
"c9.ide.language.html.diff": "#7d6cecfb90",
"c9.ide.language.javascript": "#b82f16e56a",
"c9.ide.language.javascript": "#a5c1d05394",
"c9.ide.language.javascript.immediate": "#82c426dbca",
"c9.ide.language.javascript.eslint": "#cb9e3f5a8e",
"c9.ide.language.javascript.tern": "#0545a6385d",
@ -79,7 +79,7 @@
"c9.ide.run.debug": "#a84da3e7f8",
"c9.automate": "#47e2c429c9",
"c9.ide.ace.emmet": "#6dc4585e02",
"c9.ide.ace.gotoline": "#dcbe58d549",
"c9.ide.ace.gotoline": "#d33220b1e0",
"c9.ide.ace.keymaps": "#334a65192f",
"c9.ide.ace.repl": "#4b88a85b7b",
"c9.ide.ace.split": "#0ae0151c78",
@ -93,11 +93,11 @@
"c9.ide.format": "#f99082ff4c",
"c9.ide.help.support": "#fbe8eb5c36",
"c9.ide.imgeditor": "#612e75ef4f",
"c9.ide.immediate": "#76c8e3213a",
"c9.ide.immediate": "#b279c69c73",
"c9.ide.installer": "#b2e4ba0a92",
"c9.ide.language.python": "#15e7ff9a3f",
"c9.ide.language.go": "#6ce1c7a7ef",
"c9.ide.mount": "#3001a633f2",
"c9.ide.mount": "#b018ee501f",
"c9.ide.navigate": "#5d5707058c",
"c9.ide.newresource": "#981a408a7b",
"c9.ide.openfiles": "#2ae85a9e33",
@ -111,7 +111,7 @@
"c9.ide.processlist": "#2b12cd1bdd",
"c9.ide.run": "#d661a7b847",
"c9.ide.run.build": "#0598fff697",
"c9.ide.run.debug.xdebug": "#9956689819",
"c9.ide.run.debug.xdebug": "#054367574c",
"c9.ide.save": "#25a63f31e2",
"c9.ide.scm": "#637a68cd04",
"c9.ide.terminal.monitor": "#5a6a54ce24",
@ -120,7 +120,7 @@
"c9.ide.theme.flat": "#81dadeee55",
"c9.ide.threewaymerge": "#229382aa0b",
"c9.ide.undo": "#b028bcb4d5",
"c9.ide.upload": "#1ebe8411cf",
"c9.ide.upload": "#e4351f5a2b",
"c9.ide.welcome": "#5b86c44e92",
"c9.ide.guide": "#df7c89e449"
}

View File

@ -283,8 +283,11 @@ require(["lib/architect/architect", "lib/chai/chai"], function (architect, chai)
editor.setOption("wrapToView", true);
render();
var ace = editor.ace;
var cols = Math.floor((ace.container.offsetWidth - ace.renderer.gutterWidth - 2 * ace.renderer.$padding) / charWidth);
expect(document.querySelector(".ace_gutter-cell").offsetHeight).to.equal(lineHeight * 4);
expect(cols).to.equal(ace.session.getWrapLimit());
expect(document.querySelector(".ace_gutter-cell").offsetHeight).to.equal(lineHeight * ace.session.getRowLength(0));
done();
});
it('should allow setting wrapBehavioursEnabled', function(done) {

View File

@ -112,7 +112,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
// @todo Test mouse
// @todo Test menu
it('should reconnect when the connection has been lost', function(done) {
it.skip('should reconnect when the connection has been lost', function(done) {
var doc = tabs.focussedTab.document;
var session = doc.getSession();
@ -226,7 +226,7 @@ require(["lib/architect/architect", "lib/chai/chai", "/vfs-root"], function (arc
});
});
if (!onload.remain) {
it('should reconnect both terminals when doing kill-server', function(done) {
it.skip('should reconnect both terminals when doing kill-server', function(done) {
var count = 0;
tabs.getTabs().forEach(function(tab) {
var session = tab.document.getSession();

View File

@ -46,7 +46,12 @@ assert.AssertionError = function AssertionError(options) {
this.operator = options.operator;
this.message = options.message || getMessage(this);
var stackStartFunction = options.stackStartFunction || fail;
Error.captureStackTrace(this, stackStartFunction);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, stackStartFunction);
} else {
var err = new Error();
this.stack = err.stack;
}
};
// assert.AssertionError instanceof Error

View File

@ -345,7 +345,8 @@ define(function(require, exports, module) {
});
plugin.on("unload", function(){
loaded = false;
if (connection && connection.socket)
connection.socket.destroying = true;
if (consumer)
consumer.disconnect();
if (connection)

View File

@ -24,6 +24,7 @@
mocha.setup('bdd');
mocha.bail(false);
mocha.ignoreLeaks(true);
mocha.fullTrace && mocha.fullTrace();
window.onerror=function(msg){ var el=document.getElementById('jserror'); el.innerHTML+="<div class='jserr'>"+msg+"</div>";};
/* wrap setTimeout to prevent any plugins leaking timeouts to the next test*/
@ -120,6 +121,8 @@
runner.on('test end', function(test) {
stats.percent = stats.tests / runner.total * 100 | 0;
tests.push(test);
if (mocha._onSubTest)
mocha._onSubTest(test);
});
runner.on('end', function() {
@ -127,7 +130,6 @@
// e.g. using on instead of once can call done second time during app unload
// so we save the report at the time when test runner ended.
mocha.lastReport = mocha.getReport();
console.log(mocha.report);
});
function parseError(err) {

View File

@ -238,7 +238,7 @@ require([
layout.initMenus = function() {};
layout.findParent = function(){
if (!bar || bar.$amlDestroyed) {
if (!bar || bar.$amlDestroyed || !bar.$ext || !bar.$ext.parentNode) {
bar = apf.document.documentElement.appendChild(
new imports.ui.bar());
bar.$ext.style.position = "fixed";
@ -563,7 +563,6 @@ require([
if (err.missingMock.length) {
console.error("Missing mock services for " + err.missingMock);
} else {
console.warn("Adding mock services for " + err.unresolved);
return expect.setupArchitectTest(config, architect, {
mockPlugins: config.unresolved,
existingPlugins: err.resolved