mirror of
https://github.com/yeslayla/run-gut-tests-action.git
synced 2026-04-01 07:43:21 +02:00
Test error checking
This commit is contained in:
25
dist/index.js
vendored
25
dist/index.js
vendored
@@ -12197,9 +12197,21 @@ try {
|
|||||||
process.chdir(work_dir);
|
process.chdir(work_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let script_errors = [];
|
||||||
|
|
||||||
|
// Test handler stream
|
||||||
var test_handler = new stream.Writable({
|
var test_handler = new stream.Writable({
|
||||||
write: function(chunk, encoding, next) {
|
write: function(chunk, encoding, next) {
|
||||||
console.log("LINE: " + chunk.toString());
|
|
||||||
|
// Check for script errors
|
||||||
|
let re = new RegExp("SCRIPT ERROR: ?([^']+)'?:", "i")
|
||||||
|
var match = re.exec(chunk.toString());
|
||||||
|
if (match) {
|
||||||
|
script_errors.push(match[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print to stdout
|
||||||
|
console.log(chunk.toString());
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -12232,6 +12244,17 @@ try {
|
|||||||
if( data.StatusCode != "0" )
|
if( data.StatusCode != "0" )
|
||||||
{
|
{
|
||||||
core.setFailed("GUT tests failed!");
|
core.setFailed("GUT tests failed!");
|
||||||
|
} else if (script_errors.length > 0) // Check for script errors
|
||||||
|
{
|
||||||
|
// Fail action
|
||||||
|
core.setFailed(script_errors.length.toString() + " script errors were found!");
|
||||||
|
|
||||||
|
// Log script errors
|
||||||
|
console.log("The following scripts had script errors:")
|
||||||
|
script_errors.forEach(error => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
25
main.js
25
main.js
@@ -18,9 +18,21 @@ try {
|
|||||||
process.chdir(work_dir);
|
process.chdir(work_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let script_errors = [];
|
||||||
|
|
||||||
|
// Test handler stream
|
||||||
var test_handler = new stream.Writable({
|
var test_handler = new stream.Writable({
|
||||||
write: function(chunk, encoding, next) {
|
write: function(chunk, encoding, next) {
|
||||||
console.log("LINE: " + chunk.toString());
|
|
||||||
|
// Check for script errors
|
||||||
|
let re = new RegExp("SCRIPT ERROR: ?([^']+)'?:", "i")
|
||||||
|
var match = re.exec(chunk.toString());
|
||||||
|
if (match) {
|
||||||
|
script_errors.push(match[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print to stdout
|
||||||
|
console.log(chunk.toString());
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -53,6 +65,17 @@ try {
|
|||||||
if( data.StatusCode != "0" )
|
if( data.StatusCode != "0" )
|
||||||
{
|
{
|
||||||
core.setFailed("GUT tests failed!");
|
core.setFailed("GUT tests failed!");
|
||||||
|
} else if (script_errors.length > 0) // Check for script errors
|
||||||
|
{
|
||||||
|
// Fail action
|
||||||
|
core.setFailed(script_errors.length.toString() + " script errors were found!");
|
||||||
|
|
||||||
|
// Log script errors
|
||||||
|
console.log("The following scripts had script errors:")
|
||||||
|
script_errors.forEach(error => {
|
||||||
|
console.log(error)
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user