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

add an option to upload_logs to avoid dying on failure #490

Merged
merged 1 commit into from May 3, 2016

Conversation

AdamWill
Copy link
Contributor

in Fedora we use upload_logs a lot in post-fail hooks, and in
some cases the file may not exist. For instance, anaconda
creates lots of log files, some of which may not exist in some
circumstances. We would like to just be able to try and upload
them all but not have the post-fail hook die if any of them
does not exist, instead of having to test for each file's
existence before uploading it, or have a bunch of conditionals
that magically know which log files will exist in which state.

@AdamWill
Copy link
Contributor Author

I'm testing this right now. What's that you say? Test first then submit a PR? Nahhh, that doesn't sound like fun...

@AdamWill
Copy link
Contributor Author

welp, looks like it works: compare https://openqa.fedoraproject.org/tests/14834 (sad! missing log files! post fail hook died half way through when /tmp/dnf.log didn't exist!) to https://openqa.stg.fedoraproject.org/tests/15371 (happiness! all the logs are there! we don't care about stupid dnf!)

the weird behaviour on the very last log file is just because I made a stupid typo when editing that file's upload_logs command and put the , 1 in the filename, heh.

@coolo
Copy link
Contributor

coolo commented May 1, 2016

yeah, but I don't like the ,1 - wherever we have this in a API the test writers tend to just copy&paste this magic number without knowing what it does (see type_string and send_key ). Better have a named parameter as we added for type_string and as discussed in os-autoinst/os-autoinst-distri-opensuse#1069

@AdamWill
Copy link
Contributor Author

AdamWill commented May 1, 2016

hehe, I can believe it =) OK, will update that soon. thanks.

@AdamWill
Copy link
Contributor Author

AdamWill commented May 2, 2016

How does that look?

in Fedora we use upload_logs a lot in post-fail hooks, and in
some cases the file may not exist. For instance, anaconda
creates lots of log files, some of which may not exist in some
circumstances. We would like to just be able to try and upload
them all but not have the post-fail hook die if any of them
does not exist, instead of having to test for each file's
existence before uploading it, or have a bunch of conditionals
that magically know which log files will exist in which state.
@AdamWill
Copy link
Contributor Author

AdamWill commented May 2, 2016

oh perltidy, why must you.

@coolo
Copy link
Contributor

coolo commented May 3, 2016

do your friends know what kind of perl hacker you became? :)

@AdamWill
Copy link
Contributor Author

AdamWill commented May 3, 2016

@coolo you must NEVER TELL

actually i just ripped that off from type_string, sooo....

@coolo coolo merged commit da826b1 into os-autoinst:master May 3, 2016
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