mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
12 Commits
tidy-up-pa
...
debug-test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c2be73a88 | ||
|
|
884bbe01f0 | ||
|
|
bd57bce2d3 | ||
|
|
331ed78854 | ||
|
|
abe579d332 | ||
|
|
37265cf4ef | ||
|
|
8a63275989 | ||
|
|
7fc64a84e8 | ||
|
|
02f7cdd5aa | ||
|
|
d7dcceef60 | ||
|
|
ae5e1570ae | ||
|
|
3ca045394a |
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@@ -2,7 +2,7 @@ name: Run tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, dev ]
|
||||
branches: [ master, dev, debug-tests ]
|
||||
pull_request:
|
||||
branches: [ master, dev ]
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
"mermaid": "^10.4.0",
|
||||
"minami": "1.2.3",
|
||||
"mocha": "9.2.2",
|
||||
"node-red-node-test-helper": "^0.3.2",
|
||||
"node-red-node-test-helper": "^0.3.4-debug",
|
||||
"nodemon": "2.0.20",
|
||||
"proxy": "^1.0.2",
|
||||
"sass": "1.62.1",
|
||||
|
||||
@@ -491,6 +491,11 @@ RED.workspaces = (function() {
|
||||
createWorkspaceTabs();
|
||||
RED.events.on("sidebar:resize",workspace_tabs.resize);
|
||||
|
||||
RED.events.on("workspace:clear", () => {
|
||||
// Reset the index used to generate new flow names
|
||||
workspaceIndex = 0
|
||||
})
|
||||
|
||||
RED.actions.add("core:show-next-tab",function() {
|
||||
var oldActive = activeWorkspace;
|
||||
workspace_tabs.nextTab();
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<script type="text/html" data-help-name="global-config">
|
||||
<p>大域的なフローの設定を保持するノード。大域的な環境変数の定義を含みます。</p>
|
||||
</script>p
|
||||
</script>
|
||||
|
||||
@@ -44,9 +44,11 @@ var activeNodesToFlow = {};
|
||||
|
||||
var typeEventRegistered = false;
|
||||
|
||||
let lastStarterStack
|
||||
|
||||
function init(runtime) {
|
||||
if (started) {
|
||||
throw new Error("Cannot init without a stop");
|
||||
throw new Error("Cannot init without a stop:" + lastStarterStack);
|
||||
}
|
||||
settings = runtime.settings;
|
||||
storage = runtime.storage;
|
||||
@@ -269,12 +271,12 @@ function getFlows() {
|
||||
return activeConfig;
|
||||
}
|
||||
|
||||
async function start(type,diff,muteLog,isDeploy) {
|
||||
async function start(type,diff,muteLog,isDeploy, traceError) {
|
||||
type = type || "full";
|
||||
if (diff && diff.globalConfigChanged) {
|
||||
type = 'full'
|
||||
}
|
||||
|
||||
lastStarterStack = traceError || new Error('Flows started here').stack
|
||||
started = true;
|
||||
state = 'start'
|
||||
var i;
|
||||
@@ -334,6 +336,7 @@ async function start(type,diff,muteLog,isDeploy) {
|
||||
log.info(log._("nodes.flows.stopped-flows"));
|
||||
events.emit("runtime-event",{id:"runtime-state",payload:{ state: 'stop', deploy:isDeploy },retain:true});
|
||||
state = 'stop'
|
||||
lastStarterStack = null
|
||||
started = false
|
||||
return
|
||||
}
|
||||
@@ -454,6 +457,7 @@ function stop(type,diff,muteLog,isDeploy) {
|
||||
if (diff.globalConfigChanged) {
|
||||
type = 'full'
|
||||
}
|
||||
lastStarterStack = null
|
||||
started = false;
|
||||
state = 'stop'
|
||||
var promises = [];
|
||||
|
||||
@@ -131,6 +131,7 @@ function getVersion() {
|
||||
* @memberof @node-red/runtime
|
||||
*/
|
||||
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")
|
||||
.then(function() { return storage.init(runtime)})
|
||||
.then(function() { return settings.load(storage)})
|
||||
@@ -233,7 +234,7 @@ function start() {
|
||||
}
|
||||
}
|
||||
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;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@ describe('inject node', function() {
|
||||
});
|
||||
}
|
||||
|
||||
afterEach(async function() {
|
||||
afterEach(function(done) {
|
||||
helper.unload().then(function () {
|
||||
return Context.clean({allNodes: {}});
|
||||
}).then(function () {
|
||||
|
||||
@@ -60,6 +60,7 @@ describe('HTTP Request Node', function() {
|
||||
function startServer(done) {
|
||||
testPort += 1;
|
||||
testServer = stoppable(http.createServer(testApp));
|
||||
const promises = []
|
||||
testServer.listen(testPort,function(err) {
|
||||
testSslPort += 1;
|
||||
console.log("ssl port", testSslPort);
|
||||
@@ -81,13 +82,17 @@ describe('HTTP Request Node', function() {
|
||||
*/
|
||||
};
|
||||
testSslServer = stoppable(https.createServer(sslOptions,testApp));
|
||||
testSslServer.listen(testSslPort, function(err){
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log("started testSslServer");
|
||||
}
|
||||
});
|
||||
console.log('> start testSslServer')
|
||||
promises.push(new Promise((resolve, reject) => {
|
||||
testSslServer.listen(testSslPort, function(err){
|
||||
console.log(' done testSslServer')
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
});
|
||||
}))
|
||||
|
||||
testSslClientPort += 1;
|
||||
var sslClientOptions = {
|
||||
@@ -97,10 +102,17 @@ describe('HTTP Request Node', function() {
|
||||
requestCert: true
|
||||
};
|
||||
testSslClientServer = stoppable(https.createServer(sslClientOptions, testApp));
|
||||
testSslClientServer.listen(testSslClientPort, function(err){
|
||||
console.log("ssl-client", err)
|
||||
});
|
||||
|
||||
console.log('> start testSslClientServer')
|
||||
promises.push(new Promise((resolve, reject) => {
|
||||
testSslClientServer.listen(testSslClientPort, function(err){
|
||||
console.log(' done testSslClientServer')
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
});
|
||||
}))
|
||||
testProxyPort += 1;
|
||||
testProxyServer = stoppable(httpProxy(http.createServer()))
|
||||
|
||||
@@ -109,7 +121,17 @@ describe('HTTP Request Node', function() {
|
||||
res.setHeader("x-testproxy-header", "foobar")
|
||||
}
|
||||
})
|
||||
testProxyServer.listen(testProxyPort)
|
||||
console.log('> testProxyServer')
|
||||
promises.push(new Promise((resolve, reject) => {
|
||||
testProxyServer.listen(testProxyPort, function(err) {
|
||||
console.log(' done testProxyServer')
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
}))
|
||||
|
||||
testProxyAuthPort += 1
|
||||
testProxyServerAuth = stoppable(httpProxy(http.createServer()))
|
||||
@@ -131,9 +153,19 @@ describe('HTTP Request Node', function() {
|
||||
res.setHeader("x-testproxy-header", "foobar")
|
||||
}
|
||||
})
|
||||
testProxyServerAuth.listen(testProxyAuthPort)
|
||||
console.log('> testProxyServerAuth')
|
||||
promises.push(new Promise((resolve, reject) => {
|
||||
testProxyServerAuth.listen(testProxyAuthPort, function(err) {
|
||||
console.log(' done testProxyServerAuth')
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
resolve()
|
||||
}
|
||||
})
|
||||
}))
|
||||
|
||||
done(err);
|
||||
Promise.all(promises).then(() => { done() }).catch(done)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -429,7 +461,11 @@ describe('HTTP Request Node', function() {
|
||||
if (err) {
|
||||
done(err);
|
||||
}
|
||||
helper.startServer(done);
|
||||
console.log('> helper.startServer')
|
||||
helper.startServer(function(err) {
|
||||
console.log('> helper started')
|
||||
done(err)
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ describe('websocket Node', function() {
|
||||
|
||||
afterEach(function() {
|
||||
closeAll();
|
||||
helper.unload();
|
||||
return helper.unload();
|
||||
});
|
||||
|
||||
describe('websocket-listener', function() {
|
||||
|
||||
Reference in New Issue
Block a user