Skip to content

Commit 8366f30

Browse files
committed
Fix automation test script.
The test cases should be run in sequence. Set default timeout time to 8 seconds. Exclude some un-verified test cases, they would be added again. Add a file to list all known failed test cases.
1 parent c1426db commit 8366f30

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

tests/automation/config.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"format": "xunit-file",
33
"exclude": ["node_modules", "output", "internal", "res", "app", "node-remote", "save_devtools_settings", "single_instance",
44
"source-maps", "temp_dir",
5-
"call_require_with_node-main_set", "show_devtool_after_http_server_created_in_node_main", "reference-node-main"],
5+
"call_require_with_node-main_set", "show_devtool_after_http_server_created_in_node_main", "reference-node-main",
6+
"start_app", "chromedriver2_server", "console", "crash_dump", "datapath", "fast_open_and_close_devtools",
7+
"loaded_event", "node", "nw-in-mem", "process", "quit_with_secondary_window_on_top", "reload_application"
8+
],
69
"single": "",
7-
"timeout": "5000",
10+
"timeout": "8000",
811
"slow": "200",
912
"quiet": false
1013
}

tests/automation/failures.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Failed test cases
2+
=======================
3+
4+
* cookies_api
5+
6+
* document_cookies
7+
8+
* website
9+
10+
* user-agent
11+
12+
* user-agent-app
13+
14+
* chromium-args
15+
16+

tests/automation/mocha_test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,14 @@ function performTests(config) {
140140
curChildProcess = spawTestProcessByNW(testSuites[curIdx]);
141141
children.push(curChildProcess);
142142
curChildProcess.on('exit', function(code, signal) {
143-
(function(p) {
143+
(function(p, c) {
144144
prefix = (code === 0 ? colors.green('[Success]') : colors.red('[Failure]'));
145-
print(prefix + ' : ' + colors.underline(p.testcase) + ' with exit code ' + code);
145+
print(prefix + ' : ' + colors.underline(p.testcase) + ' with exit code ' + c);
146146
clearTimeout(timerId);
147147
p.removeAllListeners('exit');
148+
p.kill('SIGKILL');
148149
runNextTestByNW();
149-
})(curChildProcess);
150+
})(curChildProcess, code);
150151
});
151152
} else {
152153
if (timerId) {
@@ -168,6 +169,7 @@ function performTests(config) {
168169
if (idx || idx >= 0) {
169170
var p = children[idx];
170171
print(colors.yellow('[Timeout]') + ' : ' + colors.underline(p.testcase));
172+
p.removeAllListeners('exit');
171173
p.kill('SIGKILL'); // 'SIGKILL', 'SIGTERM'
172174
p = undefined;
173175
runNextTestByNW();

0 commit comments

Comments
 (0)