From 53e6d26ab0fc9cedc9cfadd884bc7c5fd5e49fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ey=C3=BE=C3=B3r=20Magn=C3=BAsson?= Date: Tue, 12 Nov 2024 14:36:51 +0100 Subject: [PATCH] chore: save --- .../src/plugins/kubernetes/helm/deployment.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/core/test/integ/src/plugins/kubernetes/helm/deployment.ts b/core/test/integ/src/plugins/kubernetes/helm/deployment.ts index 52446cbb88..95e929694d 100644 --- a/core/test/integ/src/plugins/kubernetes/helm/deployment.ts +++ b/core/test/integ/src/plugins/kubernetes/helm/deployment.ts @@ -31,7 +31,6 @@ import type { NamespaceStatus } from "../../../../../../src/types/namespace.js" import { FakeCloudApi } from "../../../../../helpers/api.js" import { getActionNamespace } from "../../../../../../src/plugins/kubernetes/namespace.js" import stripAnsi from "strip-ansi" -import { randomString } from "../../../../../../src/util/string.js" import { ChildProcessError, DeploymentError } from "../../../../../../src/exceptions.js" describe("helmDeploy in local-mode", () => { @@ -105,7 +104,7 @@ describe("helmDeploy in local-mode", () => { }) }) -describe("helmDeploy", () => { +describe.only("helmDeploy", () => { let garden: TestGarden let provider: KubernetesProvider let ctx: KubernetesPluginContext @@ -464,7 +463,7 @@ describe("helmDeploy", () => { const action = graph.getDeploy("api") as HelmDeployAction action._config.spec.values["args"] = ["/bin/sh", "-c", "echo 'hello' && exit 1"] - action._config.spec.releaseName = `api-${randomString(4)}` + // action._config.spec.releaseName = `api-${randomString(4)}` const resolvedAction = await garden.resolveAction({ action, log: garden.log, @@ -486,6 +485,10 @@ describe("helmDeploy", () => { force: false, }), (err) => { + console.log("ERR IS***") + console.log("should include K8s events and Pod logs with errors") + console.log(err) + console.log("ERR IS***") const message = stripAnsi(err.message) expect(message).to.include(`Latest events from Deployment ${releaseName}`) expect(message).to.include(`BackOff`) @@ -499,7 +502,7 @@ describe("helmDeploy", () => { const action = graph.getDeploy("api") as HelmDeployAction action._config.spec.values["args"] = ["/bin/sh", "-c", "echo 'hello' && exit 1"] - action._config.spec.releaseName = `api-${randomString(4)}` + // action._config.spec.releaseName = `api-${randomString(4)}` const resolvedAction = await garden.resolveAction({ action, log: garden.log, @@ -520,6 +523,10 @@ describe("helmDeploy", () => { force: false, }), (err) => { + console.log("ERR IS***") + console.log("should fail fast if one of the resources is unhealthy") + console.log(err) + console.log("ERR IS***") expect(err).to.be.instanceOf(DeploymentError) } ) @@ -580,6 +587,7 @@ describe("helmDeploy", () => { force: false, }), (err) => { + console.log(err) const message = stripAnsi(err.message) expect(err).to.be.instanceOf(ChildProcessError) expect(message).to.include(`release ${releaseName} failed`) @@ -620,6 +628,7 @@ describe("helmDeploy", () => { force: false, }), (err) => { + console.log(err) const message = stripAnsi(err.message) expect(message).to.include(`Latest events from Deployment ${releaseName}`) expect(message).to.include(`BackOff`) @@ -659,6 +668,7 @@ describe("helmDeploy", () => { }), (err) => { const message = stripAnsi(err.message) + console.log(err) expect(err).to.be.instanceOf(ChildProcessError) expect(message).to.include(`Error: UPGRADE FAILED`) }