buildpacks / lifecycle

Reference implementation of the Cloud Native Buildpacks lifecycle
https://buildpacks.io
Apache License 2.0
187 stars 106 forks source link

Rebaser Acceptance Tests #469

Open ekcasey opened 3 years ago

ekcasey commented 3 years ago

Add acceptance tests for rebaser.

natalieparellano commented 3 years ago

The tests should run on Linux and Windows. They should cover most command invocations (see Detector & Analyzer as examples) and should include a test of the exit code in case of error (see Detector as an example).

haanhvu commented 1 year ago

I'll work on this

natalieparellano commented 1 year ago

Thanks @haanhvu! Should I assign you the issue?

haanhvu commented 1 year ago

Thanks @haanhvu! Should I assign you the issue?

Yes, please!

haanhvu commented 1 year ago

Hi @natalieparellano from what I can see, we already have acceptance tests for rebaser here: https://github.com/buildpacks/lifecycle/blob/main/rebaser_test.go

So this issue is about extending these test cases, right? If yes, then what are the most important test cases that we should focus on now?

natalieparellano commented 1 year ago

Ah, the tests in rebaser.go are units (they invoke rebaser.Rebase) - we want something that calls /cnb/lifecycle/rebaser <image to rebase>. You can take a look at the acceptance tests for the analyzer to see how we compile the binary and spin up a test registry with fixture images to interact with (note that the tests for the rebaser will be significantly simpler than what exists for the analyzer). Please don't hesitate to reach out if you have any questions!

haanhvu commented 1 year ago

Hi @natalieparellano I'm facing this issue with acceptance test files in VSCode:

No packages found for open file /home/admin1/go/src/github.com/buildpacks/lifecycle/acceptance/exporter_test.go: If this file contains build tags, try adding \"-tags=<build tag>\" to your gopls \"buildFlags\" configuration (see (https://github.com/golang/tools/blob/master/gopls/doc/settings.md#buildflags-string).\nOtherwise, see the troubleshooting guidelines for help investigating (https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md).

Does this mean I have to manually add all the flags to buildFlags in gopls in VSCode settings? Or is there a better/faster way to fix this issue?

Thanks!

natalieparellano commented 1 year ago

@haanhvu you can try adding -tags=acceptance to your configuration. This is needed due to

//go:build acceptance
// +build acceptance

at the top of the file.

natalieparellano commented 1 year ago

@haanhvu were you still interested in this? If not @dlion would like to take it over

haanhvu commented 1 year ago

@haanhvu were you still interested in this? If not @dlion would like to take it over

I haven't touched this for a while. Please go head.

satyazzz123 commented 9 months ago

@natalieparellano is this issue still open? If yes I would like to work on it. Thank you

natalieparellano commented 9 months ago

@satyazzz123 apologies for the slow reply. I don't believe anyone is working on this. I can assign the issue to you if you'd like