Conversation
Upgrade github.com/onsi/ginkgo v1.16.5 -> v2 and update all import paths from github.com/onsi/ginkgo to github.com/onsi/ginkgo/v2.
Replace all AfterEach cleanup blocks with DeferCleanup calls co-located in BeforeEach/JustBeforeEach, following Ginkgo v2 idioms. Bare AfterEach at Describe-level are replaced with direct DeferCleanup calls in the Describe body.
- Update ginkgo install path to github.com/onsi/ginkgo/v2/ginkgo - Wrap bare DeferCleanup in BeforeEach in CopyFilesToPublic Describe block; DeferCleanup must be called inside a setup node, not a container node.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates the staticfile-buildpack test suite from Ginkgo v1 to v2.
Commits
Commit 1 – migrate to ginkgo v2
Upgrade
github.com/onsi/ginkgov1.16.5 → v2 and update all import paths fromgithub.com/onsi/ginkgotogithub.com/onsi/ginkgo/v2. Runsgo mod tidyandgo mod vendorto bring in updated dependencies.Commit 2 – refactor: migrate Ginkgo v1 AfterEach cleanup to v2 DeferCleanup
Replace all
AfterEachcleanup blocks withDeferCleanupcalls co-located inBeforeEach/JustBeforeEach, following Ginkgo v2 idioms.mockCtrl.Finish()calls are removed (auto-handled byGinkgoT()in v2).Files changed:
src/staticfile/finalize/finalize_test.gosrc/staticfile/supply/supply_test.goCommit 3 – fix: install ginkgo v2 CLI and fix bare DeferCleanup in finalize_test
scripts/.util/tools.shwas installing the Ginkgo v1 CLI (github.com/onsi/ginkgo/ginkgo). Updated to install the v2 CLI (github.com/onsi/ginkgo/v2/ginkgo).Also fixed a bare
DeferCleanupcall infinalize_test.gothat was placed directly in aDescribecontainer body (not inside a setup or subject node). Ginkgo v2 panics at runtime whenDeferCleanupis called outside a setup node. Fixed by wrapping it inBeforeEach.Files changed:
scripts/.util/tools.shsrc/staticfile/finalize/finalize_test.goVerification
./scripts/unit.sh✅AfterEachremaining in source ✅