From 8c59778c96ab3f5b366677f360d9e7577287059b Mon Sep 17 00:00:00 2001 From: J Wyman Date: Fri, 24 Jan 2025 14:32:55 -0500 Subject: [PATCH] deploy: fix bug in helm-test This change fixes a bug w/ helm-test which caused it to not return an accurate exit code. --- deploy/Kubernetes/_build/helm-test.ps1 | 2 ++ deploy/Kubernetes/worker/tests/trtllm/test-chart.ps1 | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/deploy/Kubernetes/_build/helm-test.ps1 b/deploy/Kubernetes/_build/helm-test.ps1 index 48e68dd4..38646118 100644 --- a/deploy/Kubernetes/_build/helm-test.ps1 +++ b/deploy/Kubernetes/_build/helm-test.ps1 @@ -100,9 +100,11 @@ function test_helm_chart([string] $chart_path, [string] $tests_path, [object[]] if ($fail_count -gt 0) { write-minimal "Failed: ${fail_count}, Passed: ${pass_count}, Total: $($tests.count)" 'Red' + return $false } else { write-minimal "Passed: ${pass_count}, Total: $($tests.count)" 'Green' + return $true } } diff --git a/deploy/Kubernetes/worker/tests/trtllm/test-chart.ps1 b/deploy/Kubernetes/worker/tests/trtllm/test-chart.ps1 index e47865a6..43cf8ecd 100644 --- a/deploy/Kubernetes/worker/tests/trtllm/test-chart.ps1 +++ b/deploy/Kubernetes/worker/tests/trtllm/test-chart.ps1 @@ -123,8 +123,11 @@ $tests = @( } ) +$is_pass = $false + try { - test_helm_chart 'deploy/Kubernetes/worker/charts/trtllm' 'deploy/Kubernetes/worker/tests/trtllm' $tests + $is_pass = test_helm_chart 'deploy/Kubernetes/worker/charts/trtllm' 'deploy/Kubernetes/worker/tests/trtllm' $tests + write-debug "is_pass: ${is_pass}." } catch { if ($is_debug) { @@ -136,3 +139,9 @@ catch { # Clean up any NVBUILD environment variables left behind by the build. cleanup_after + +if (-not $is_pass) { + exit(1) +} + +exit(0)