mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
5 Commits
4.0.0-beta
...
debug-test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c2be73a88 | ||
|
|
884bbe01f0 | ||
|
|
bd57bce2d3 | ||
|
|
331ed78854 | ||
|
|
abe579d332 |
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -2,7 +2,7 @@ name: Run tests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master, dev ]
|
branches: [ master, dev, debug-tests ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master, dev ]
|
branches: [ master, dev ]
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@
|
|||||||
"mermaid": "^10.4.0",
|
"mermaid": "^10.4.0",
|
||||||
"minami": "1.2.3",
|
"minami": "1.2.3",
|
||||||
"mocha": "9.2.2",
|
"mocha": "9.2.2",
|
||||||
"node-red-node-test-helper": "^0.3.3",
|
"node-red-node-test-helper": "^0.3.4-debug",
|
||||||
"nodemon": "2.0.20",
|
"nodemon": "2.0.20",
|
||||||
"proxy": "^1.0.2",
|
"proxy": "^1.0.2",
|
||||||
"sass": "1.62.1",
|
"sass": "1.62.1",
|
||||||
|
|||||||
@@ -44,9 +44,11 @@ var activeNodesToFlow = {};
|
|||||||
|
|
||||||
var typeEventRegistered = false;
|
var typeEventRegistered = false;
|
||||||
|
|
||||||
|
let lastStarterStack
|
||||||
|
|
||||||
function init(runtime) {
|
function init(runtime) {
|
||||||
if (started) {
|
if (started) {
|
||||||
throw new Error("Cannot init without a stop");
|
throw new Error("Cannot init without a stop:" + lastStarterStack);
|
||||||
}
|
}
|
||||||
settings = runtime.settings;
|
settings = runtime.settings;
|
||||||
storage = runtime.storage;
|
storage = runtime.storage;
|
||||||
@@ -269,12 +271,12 @@ function getFlows() {
|
|||||||
return activeConfig;
|
return activeConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function start(type,diff,muteLog,isDeploy) {
|
async function start(type,diff,muteLog,isDeploy, traceError) {
|
||||||
type = type || "full";
|
type = type || "full";
|
||||||
if (diff && diff.globalConfigChanged) {
|
if (diff && diff.globalConfigChanged) {
|
||||||
type = 'full'
|
type = 'full'
|
||||||
}
|
}
|
||||||
|
lastStarterStack = traceError || new Error('Flows started here').stack
|
||||||
started = true;
|
started = true;
|
||||||
state = 'start'
|
state = 'start'
|
||||||
var i;
|
var i;
|
||||||
@@ -334,6 +336,7 @@ async function start(type,diff,muteLog,isDeploy) {
|
|||||||
log.info(log._("nodes.flows.stopped-flows"));
|
log.info(log._("nodes.flows.stopped-flows"));
|
||||||
events.emit("runtime-event",{id:"runtime-state",payload:{ state: 'stop', deploy:isDeploy },retain:true});
|
events.emit("runtime-event",{id:"runtime-state",payload:{ state: 'stop', deploy:isDeploy },retain:true});
|
||||||
state = 'stop'
|
state = 'stop'
|
||||||
|
lastStarterStack = null
|
||||||
started = false
|
started = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -454,6 +457,7 @@ function stop(type,diff,muteLog,isDeploy) {
|
|||||||
if (diff.globalConfigChanged) {
|
if (diff.globalConfigChanged) {
|
||||||
type = 'full'
|
type = 'full'
|
||||||
}
|
}
|
||||||
|
lastStarterStack = null
|
||||||
started = false;
|
started = false;
|
||||||
state = 'stop'
|
state = 'stop'
|
||||||
var promises = [];
|
var promises = [];
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ function getVersion() {
|
|||||||
* @memberof @node-red/runtime
|
* @memberof @node-red/runtime
|
||||||
*/
|
*/
|
||||||
function start() {
|
function start() {
|
||||||
|
const startedCaller = new Error('runtime/lib/index.start started here').stack
|
||||||
return i18n.registerMessageCatalog("runtime",path.resolve(path.join(__dirname,"..","locales")),"runtime.json")
|
return i18n.registerMessageCatalog("runtime",path.resolve(path.join(__dirname,"..","locales")),"runtime.json")
|
||||||
.then(function() { return storage.init(runtime)})
|
.then(function() { return storage.init(runtime)})
|
||||||
.then(function() { return settings.load(storage)})
|
.then(function() { return settings.load(storage)})
|
||||||
@@ -233,7 +234,7 @@ function start() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return redNodes.loadContextsPlugin().then(function () {
|
return redNodes.loadContextsPlugin().then(function () {
|
||||||
redNodes.loadFlows().then(() => { redNodes.startFlows() }).catch(function(err) {});
|
redNodes.loadFlows().then(() => { redNodes.startFlows(null, null, null, null, startedCaller) }).catch(function(err) {});
|
||||||
started = true;
|
started = true;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ describe('inject node', function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEach(async function() {
|
afterEach(function(done) {
|
||||||
helper.unload().then(function () {
|
helper.unload().then(function () {
|
||||||
return Context.clean({allNodes: {}});
|
return Context.clean({allNodes: {}});
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ describe('websocket Node', function() {
|
|||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
closeAll();
|
closeAll();
|
||||||
helper.unload();
|
return helper.unload();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('websocket-listener', function() {
|
describe('websocket-listener', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user