Open sambhav opened 3 years ago
I'm going to split the second part of this into a separate issue. See #259.
I'd like to see this for v2, and I have some ideas.
In Paketo tests, we frequently need to create some part of the context & layers by making temp directories. It would be nice to have some convenient API to build that for tests. It'll be more of a stub than a mock, but I think it could be beneficial & reduce test code.
We've also used Gomega in testing for libcnb. I think it might be helpful to add some Gomega matchers for common assertions. This could reduce code in tests as well.
That's off the top of my head. I'm going to look through Paketo buildpacks more and see what else jumps out as possibilities for reducing boiler plate code in tests.
@samj1912 Let me know if you had other ideas in mind here too. Thanks
@dmikusa is this in the 2.0 milestone because it cannot be done in 1.x or because it is a requirement to release 2.0?
cc @samj1912
Currently almost every buildpack that uses libcnb and has tests has to write code to create mock contexts etc. We should consider adding this to the existing set of mocks.
~We should also consider adding utilities for integration testing buildpacks (possibly in a separate library) that possibly uses pack and docker. Example of something like this https://github.com/paketo-buildpacks/occam~