diff --git a/garden-service/src/process.ts b/garden-service/src/process.ts index be654cc352..91bc65396c 100644 --- a/garden-service/src/process.ts +++ b/garden-service/src/process.ts @@ -117,9 +117,9 @@ export async function processModules( async (changedModule: Module | null, configChanged: boolean) => { if (configChanged) { if (changedModule) { - log.info({ emoji: "gear", section: changedModule.name, msg: `Module configuration changed, reloading...` }) + log.info({ section: changedModule.name, msg: `Module configuration changed, reloading...`, symbol: "info" }) } else { - log.info({ emoji: "gear", msg: `Project configuration changed, reloading...` }) + log.info({ symbol: "info", msg: `Project configuration changed, reloading...` }) } resolve() return diff --git a/garden-service/src/task-graph.ts b/garden-service/src/task-graph.ts index e9f1f6a781..0f23a3c8fa 100644 --- a/garden-service/src/task-graph.ts +++ b/garden-service/src/task-graph.ts @@ -23,6 +23,7 @@ class TaskGraphError extends Error { } export interface TaskResult { type: string description: string + key: string output?: any dependencyResults?: TaskResults error?: Error @@ -161,7 +162,8 @@ export class TaskGraph { const type = node.getType() const baseKey = node.getBaseKey() const description = node.getDescription() - let result + + let result: TaskResult = { type, description, key: task.getKey() } try { this.logTask(node) @@ -178,7 +180,7 @@ export class TaskGraph { result = await node.process(dependencyResults) this.garden.events.emit("taskComplete", result) } catch (error) { - result = { type, description, error } + result.error = error this.garden.events.emit("taskError", result) this.logTaskError(node, error) await this.cancelDependants(node) @@ -423,6 +425,7 @@ class TaskNode { return { type: this.getType(), + key: this.getKey(), description: this.getDescription(), output, dependencyResults, diff --git a/garden-service/test/src/server/server.ts b/garden-service/test/src/server/server.ts index 97793ee5cc..33407c508f 100644 --- a/garden-service/test/src/server/server.ts +++ b/garden-service/test/src/server/server.ts @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -import { makeTestGardenA } from "../../helpers" +import { makeTestGardenA, taskResultOutputs } from "../../helpers" import { startServer } from "../../../src/server/server" import { Server } from "http" import { Garden } from "../../../src/garden" @@ -64,15 +64,10 @@ describe("startServer", () => { }, }).expect(200) - expect(res.body.result).to.eql({ + expect(taskResultOutputs(res.body.result)).to.eql({ "build.module-a": { - dependencyResults: {}, - description: "building module-a", - output: { - buildLog: "A", - fresh: true, - }, - type: "build", + buildLog: "A", + fresh: true, }, }) }) @@ -167,18 +162,18 @@ describe("startServer", () => { it("should correctly map arguments and options to commands", (done) => { const id = uuid.v4() onMessage((req) => { - expect(req).to.eql({ + const taskResult = taskResultOutputs((<any>req).result) + const result = { + ...req, + result: taskResult, + } + expect(result).to.eql({ type: "commandResult", requestId: id, result: { "build.module-a": { - dependencyResults: {}, - description: "building module-a", - output: { - buildLog: "A", - fresh: true, - }, - type: "build", + buildLog: "A", + fresh: true, }, }, }) diff --git a/garden-service/test/src/task-graph.ts b/garden-service/test/src/task-graph.ts index f4d3d7dbad..e667f12fe5 100644 --- a/garden-service/test/src/task-graph.ts +++ b/garden-service/test/src/task-graph.ts @@ -107,6 +107,7 @@ describe("task-graph", () => { a: { type: "test", description: "a", + key: "a", output: { result: "result-a", dependencyResults: {}, @@ -233,6 +234,7 @@ describe("task-graph", () => { const resultA: TaskResult = { type: "test", description: "a.a1", + key: "a.a1", output: { result: "result-a.a1", dependencyResults: {}, @@ -241,6 +243,7 @@ describe("task-graph", () => { } const resultB: TaskResult = { type: "test", + key: "b.b1", description: "b.b1", output: { result: "result-b.b1", @@ -251,6 +254,7 @@ describe("task-graph", () => { const resultC: TaskResult = { type: "test", description: "c.c1", + key: "c.c1", output: { result: "result-c.c1", dependencyResults: { b: resultB }, @@ -265,6 +269,7 @@ describe("task-graph", () => { d: { type: "test", description: "d.d1", + key: "d.d1", output: { result: "result-d.d1", dependencyResults: { @@ -326,6 +331,7 @@ describe("task-graph", () => { const resultA: TaskResult = { type: "test", description: "a", + key: "a.a1", output: { result: "result-a", dependencyResults: {},