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

When creating job, create folder if not existed. #48

Merged
merged 5 commits into from
Apr 8, 2022
Merged

When creating job, create folder if not existed. #48

merged 5 commits into from
Apr 8, 2022

Conversation

fz0000
Copy link
Contributor

@fz0000 fz0000 commented Apr 5, 2022

I'd like to use:

j.create_job('path/to/job', xml_freestylejob)

instead of:

j.create_job('path', xml_emptyfolder)
j.create_job('path/to', xml_emptyfolder)
j.create_job('path/to/job', xml_freestylejob)

Signed-off-by: fangzheng <fz0000@sina.com>
…xist.

Signed-off-by: fangzheng <fz0000@sina.com>
Signed-off-by: fangzheng <fz0000@sina.com>
Signed-off-by: fangzheng <fz0000@sina.com>
@@ -120,6 +120,8 @@ def create_job(self, full_name, xml):
<FreeStyleProject: http://127.0.0.1:8080/job/freestylejob/>
'''
folder, name = self._resolve_name(full_name)
if not folder.exists():
Copy link
Owner

Choose a reason for hiding this comment

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

how about add parameter recursive with default value False to let user make choice ?
and please add test case as well, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added. thanks.
I only added in test_create_job_succ. Maybe some test cases are also needed in test_create_job_fail. 🤔

Copy link
Owner

Choose a reason for hiding this comment

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

it's pretty good.

add tests.

Signed-off-by: fangzheng <fz0000@sina.com>
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.

None yet

2 participants