Skip to content

Commit

Permalink
test: fix test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
vvagaytsev committed May 11, 2023
1 parent 77d7ac8 commit 2dc878b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions core/test/data/test-project-b/module-a/garden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: module-a
type: test
services:
- name: service-a
timeout: 600
ingresses:
- path: /path-a
port: http
Expand Down
1 change: 1 addition & 0 deletions core/test/data/test-project-b/module-b/garden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: module-b
type: test
services:
- name: service-b
timeout: 600
ingresses:
- path: /path-b
port: http
Expand Down
2 changes: 2 additions & 0 deletions core/test/data/test-project-b/module-c/garden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ type: test
allowPublish: false
services:
- name: service-c
timeout: 600
ingresses:
- path: /path-c
port: http
ports:
- name: http
containerPort: 8080
- name: service-d
timeout: 600
ingresses:
- path: /path-d
port: http
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ import { TestGarden } from "../../../../../helpers"
import { ModuleConfig } from "../../../../../../src/config/module"
import { apply } from "json-merge-patch"
import { getKubernetesTestGarden } from "./common"
import { DEFAULT_BUILD_TIMEOUT_SEC } from "../../../../../../src/constants"
import {
DEFAULT_BUILD_TIMEOUT_SEC,
DEFAULT_RUN_TIMEOUT_SEC,
DEFAULT_TEST_TIMEOUT_SEC,
} from "../../../../../../src/constants"

describe("configureKubernetesModule", () => {
let garden: TestGarden
Expand Down Expand Up @@ -42,7 +46,7 @@ describe("configureKubernetesModule", () => {
cacheResult: true,
dependencies: [],
disabled: false,
timeout: null,
timeout: DEFAULT_RUN_TIMEOUT_SEC,
env: {},
artifacts: [],
}
Expand All @@ -52,7 +56,7 @@ describe("configureKubernetesModule", () => {
command: ["sh", "-c", "echo ok"],
dependencies: [],
disabled: false,
timeout: null,
timeout: DEFAULT_TEST_TIMEOUT_SEC,
env: {},
artifacts: [],
}
Expand Down Expand Up @@ -134,7 +138,7 @@ describe("configureKubernetesModule", () => {
dependencies: [],
disabled: false,
spec: taskSpec,
timeout: null,
timeout: DEFAULT_RUN_TIMEOUT_SEC,
},
])

Expand All @@ -144,7 +148,7 @@ describe("configureKubernetesModule", () => {
dependencies: [],
disabled: false,
spec: testSpec,
timeout: null,
timeout: DEFAULT_TEST_TIMEOUT_SEC,
},
])
})
Expand Down
2 changes: 1 addition & 1 deletion core/test/integ/src/plugins/kubernetes/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ describe("kubernetes Pod runner functions", () => {
artifactsPath: tmpDir.path,
image,
version: action.versionString(),
timeout: DEFAULT_RUN_TIMEOUT_SEC,
timeout,
})

expect(result.log.trim()).to.equal(`Command timed out after ${timeout} seconds.`)
Expand Down
6 changes: 3 additions & 3 deletions core/test/unit/src/garden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4568,9 +4568,9 @@ describe("Garden", () => {
})

context("test against fixed version hashes", async () => {
const moduleAVersionString = "v-6abf03be92"
const moduleBVersionString = "v-13d9d46957"
const moduleCVersionString = "v-554616d870"
const moduleAVersionString = "v-15dac6739d"
const moduleBVersionString = "v-33728410e6"
const moduleCVersionString = "v-bd65300051"

it("should return the same module versions between runtimes", async () => {
const projectRoot = getDataDir("test-projects", "fixed-version-hashes-1")
Expand Down
2 changes: 1 addition & 1 deletion core/test/unit/src/vcs/vcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ describe("getModuleVersionString", () => {
const garden = await makeTestGarden(projectRoot, { noCache: true })
const module = await garden.resolveModule("module-a")

const fixedVersionString = "v-6abf03be92"
const fixedVersionString = "v-15dac6739d"
expect(module.version.versionString).to.eql(fixedVersionString)

delete process.env.TEST_ENV_VAR
Expand Down

0 comments on commit 2dc878b

Please sign in to comment.