Skip to content

Migrate from ginkgo v1 to ginkgo v2#907

Merged
tnikolova82 merged 1 commit intomasterfrom
migrate-ginkgo-v2
Apr 15, 2026
Merged

Migrate from ginkgo v1 to ginkgo v2#907
tnikolova82 merged 1 commit intomasterfrom
migrate-ginkgo-v2

Conversation

@tnikolova82
Copy link
Copy Markdown
Contributor

Summary

  • Migrate all unit test imports from github.com/onsi/ginkgo (v1) to github.com/onsi/ginkgo/v2
  • Fix update-libbuildpack CI job failure caused by ginkgo CLI v2 / library v1 version mismatch

Problem

The update-libbuildpack CI task (buildpacks-ci@0f1b456f) was updated to install the ginkgo v2 CLI (go install github.com/onsi/ginkgo/v2/ginkgo@latest). However, the nodejs-buildpack still imported ginkgo v1 in all test files. When the v2 CLI (v2.28.1) runs test binaries compiled against v1 (v1.16.5), it passes flags that don't exist in v1, causing:

flag provided but not defined: -ginkgo.timeout

This broke update-libbuildpack builds #7 and #8.

Changes

  • 15 test files: Updated import from "github.com/onsi/ginkgo" to "github.com/onsi/ginkgo/v2"
  • supply/supply_test.go: Removed "github.com/onsi/ginkgo/extensions/table" import — DescribeTable and Entry are built into the v2 main package
  • go.mod: Made ginkgo/v2 v2.22.1 a direct dependency, removed ginkgo v1.16.5
  • Vendor: Removed ginkgo v1 and its transitive-only dependencies (fsnotify, nxadm/tail, tomb.v1)

Testing

All 5 unit test suites pass locally with ginkgo v2 CLI:

Finalize Suite — 6/6 specs    SUCCESS!
Hooks Suite    — 68/68 specs  SUCCESS!
Npm Suite      — 7/7 specs    SUCCESS!
Supply Suite   — 127/127 specs SUCCESS!
Yarn Suite     — 6/6 specs    SUCCESS!

Ginkgo ran 5 suites — Test Suite Passed

The nodejs-buildpack was the last buildpack still on ginkgo v1 — all other buildpacks have already migrated.

The update-libbuildpack CI task now installs the ginkgo v2 CLI, which
is incompatible with test binaries compiled against ginkgo v1. This
caused unit test failures with 'flag provided but not defined:
-ginkgo.timeout'.

- Update all 15 test files to import github.com/onsi/ginkgo/v2
- Remove github.com/onsi/ginkgo/extensions/table import (DescribeTable
  and Entry are built into the v2 main package)
- Make ginkgo/v2 a direct dependency in go.mod, drop ginkgo v1
- Run go mod tidy and go mod vendor
Copy link
Copy Markdown
Contributor

@ivanovac ivanovac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tnikolova82 tnikolova82 merged commit 59ca58e into master Apr 15, 2026
7 checks passed
@tnikolova82 tnikolova82 deleted the migrate-ginkgo-v2 branch April 15, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants