Skip to content

Commit

Permalink
Merge branch 'master' into release_v1
Browse files Browse the repository at this point in the history
  • Loading branch information
gcooney committed Nov 14, 2019
2 parents ebac7ff + 9fe9434 commit 9b62215
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
11 changes: 5 additions & 6 deletions README.md
Expand Up @@ -78,9 +78,8 @@ jobs:
deployment. A mabl plan is a collection of similarly configured tests.
- `plans_failed` {int32} - number of mabl plans that failed against this
deployment. A mabl plan is a collection of similarly configured tests.
- `journeys_run` {int32} - total number of mabl journeys run against this
deployment. A mabl journey is an end to end test of your application.
- `journeys_passed` {int32} - number of mabl journeys that passed against this
deployment. A mabl journey is an end to end test of your application.
- `journeys_failed` {int32} - number of mabl journeys that failed against this
deployment. A mabl journey is an end to end test of your application.
- `tests_run` {int32} - total number of mabl tests run against this deployment.
- `tests_passed` {int32} - number of mabl tests that passed against this
deployment.
- `tests_failed` {int32} - number of mabl tests that failed against this
deployment.
12 changes: 6 additions & 6 deletions action.yml
Expand Up @@ -55,12 +55,12 @@ outputs:
description: "number of mabl plans that passed against this deployment. A mabl plan is a collection of similarly configured tests."
plans_failed:
description: "number of mabl plans that failed against this deployment. A mabl plan is a collection of similarly configured tests."
journeys_run:
description: "total number of mabl journeys run against this deployment. A mabl journey is an end to end test of your application."
journeys_passed:
description: "number of mabl journeys that passed against this deployment. A mabl journey is an end to end test of your application."
journeys_failed:
description: "number of mabl journeys that failed against this deployment. A mabl journey is an end to end test of your application."
tests_run:
description: "total number of mabl tests run against this deployment."
tests_passed:
description: "number of mabl tests that passed against this deployment."
tests_failed:
description: "number of mabl tests that failed against this deployment."

runs:
using: "node12"
Expand Down
10 changes: 5 additions & 5 deletions src/index.ts
Expand Up @@ -158,28 +158,28 @@ async function run() {
'' + finalExecutionResult.plan_execution_metrics.failed,
);
core.setOutput(
'journeys_run',
'tests_run',
'' + finalExecutionResult.journey_execution_metrics.total,
);
core.setOutput(
'journeys_passed',
'tests_passed',
'' + finalExecutionResult.journey_execution_metrics.passed,
);
core.setOutput(
'journeys_failed',
'tests_failed',
'' + finalExecutionResult.journey_execution_metrics.failed,
);

if (finalExecutionResult.journey_execution_metrics.failed === 0) {
core.debug('Deployment plans passed');
} else if (continueOnPlanFailure) {
core.warning(
`There were ${finalExecutionResult.journey_execution_metrics.failed} journey failures but the continueOnPlanFailure flag is set so the task has been marked as passing`,
`There were ${finalExecutionResult.journey_execution_metrics.failed} test failures but the continueOnPlanFailure flag is set so the task has been marked as passing`,
);
// core.setNeutral(); Todo Set neutral when support is added to actions v2
} else {
core.setFailed(
`${finalExecutionResult.journey_execution_metrics.failed} mabl Journey(s) failed`,
`${finalExecutionResult.journey_execution_metrics.failed} mabl test(s) failed`,
);
}
} catch (err) {
Expand Down
14 changes: 7 additions & 7 deletions src/table.ts
Expand Up @@ -25,8 +25,8 @@ export function prettyPrintExecution(execution: Execution) {
execution.plan.app_href,
]);

let journeyTable = new Table({
head: ['Browser', 'Status', 'Journey Name', 'Duration', 'mabl App Link'],
let testTable = new Table({
head: ['Browser', 'Status', 'Test Name', 'Duration', 'mabl App Link'],
style: {
head: [],
border: [],
Expand All @@ -35,20 +35,20 @@ export function prettyPrintExecution(execution: Execution) {
wordWrap: true,
}) as HorizontalTable;
execution.journey_executions.forEach(jE => {
let journey: JourneyInfo | undefined = execution.journeys.find(
journey => journey.id === jE.journey_id,
let test: JourneyInfo | undefined = execution.journeys.find(
test => test.id === jE.journey_id,
);
journeyTable.push([
testTable.push([
jE.browser_type,
jE.success ? 'Passed' : 'Failed',
journey ? journey.name : jE.journey_id,
test ? test.name : jE.journey_id,
moment.utc(jE.stop_time - jE.start_time).format('HH:mm:ss'),
jE.app_href,
]);
});

outputTable(planTable);
outputTable(journeyTable);
outputTable(testTable);
}

function outputTable(table: HorizontalTable) {
Expand Down

0 comments on commit 9b62215

Please sign in to comment.