Skip to content

Commit

Permalink
chore: save
Browse files Browse the repository at this point in the history
  • Loading branch information
Eyþór Magnússon committed Nov 12, 2024
1 parent 95d5bad commit 53e6d26
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions core/test/integ/src/plugins/kubernetes/helm/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down Expand Up @@ -105,7 +104,7 @@ describe("helmDeploy in local-mode", () => {
})
})

describe("helmDeploy", () => {
describe.only("helmDeploy", () => {
let garden: TestGarden
let provider: KubernetesProvider
let ctx: KubernetesPluginContext
Expand Down Expand Up @@ -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<HelmDeployAction>({
action,
log: garden.log,
Expand All @@ -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`)
Expand All @@ -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<HelmDeployAction>({
action,
log: garden.log,
Expand All @@ -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)
}
)
Expand Down Expand Up @@ -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`)
Expand Down Expand Up @@ -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`)
Expand Down Expand Up @@ -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`)
}
Expand Down

0 comments on commit 53e6d26

Please sign in to comment.