lifecycle icon indicating copy to clipboard operation
lifecycle copied to clipboard

Rebaser Acceptance Tests

Open ekcasey opened this issue 4 years ago • 12 comments

Add acceptance tests for rebaser.

ekcasey avatar Nov 16 '20 16:11 ekcasey

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).

natalieparellano avatar Mar 23 '21 16:03 natalieparellano

I'll work on this

haanhvu avatar Feb 07 '23 17:02 haanhvu

Thanks @haanhvu! Should I assign you the issue?

natalieparellano avatar Feb 07 '23 19:02 natalieparellano

Thanks @haanhvu! Should I assign you the issue?

Yes, please!

haanhvu avatar Feb 08 '23 05:02 haanhvu

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?

haanhvu avatar Feb 11 '23 11:02 haanhvu

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!

natalieparellano avatar Feb 13 '23 16:02 natalieparellano

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!

haanhvu avatar Feb 19 '23 06:02 haanhvu

@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 avatar Feb 21 '23 15:02 natalieparellano

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

natalieparellano avatar Aug 23 '23 13:08 natalieparellano

@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.

haanhvu avatar Aug 23 '23 13:08 haanhvu

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

satyazzz123 avatar Jan 20 '24 04:01 satyazzz123

@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

natalieparellano avatar Feb 01 '24 17:02 natalieparellano