Skip to content

Commit

Permalink
test(e2e): add ability to skip building docker image
Browse files Browse the repository at this point in the history
This allows you to run e2e tests without rebuilding the image by setting
E2E_SKIP_BUILD environment variable.

Signed-off-by: Adam Reese <adam@reese.io>
  • Loading branch information
adamreese committed Jun 26, 2024
1 parent 1adcbbc commit c1a82ba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions e2e/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ func TestMain(m *testing.M) {

// build and load spin operator image into cluster
func(ctx context.Context, _ *envconf.Config) (context.Context, error) {
if p := utils.RunCommand(`bash -c "cd .. && IMG=ghcr.io/spinkube/spin-operator:dev make docker-build"`); p.Err() != nil {

return ctx, fmt.Errorf(ErrFormat, p.Err(), p.Out())
if os.Getenv("E2E_SKIP_BUILD") == "" { // nolint:forbidigo
if p := utils.RunCommand(`bash -c "cd .. && IMG=ghcr.io/spinkube/spin-operator:dev make docker-build"`); p.Err() != nil {
return ctx, fmt.Errorf(ErrFormat, p.Err(), p.Out())
}
}

if p := utils.RunCommand(("k3d image import -c " + cluster.name + " ghcr.io/spinkube/spin-operator:dev")); p.Err() != nil {
Expand Down

0 comments on commit c1a82ba

Please sign in to comment.