-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add mkdir command when using --junit #282
Conversation
Add mkdir command to create the report folder later used by ansible-playbook to store junit reports.
@@ -281,6 +281,16 @@ def ansible_command_sequence(configure_data_ansible, base_project, sequence, ver | |||
# 4. Start composing and accumulating the list of all needed commands | |||
ansible_cmd = [] | |||
ansible_cmd_seq = [] | |||
|
|||
if junit and not os.path.isdir(junit): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would write like this to be more readable:
`junit_specified = bool(junit)
junit_is_not_dir = not path.isdir(junit)
if junit_specified and junit_is_not_dir:`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the more concise syntax here, but it is a matter of teste I think. So I'll wait other reviewers before to decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it looks good but as you said it's a preference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One humble opinion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
scripts/qesap/lib/cmds.py
Outdated
# the folder is not created. | ||
# Create an empty folder in advance, if it is not already there | ||
# so that the glue script called can always suppose that at least the folder is present. | ||
ansible_cmd_seq.append({'cmd': ['mkdir', junit]}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add -p
to the mkdir
command:
-p, --parents no error if existing, make parent directories as needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, and tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just commented on a typo in a comment.
if junit and not os.path.isdir(junit): | ||
# This is the folder also used in the Ansible configuration JUNIT_OUTPUT_DIR. | ||
# ansible-playbook is able to create it from its own but | ||
# is a failure occur in the first sequence command, that is ansible and not ansible-playbook, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/is a failure occur/if a failure occurs/
Add mkdir command to create the report folder later used by ansible-playbook to store junit reports.
Ticket: https://jira.suse.com/browse/TEAM-9713
Verification
mkdir
is visible at the beginning of http://openqaworker15.qa.suse.cz/tests/299484/logfile?filename=deploy-qesap_exec_ansible.log.txt