Skip to content

Commit

Permalink
fix(k8s): ensure test results get stored if test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
eysi09 committed Apr 30, 2019
1 parent ed0a9c9 commit 7ec1bae
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion garden-service/src/commands/get/get-test-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class GetTestResultCommand extends Command<Args> {
log.info(highlightYaml(yamlStatus))
return { result: output }
} else {
const errorMessage = `Could not find results for task '${testName}'`
const errorMessage = `Could not find results for test '${testName}'`

log.info(errorMessage)

Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/plugins/kubernetes/container/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function execInService(params: ExecInServiceParams<ContainerModule>
context: api.context,
namespace,
args: kubecmd,
reject: false,
ignoreError: true,
timeout: 999999,
tty: interactive,
})
Expand Down
1 change: 1 addition & 0 deletions garden-service/src/plugins/kubernetes/container/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export async function testContainerModule(
module,
command,
interactive,
ignoreError: true, // to ensure results get stored when an error occurs
runtimeContext,
timeout,
log,
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/plugins/kubernetes/helm/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function testHelmModule(
args,
image,
interactive,
ignoreError: true,
ignoreError: true, // to ensure results get stored when an error occurs
timeout,
log,
})
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/plugins/kubernetes/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export async function runPod(
log,
context,
namespace,
ignoreError,
args: kubecmd,
reject: !ignoreError,
timeout,
tty: interactive,
})
Expand Down
5 changes: 3 additions & 2 deletions garden-service/src/util/ext-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export interface ExecParams {
log: LogEntry
timeout?: number
input?: Buffer | string
reject?: boolean
ignoreError?: boolean
}

export interface SpawnParams extends ExecParams {
Expand Down Expand Up @@ -276,11 +276,12 @@ export class BinaryCmd extends Library {
return crossSpawn(path, args || [], { cwd: cwd || dirname(path), env })
}

async spawnAndWait({ args, cwd, env, log, timeout, tty }: SpawnParams) {
async spawnAndWait({ args, cwd, env, log, ignoreError, timeout, tty }: SpawnParams) {
const path = await this.getPath(log)
return spawn(path, args || [], {
cwd: cwd || dirname(path),
timeout: this.getTimeout(timeout),
ignoreError,
env,
tty,
})
Expand Down

0 comments on commit 7ec1bae

Please sign in to comment.