shipwright-io / build

Shipwright - a framework for building container images on Kubernetes
https://shipwright.io
Apache License 2.0
626 stars 107 forks source link

[BUG] Unit tests run fine with `go test`, but fail when used with Ginkgo CLI #1621

Open HeavyWombat opened 3 weeks ago

HeavyWombat commented 3 weeks ago

Is there an existing issue for this?

Kubernetes Version

n/a

Shipwright Version

Starting with https://github.com/shipwright-io/build/commit/977a065157d9ea58f0d81bfed49cfc6a6cf4f9ba.

Current Behavior

Unit tests in cmd/image-processing, which are written for Ginkgo/Gomega do not run when executed with Ginkgo CLI.

Expected Behavior

Unit tests written for Ginkgo should run fine with the Ginkgo CLI as the driver.

Steps To Reproduce

  1. Clone repo
  2. Run go run github.com/onsi/ginkgo/v2/ginkgo run --coverprofile=unit.coverprofile --output-dir=build/coverage --randomize-all --trace ./cmd/image-processing

Fails with

  [FAILED] Unexpected error:
      <*fs.PathError | 0x140007dc0c0>:
      open : no such file or directory
      {
          Op: "open",
          Path: "",
          Err: <syscall.Errno>0x2,
      }
  occurred
  In [It] at: /path/github.ibm.com/coligo/source-to-image/src/build/cmd/image-processing/main_test.go:211 @ 06/12/24 21:25:06.745

  Full Stack Trace

Anything else?

No response