Skip to content

Commit

Permalink
Fix mocha exiting with no test issue
Browse files Browse the repository at this point in the history
The tests were not being run.  This ended up being due to importing
from the lib/client/index.ts in the Docker pack.

All internal imports from lib/client were removed.

Remove GraphQL files from Docker pack.

[changelog:fixed]
  • Loading branch information
David Dooling committed Jun 25, 2020
1 parent 8890691 commit 0bb2317
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 75 deletions.
2 changes: 1 addition & 1 deletion lib/pack/docker/build/DockerBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import { GitProject } from "@atomist/automation-client/lib/project/git/GitProject";
import { Goal, GoalDefinition } from "../../../api/goal/Goal";
import { DefaultGoalNameGenerator } from "../../../api/goal/GoalNameGenerator";
import {
Expand All @@ -24,7 +25,6 @@ import {
mergeOptions,
} from "../../../api/goal/GoalWithFulfillment";
import { IndependentOfEnvironment } from "../../../api/goal/support/environment";
import { GitProject } from "../../../client";
import { DockerProgressReporter } from "./DockerProgressReporter";
import { DefaultDockerImageNameCreator, DockerImageNameCreator, executeDockerBuild } from "./executeDockerBuild";

Expand Down
6 changes: 5 additions & 1 deletion lib/pack/docker/build/executeDockerBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
* limitations under the License.
*/

import { HandlerContext } from "@atomist/automation-client/lib/HandlerContext";
import { Success } from "@atomist/automation-client/lib/HandlerResult";
import { GitProject } from "@atomist/automation-client/lib/project/git/GitProject";
import { QueryNoCacheOptions } from "@atomist/automation-client/lib/spi/graph/GraphClient";
import { executeAll } from "@atomist/automation-client/lib/util/pool";
import * as fs from "fs-extra";
import * as _ from "lodash";
import * as os from "os";
Expand All @@ -27,7 +32,6 @@ import { ExecuteGoalResult } from "../../../api/goal/ExecuteGoalResult";
import { ExecuteGoal } from "../../../api/goal/GoalInvocation";
import { mergeOptions } from "../../../api/goal/GoalWithFulfillment";
import { SdmGoalEvent } from "../../../api/goal/SdmGoalEvent";
import { executeAll, GitProject, HandlerContext, QueryNoCacheOptions, Success } from "../../../client";
import { readSdmVersion } from "../../../core/delivery/build/local/projectVersioner";
import { toArray } from "../../../core/util/misc/array";
import { postLinkImageWebhook } from "../../../core/util/webhook/ImageLink";
Expand Down
9 changes: 0 additions & 9 deletions lib/pack/docker/graphql/query/dockerRegistryProvider.graphql

This file was deleted.

8 changes: 0 additions & 8 deletions lib/pack/docker/graphql/query/password.graphql

This file was deleted.

5 changes: 3 additions & 2 deletions lib/pack/docker/parse/DockerFileParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@
* limitations under the License.
*/

import { File as ProjectFile } from "@atomist/automation-client/lib/project/File";
import { FileParser } from "@atomist/automation-client/lib/tree/ast/FileParser";
import { logger } from "@atomist/automation-client/lib/util/logger";
import { TreeNode } from "@atomist/tree-path";
import { DockerfileParser, From, Instruction, Label } from "dockerfile-ast";
import { TextDocument } from "vscode-languageserver-textdocument";
import { Position } from "vscode-languageserver-types/lib/umd/main";
import { FileParser, logger, ProjectFile } from "../../../client";

class DockerFileParserClass implements FileParser {
public readonly rootName: "docker";

public async toAst(f: ProjectFile): Promise<TreeNode> {
try {
const dockerfile = DockerfileParser.parse(await f.getContent());
// console.log(stringify(dockerfile));
const doc = (dockerfile as any).document;
const $children = dockerfile.getInstructions().map(i => instructionToTreeNode(i, doc));
return {
Expand Down
66 changes: 51 additions & 15 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@types/dateformat": "^3.0.0",
"@types/find-up": "^2.1.1",
"@types/flat": "0.0.28",
"@types/fs-extra": "^7.0.0",
"@types/fs-extra": "^9.0.1",
"@types/js-yaml": "^3.12.2",
"@types/json-stable-stringify": "^1.0.32",
"@types/json-stringify-safe": "^5.0.0",
Expand All @@ -59,7 +59,7 @@
"fast-glob": "3.1.1",
"find-up": "^4.0.0",
"flat": "^4.1.0",
"fs-extra": "^8.0.1",
"fs-extra": "^9.0.1",
"globby": "^10.0.1",
"js-yaml": "^3.13.1",
"json-stable-stringify": "^1.0.1",
Expand Down
Loading

0 comments on commit 0bb2317

Please sign in to comment.