Skip to content

Commit

Permalink
spec: add tests for comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Jul 20, 2020
1 parent c7041a1 commit 1fc9c06
Show file tree
Hide file tree
Showing 10 changed files with 7,880 additions and 5 deletions.
1 change: 0 additions & 1 deletion lib/ci/build-types/citgm_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const {

class CITGMBuild extends TestBuild {
constructor(cli, request, id) {
// There will always be at least one job id.
const path = `job/citgm-smoker/${id}/`;
const tree = CITGM_MAIN_TREE;

Expand Down
2 changes: 1 addition & 1 deletion lib/ci/build-types/citgm_comparison_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CITGMComparisonBuild {

const failures = {};
for (const platform in baseFailures) {
const { modules: baseModules } = comparisonFailures[platform];
const { modules: baseModules } = baseFailures[platform];
const { modules: comparisonModules } = comparisonFailures[platform];

const newFailures = comparisonModules.filter(f => {
Expand Down
15 changes: 13 additions & 2 deletions lib/ci/build-types/test_build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const chalk = require('chalk');
'use strict';

const chalk = require('chalk');
const { Job } = require('./job');
const { shortSha } = require('../../utils');
const {
Expand Down Expand Up @@ -46,6 +47,13 @@ class TestBuild extends Job {
this.builtOn = builtOn;
}

setDailyBuildData({ result, changeSet, actions, timestamp, builtOn }) {
this.change = changeSet.items[0] || {};
this.date = new Date(timestamp);
this.result = result;
this.builtOn = builtOn;
}

get sourceURL() {
const { params } = this;

Expand Down Expand Up @@ -124,7 +132,9 @@ class TestBuild extends Job {
displayBuilds() {
const { cli, failures, builds } = this;
for (const failure of failures) {
this.displayFailure(failure);
if (failure !== undefined) {
this.displayFailure(failure);
}
}
cli.separator('Other builds');
for (const aborted of builds.aborted) {
Expand All @@ -150,6 +160,7 @@ class TestBuild extends Job {
const { failures } = this;
let output = `Failures in job ${this.jobUrl}\n\n`;
for (const failure of failures) {
if (failure === undefined) continue;
output += `#### [${getNodeName(failure.url)}](${failure.url})`;
if (!failure.reason.includes('\n') && failure.reason.length < 20) {
const builtOn = failure.builtOn ? `On ${failure.builtOn}: ` : '';
Expand Down
Loading

0 comments on commit 1fc9c06

Please sign in to comment.