-
Notifications
You must be signed in to change notification settings - Fork 292
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
feat(pack): add support for scaffolding new extensions #2026
Conversation
add support for scaffolding new extensions
format the code
@natalieparellano could you plz review the pr ? |
@natalieparellano I'm working on test for newExtension. Do we have anything similar to newBuildpack() method https://pkg.go.dev/github.com/buildpacks/pack/internal/commands/testmocks#MockPackClientMockRecorder.NewBuildpack for extension ? |
add test for scafall feature
remove stack and add suggested changes
remove stack and implement suggested changes
This reverts commit ecfea6f.
Signed-off-by: sarthak <[email protected]> add binGenrate
Implement NewExtension method in MockPackClient
I run make build, make format, make tidy and make verify they are running good at my end !! I don't know y these tests are failing !! |
For what I can see, it looks like your mock setup is missing some information Got: {0.8 /tmp/build-test1320509439/targets example/targets 1.0.0 [] [{linux arm v6 [{ubuntu [14.04 16.04]}]}]} (client.NewBuildpackOptions)
Want: is equal to {0.8 /tmp/build-test1320509439/targets example/targets 1.0.0} (client.NewExtensionOptions) Your expected object is missing Maybe here: mockClient.EXPECT().NewBuildpack(gomock.Any(), client.NewExtensionOptions{
API: "0.8",
ID: "example/targets",
Path: filepath.Join(tmpDir, "targets"),
Version: "1.0.0",
}).Return(nil).MaxTimes(1) You need to add more details on the targets options |
@jjbustamante targets are not present in ExtensionDescriptor struct and ExtensionNewFlags, do I have to add it ? https://github.com/buildpacks/pack/blob/main/pkg/dist/extension_descriptor.go |
enable target support for extension
|
I think the problem is that your tests are still not passing. I cloned your branch and try to fix them. This is what I changed: I think you copied and pasted some tests from a previous command, which is ok, but you didn't changed the actual method you wanna mock I did those changes and the tests started passing locally |
This is extremely helpful. I completely missed that it needed updating. Thank you for catching that! |
remove stack
enable NewExtension method in MockPackClient
add test for NewExtension method
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2026 +/- ##
==========================================
- Coverage 79.63% 78.42% -1.21%
==========================================
Files 176 177 +1
Lines 13214 13352 +138
==========================================
- Hits 10522 10470 -52
- Misses 2022 2213 +191
+ Partials 670 669 -1
Flags with carried forward coverage won't be shown. Click here to find out more. |
resolve merge conflicts
I commits the changes with wrong author, due to which DCO is not passing because of this I am closing this pull request and opening a new |
add support for scaffolding new extensions
Summary
add support for scaffolding new extensions
Output
Before
After
Documentation
Related
Resolves #1636