Skip to content

Commit 7ec1bae

Browse files
committed
fix(k8s): ensure test results get stored if test fails
1 parent ed0a9c9 commit 7ec1bae

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

garden-service/src/commands/get/get-test-result.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class GetTestResultCommand extends Command<Args> {
106106
log.info(highlightYaml(yamlStatus))
107107
return { result: output }
108108
} else {
109-
const errorMessage = `Could not find results for task '${testName}'`
109+
const errorMessage = `Could not find results for test '${testName}'`
110110

111111
log.info(errorMessage)
112112

garden-service/src/plugins/kubernetes/container/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export async function execInService(params: ExecInServiceParams<ContainerModule>
7373
context: api.context,
7474
namespace,
7575
args: kubecmd,
76-
reject: false,
76+
ignoreError: true,
7777
timeout: 999999,
7878
tty: interactive,
7979
})

garden-service/src/plugins/kubernetes/container/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export async function testContainerModule(
2727
module,
2828
command,
2929
interactive,
30+
ignoreError: true, // to ensure results get stored when an error occurs
3031
runtimeContext,
3132
timeout,
3233
log,

garden-service/src/plugins/kubernetes/helm/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export async function testHelmModule(
4343
args,
4444
image,
4545
interactive,
46-
ignoreError: true,
46+
ignoreError: true, // to ensure results get stored when an error occurs
4747
timeout,
4848
log,
4949
})

garden-service/src/plugins/kubernetes/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ export async function runPod(
6969
log,
7070
context,
7171
namespace,
72+
ignoreError,
7273
args: kubecmd,
73-
reject: !ignoreError,
7474
timeout,
7575
tty: interactive,
7676
})

garden-service/src/util/ext-tools.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export interface ExecParams {
218218
log: LogEntry
219219
timeout?: number
220220
input?: Buffer | string
221-
reject?: boolean
221+
ignoreError?: boolean
222222
}
223223

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

279-
async spawnAndWait({ args, cwd, env, log, timeout, tty }: SpawnParams) {
279+
async spawnAndWait({ args, cwd, env, log, ignoreError, timeout, tty }: SpawnParams) {
280280
const path = await this.getPath(log)
281281
return spawn(path, args || [], {
282282
cwd: cwd || dirname(path),
283283
timeout: this.getTimeout(timeout),
284+
ignoreError,
284285
env,
285286
tty,
286287
})

0 commit comments

Comments
 (0)