Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
HeavyWombat opened this issue Jun 14, 2024 · 1 comment
Open
1 task done
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@HeavyWombat
Copy link
Contributor

HeavyWombat commented Jun 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Kubernetes Version

n/a

Shipwright Version

Starting with 977a065.

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

@Adarsh-jaiss
Copy link
Member

Adarsh-jaiss commented Jul 21, 2024

  • Hey @HeavyWombat , I ran the tests both using go test and Ginko CLI and they both gave me this same error :
 [FAILED] Unexpected error:
      <*fmt.wrapError | 0xc0007295c0>: 
      failed to run trivy: exec: "trivy": executable file not found in $PATH
      {
          msg: "failed to run trivy: exec: \"trivy\": executable file not found in $PATH",
          err: <*exec.Error | 0xc0007295a0>{
              Name: "trivy",
              Err: <*errors.errorString | 0x29c7e50>{
                  s: "executable file not found in $PATH",
              },
          },
      }
  occurred
  In [It] at: /home/adarsh/myfiles/OpenSource/Shipwright-io/build/cmd/image-processing/main_test.go:426 @ 07/21/24 23:27:14.619

  • Also note that i didn't got the above mentioned error (line 211 working correctly), I feel like there's an issue in the test case or code itself, not with the Ginkgo CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: No status
Development

No branches or pull requests

4 participants