Skip to content

Commit

Permalink
OSDK-2303: Scorecard testOutput is tightly coupled with storage mount…
Browse files Browse the repository at this point in the history
…Path

Signed-off-by: Andrej Podhradsky <[email protected]>
  • Loading branch information
apodhrad committed Jun 2, 2022
1 parent 8c9f24c commit b308eca
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions internal/cmd/operator-sdk/scorecard/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ If the argument holds an image tag, it must be present remotely.`,
scorecardCmd.Flags().StringVarP(&c.untarImage, "untar-image", "u",
"registry.access.redhat.com/ubi8@sha256:910f6bc0b5ae9b555eb91b88d28d568099b060088616eba2867b07ab6ea457c7",
"Untar image to be used by the Scorecard pod")
scorecardCmd.Flags().StringVarP(&c.testOutput, "test-output", "t", "test-output",
"Test output directory.")
scorecardCmd.Flags().StringVarP(&c.testOutput, "test-output", "t", "", "Test output directory.")

return scorecardCmd
}
Expand Down
2 changes: 1 addition & 1 deletion internal/scorecard/scorecard.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (r PodTestRunner) RunTest(ctx context.Context, test v1alpha3.TestConfigurat
}

// gather test output if necessary
if test.Storage.Spec.MountPath.Path != "" {
if r.TestOutput != "" && test.Storage.Spec.MountPath.Path != "" {
err := gatherTestOutput(r, test.Labels["suite"], test.Labels["test"], pod.Name, test.Storage.Spec.MountPath.Path)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion internal/scorecard/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func gatherTestOutput(r PodTestRunner, suiteName, testName, podName, mountPath s
return err
}

srcPath := r.TestOutput
srcPath := mountPath
prefix := getStoragePrefix(srcPath)
prefix = path.Clean(prefix)
destPath := getDestPath(r.TestOutput, suiteName, testName)
Expand Down
2 changes: 1 addition & 1 deletion website/content/en/docs/cli/operator-sdk_scorecard.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ operator-sdk scorecard [flags]
-s, --service-account string Service account to use for tests (default "default")
-x, --skip-cleanup Disable resource cleanup after tests are run
-b, --storage-image string Storage image to be used by the Scorecard pod (default "docker.io/library/busybox@sha256:c71cb4f7e8ececaffb34037c2637dc86820e4185100e18b4d02d613a9bd772af")
-t, --test-output string Test output directory. (default "test-output")
-t, --test-output string Test output directory.
-u, --untar-image string Untar image to be used by the Scorecard pod (default "registry.access.redhat.com/ubi8@sha256:910f6bc0b5ae9b555eb91b88d28d568099b060088616eba2867b07ab6ea457c7")
-w, --wait-time duration seconds to wait for tests to complete. Example: 35s (default 30s)
```
Expand Down

0 comments on commit b308eca

Please sign in to comment.