From 7d35d89b85c9e613acf9608709c5bc92c72ffa0f Mon Sep 17 00:00:00 2001 From: nouseforaname <34882943+nouseforaname@users.noreply.github.com> Date: Fri, 7 Jun 2024 08:41:03 +0200 Subject: [PATCH] implement changes requested on review - replace `"` with `\`` quoted strings - use closer helper function and move defer up --- internal/commands/test_tile.go | 2 +- internal/test/container.go | 3 +-- internal/test/container_test.go | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/commands/test_tile.go b/internal/commands/test_tile.go index e05948e4..edf03a57 100644 --- a/internal/commands/test_tile.go +++ b/internal/commands/test_tile.go @@ -23,7 +23,7 @@ type TileTest struct { Manifest bool ` long:"manifest" default:"false" description:"Focus the Manifest tests."` Migrations bool ` long:"migrations" default:"false" description:"Focus the Migration tests."` Stability bool ` long:"stability" default:"false" description:"Focus the Stability tests."` - ImagePath string " long:\"image-path\" " + ImagePath string ` long:"image-path" ` EnvironmentVars []string `short:"e" long:"environment-variable" description:"Pass environment variable to the test suites. For example --stability -e 'PRODUCT=srt'."` GingkoFlags string ` long:"ginkgo-flags" default:"-r -p -slowSpecThreshold 15" description:"Flags to pass to the Ginkgo Manifest and Stability test suites."` } diff --git a/internal/test/container.go b/internal/test/container.go index 8f8bfa9b..67a4b5b2 100644 --- a/internal/test/container.go +++ b/internal/test/container.go @@ -174,9 +174,8 @@ func runTestWithSession(ctx context.Context, logger *log.Logger, w io.Writer, do if err != nil { return fmt.Errorf("failed to import image: %w", err) } - + defer closeAndIgnoreError(loadResponse.Body) respBytes, err := io.ReadAll(loadResponse.Body) - defer loadResponse.Body.Close() if err != nil { return fmt.Errorf(`failed to parse load image response: %w`, err) } diff --git a/internal/test/container_test.go b/internal/test/container_test.go index a4db0646..35dc1c4a 100644 --- a/internal/test/container_test.go +++ b/internal/test/container_test.go @@ -132,7 +132,7 @@ func Test_loadImage(t *testing.T) { configuration := Configuration{ AbsoluteTileDirectory: absoluteTileDirectory, - ImagePath: `assets/alpine.tgz`, + ImagePath: "assets/alpine.tgz", } client := runTestWithSessionHelper(t, "", container.WaitResponse{