Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

Commit

Permalink
Use travis-fold
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Hanson committed Apr 25, 2018
1 parent e526a2b commit 653068e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 33 deletions.
71 changes: 38 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"oboe": "^2.1.3",
"source-map-support": "^0.4.0",
"tar": "^2.2.1",
"travis-fold": "^0.1.2",
"typescript": "next",
"yargs": "^8.0.2"
},
Expand Down
4 changes: 4 additions & 0 deletions src/check-parse-results.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as fold from "travis-fold";

import { Options } from "./lib/common";
import { fetchNpmInfo, NpmInfoVersion, NpmInfoVersions } from "./lib/npm-client";
import { AllPackages, AnyPackage, TypingsData } from "./lib/packages";
Expand All @@ -18,9 +20,11 @@ export default async function main(includeNpmChecks: boolean, options: Options,

checkPathMappings(allPackages);

if (fold.isTravis()) console.log(fold.start("Duplicate packages"));
const packages = allPackages.allPackages();
checkForDuplicates(packages, pkg => pkg.libraryName, "Library Name", log);
checkForDuplicates(packages, pkg => pkg.projectName, "Project Name", log);
if (fold.isTravis()) console.log(fold.end("Duplicate packages"));

const dependedOn = new Set<string>();
for (const pkg of packages) {
Expand Down
3 changes: 3 additions & 0 deletions src/tester/test-runner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { pathExists } from "fs-extra";
import * as fold from "travis-fold";
import * as yargs from "yargs";

import { Options } from "../lib/common";
Expand Down Expand Up @@ -86,6 +87,7 @@ async function runTests(
): Promise<void> {
const allFailures: Array<[string, string]> = [];

if (fold.isTravis()) console.log(fold.start("tests"));
await runWithListeningChildProcesses({
inputs: packages.map(p => ({ path: p.subDirectoryPath, onlyTestTsNext: !changed.has(p) })),
commandLineArgs: ["--listen"],
Expand All @@ -103,6 +105,7 @@ async function runTests(
}
},
});
if (fold.isTravis()) console.log(fold.end("tests"));

if (allFailures.length === 0) {
return;
Expand Down
8 changes: 8 additions & 0 deletions src/types/travis-fold.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
declare module "travis-fold" {
export function start(group: string): string;
export function end(group: string): string;
export function wrap(group: string, content: string): string;
export function pushStart(ret: string[], group: string): void;
export function pushEnd(ret: string[], group: string): void;
export function isTravis(): boolean;
}

0 comments on commit 653068e

Please sign in to comment.