Skip to content

Commit

Permalink
Enforce ordered execution of tests
Browse files Browse the repository at this point in the history
Enforce ordered execution since the introduction of the latest test
context in `cmd/image-processing` led to failures when using Ginkgo CLI
to drive the tests. Since the PR status checks are driven by `go test`
this regression was not obvious.

```
$ go run github.com/onsi/ginkgo/v2/ginkgo run --coverprofile=unit.coverprofile --output-dir=build/coverage --randomize-all --trace ./cmd/image-processing

Running Suite: Image Processing Command Suite - /Users/mdiester/go/src/github.com/shipwright-io/build/cmd/image-processing
==========================================================================================================================
Random Seed: 1718369287 - will randomize all specs

Will run 23 of 23 specs
•••••••••••••••
------------------------------
• [FAILED] [0.431 seconds]
Image Processing Resource mutating the image [It] should mutate an image with single annotation
/Users/mdiester/go/src/github.com/shipwright-io/build/cmd/image-processing/main_test.go:256

  Timeline >>
  GET /v2/
  HEAD /v2/temp-image/manifests/nskxt 404 NAME_UNKNOWN Unknown name
  HEAD /v2/temp-image/blobs/sha256:5b943e2b943f6c81dbbd4e2eca5121f4fcc39139e3d1219d6d89bd925b77d9fe 404 BLOB_UNKNOWN Unknown blob
  POST /v2/temp-image/blobs/uploads/
  PATCH /v2/temp-image/blobs/uploads/8973636687925678644
  PUT /v2/temp-image/blobs/uploads/8973636687925678644?digest=sha256%3A5b943e2b943f6c81dbbd4e2eca5121f4fcc39139e3d1219d6d89bd925b77d9fe
  PUT /v2/temp-image/manifests/nskxt
  2024/06/14 14:48:41 Loading the image from the registry "127.0.0.1:50479/temp-image:nskxt"
  GET /v2/
  HEAD /v2/temp-image/manifests/nskxt
  GET /v2/
  GET /v2/temp-image/manifests/nskxt
  2024/06/14 14:48:41 Loaded single image
  2024/06/14 14:48:41 Mutating the image
  GET /v2/
  GET /v2/temp-image/manifests/nskxt
  GET /v2/temp-image/blobs/sha256:5b943e2b943f6c81dbbd4e2eca5121f4fcc39139e3d1219d6d89bd925b77d9fe
  [FAILED] in [It] - /Users/mdiester/go/src/github.com/shipwright-io/build/cmd/image-processing/main_test.go:262 @ 06/14/24 14:48:42.11
  << Timeline

  [FAILED] Unexpected error:
      <*fs.PathError | 0x1400042bbc0>:
      open : no such file or directory
      {
          Op: "open",
          Path: "",
          Err: <syscall.Errno>0x2,
      }
  occurred
  In [It] at: /Users/mdiester/go/src/github.com/shipwright-io/build/cmd/image-processing/main_test.go:262 @ 06/14/24 14:48:42.11
```
  • Loading branch information
HeavyWombat committed Jun 14, 2024
1 parent 4d595f6 commit 099d464
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/image-processing/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"k8s.io/apimachinery/pkg/util/rand"
)

var _ = Describe("Image Processing Resource", func() {
var _ = Describe("Image Processing Resource", Ordered, func() {
run := func(args ...string) error {
log.SetOutput(GinkgoWriter)

Expand Down

0 comments on commit 099d464

Please sign in to comment.