Skip to content

[go-migration] Refactor common context, generate mocks, fix hollow unit tests for supply/finalize#1177

Open
kiril-keranov wants to merge 6 commits intocloudfoundry:feature/go-migrationfrom
kiril-keranov:patch-17
Open

[go-migration] Refactor common context, generate mocks, fix hollow unit tests for supply/finalize#1177
kiril-keranov wants to merge 6 commits intocloudfoundry:feature/go-migrationfrom
kiril-keranov:patch-17

Conversation

@kiril-keranov
Copy link
Contributor

@kiril-keranov kiril-keranov commented Feb 25, 2026

The PR introduces the following changes:

  • Refactor common context struct to use newly introduced interfaces to libbuildpack functionalities in order to be able to generate mocks. The mocks are further used in supply unit tests.
  • Fix the supply phase unit tests that always passed and tested nothing. The generated mocks provide the ability to run supply phase without doing real download of dependencies.
    • Fixed supply test case for Tomcat container to test supply.Run(..)
    • Fixed supply test case for Spring Boot container to test supply.Run(..)
    • Fixed supply test case for Groovy container to test supply.Run(..)
  • Fix the finalize phase unit tests that always passed and tested nothing.
    • Fixed finalize test case for Tomcat container to test finalize.Run(..)
    • Fixed finalize test case for Spring Boot container to test finalize.Run(..)
    • Added finalize test case for Groovy container testing finalize.Run(..)

Addressing this issue

Additional change is also adjusting the cf-metrics-exporter tests

@kiril-keranov kiril-keranov changed the title Refactor common context, generate mocks, fix hollow unit tests for supply [go-migration] Refactor common context, generate mocks, fix hollow unit tests for supply Feb 26, 2026
@kiril-keranov kiril-keranov changed the title [go-migration] Refactor common context, generate mocks, fix hollow unit tests for supply [go-migration] Refactor common context, generate mocks, fix hollow unit tests for supply/finalize Feb 26, 2026
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.

1 participant