Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Report Dir Bug Fix #364

Merged
merged 4 commits into from
Apr 21, 2022
Merged

Test Report Dir Bug Fix #364

merged 4 commits into from
Apr 21, 2022

Conversation

kensipe
Copy link
Member

@kensipe kensipe commented Apr 21, 2022

A newly added feature was to create the directory for test reports if it didn't exist. The default if not specified location of the test report was "", which equated to the current directory. The check on "" existence was false which lead to the mkdir "" which is obvious going to fail. The solution is to verify that the artifactsDir isn't "" prior to that logic.

Thanks to the community Erik and @iblancasa for helping discover and track down so quickly. We will be getting a patch release out today.

Signed-off-by: Ken Sipe kensipe@gmail.com

Signed-off-by: Ken Sipe <kensipe@gmail.com>
@@ -241,6 +236,19 @@ func (ts *Testsuites) Report(dir, name string, ftype Type) error {
}
}

func ensureDir(dir string) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be easier if this func just had an early exit if dir == ""? To avoid the nesting in the calling func.

Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
@@ -241,6 +234,20 @@ func (ts *Testsuites) Report(dir, name string, ftype Type) error {
}
}

func ensureDir(dir string) error {
if dir != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if dir != "" {
if dir == "" {

Signed-off-by: Ken Sipe <kensipe@gmail.com>
Copy link
Contributor

@erikgb erikgb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kensipe kensipe merged commit 1572380 into main Apr 21, 2022
@kensipe kensipe deleted the ken/report-dir-bug branch April 21, 2022 15:31
iblancasa pushed a commit to iblancasa/kuttl that referenced this pull request Jul 20, 2022
A newly added feature was to create the directory for test reports if it didn't exist. The default if not specified location of the test report was "", which equated to the current directory. The check on "" existence was false which lead to the mkdir "" which is obvious going to fail. The solution is to verify that the artifactsDir isn't "" prior to that logic.

Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
iblancasa pushed a commit to iblancasa/kuttl that referenced this pull request Nov 17, 2022
A newly added feature was to create the directory for test reports if it didn't exist. The default if not specified location of the test report was "", which equated to the current directory. The check on "" existence was false which lead to the mkdir "" which is obvious going to fail. The solution is to verify that the artifactsDir isn't "" prior to that logic.

Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants