Allow excluded specs in CI without breaking the output
This commit is contained in:
7
ci.js
7
ci.js
@@ -5,12 +5,14 @@ const path = require("path"),
|
|||||||
"passed" : "\x1B[32m",
|
"passed" : "\x1B[32m",
|
||||||
"failed": "\x1B[31m",
|
"failed": "\x1B[31m",
|
||||||
"pending": "\x1B[33m",
|
"pending": "\x1B[33m",
|
||||||
|
"excluded": "\x1B[0m",
|
||||||
"none": "\x1B[0m"
|
"none": "\x1B[0m"
|
||||||
},
|
},
|
||||||
symbols = {
|
symbols = {
|
||||||
"passed" : ".",
|
"passed" : ".",
|
||||||
"failed": "F",
|
"failed": "F",
|
||||||
"pending": "*",
|
"pending": "*",
|
||||||
|
"excluded": "",
|
||||||
"none": ""
|
"none": ""
|
||||||
},
|
},
|
||||||
host = `http://localhost:${port}`,
|
host = `http://localhost:${port}`,
|
||||||
@@ -150,7 +152,7 @@ async function getResults(driver) {
|
|||||||
const result = specResults.reduce((result, spec) => {
|
const result = specResults.reduce((result, spec) => {
|
||||||
result[spec.status] = [...result[spec.status], spec];
|
result[spec.status] = [...result[spec.status], spec];
|
||||||
return result;
|
return result;
|
||||||
}, {pending: [], failed: [], passed: []});
|
}, {pending: [], failed: [], passed: [], excluded: []});
|
||||||
|
|
||||||
if (result.pending.length) {
|
if (result.pending.length) {
|
||||||
console.log(`${colors["pending"]}Pending:`);
|
console.log(`${colors["pending"]}Pending:`);
|
||||||
@@ -164,7 +166,6 @@ async function getResults(driver) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result.failed.length) {
|
if (result.failed.length) {
|
||||||
process.exitCode = 1
|
|
||||||
console.log(`${colors["failed"]}Failed:`);
|
console.log(`${colors["failed"]}Failed:`);
|
||||||
result["failed"].forEach((spec, index) => {
|
result["failed"].forEach((spec, index) => {
|
||||||
console.log(`${colors["none"]}${index}) ${spec.fullName}`)
|
console.log(`${colors["none"]}${index}) ${spec.fullName}`)
|
||||||
@@ -187,6 +188,7 @@ async function getResults(driver) {
|
|||||||
|
|
||||||
const details = await driver.executeScript(`
|
const details = await driver.executeScript(`
|
||||||
return {
|
return {
|
||||||
|
overallStatus: jsApiReporter.runDetails.overallStatus,
|
||||||
executionTime: jsApiReporter.executionTime(),
|
executionTime: jsApiReporter.executionTime(),
|
||||||
random: jsApiReporter.runDetails.order.random,
|
random: jsApiReporter.runDetails.order.random,
|
||||||
seed: jsApiReporter.runDetails.order.seed
|
seed: jsApiReporter.runDetails.order.seed
|
||||||
@@ -195,6 +197,7 @@ async function getResults(driver) {
|
|||||||
console.log(`${colors["none"]}${specResults.length} spec(s), ${result.failed.length} failure(s), ${result.pending.length} pending spec(s)`);
|
console.log(`${colors["none"]}${specResults.length} spec(s), ${result.failed.length} failure(s), ${result.pending.length} pending spec(s)`);
|
||||||
console.log(`Finished in ${details.executionTime / 1000} second(s)`);
|
console.log(`Finished in ${details.executionTime / 1000} second(s)`);
|
||||||
console.log(`Randomized with seed ${details.seed} ( ${host}/?random=${details.random}&seed=${details.seed} )`);
|
console.log(`Randomized with seed ${details.seed} ( ${host}/?random=${details.random}&seed=${details.seed} )`);
|
||||||
|
process.exitCode = details.overallStatus === 'passed' ? 0 : 1;
|
||||||
|
|
||||||
if (useSauce) {
|
if (useSauce) {
|
||||||
driver.executeScript(`sauce:job-result=${process.exitCode === 0}`);
|
driver.executeScript(`sauce:job-result=${process.exitCode === 0}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user