Skip to content

Commit

Permalink
test: fix failing test
Browse files Browse the repository at this point in the history
More robust way of the default `Dockerfile` exclusion.
It doesn't have to be a first element in the array of files.
  • Loading branch information
vvagaytsev committed Dec 19, 2023
1 parent 3252047 commit 0587044
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/test/unit/src/plugins/container/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ import {
DEFAULT_TEST_TIMEOUT_SEC,
GardenApiVersion,
} from "../../../../../src/constants.js"
import { resolve } from "path"
import { join, resolve } from "path"
import type { ConvertModuleParams } from "../../../../../src/plugin/handlers/Module/convert.js"
import { omit } from "lodash-es"
import { omit, remove } from "lodash-es"
import type { GardenTask } from "../../../../../src/types/task.js"
import { taskFromConfig } from "../../../../../src/types/task.js"
import type { GardenService } from "../../../../../src/types/service.js"
Expand Down Expand Up @@ -151,7 +151,11 @@ describe("plugins.container", () => {

it("returns the dummy Build action if no Dockerfile and an exec Build is needed", async () => {
const module = graph.getModule("module-a") as ContainerModule
module.version.files.pop() // remove automatically picked up Dockerfile

// remove automatically picked up Dockerfile
const defaultDockerfilePath = join(module.path, defaultDockerfileName)
remove(module.version.files, (f) => f === defaultDockerfilePath)

const dummyBuild: ExecBuildConfig = {
internal: {
basePath: ".",
Expand Down

0 comments on commit 0587044

Please sign in to comment.