try:
# Let's dump the output into file as it can be very large
# and we don't want to store it in memory
process = Popen(full_command, stdout=temp_file, universal_newlines=True)
except OSError as exc:
if exc.errno == errno.ENOENT: logging.error('Error: please make sure that rendercheck ' 'is installed.') exit(1)
else: raise
Problem is, if I read that correctly, assuming Jeffrey's case is correct and rendercheck is not present, it "should" throw ENOENT (doesn't exist) and log a message and exit with a 1.
So logging.error, IIRC logs to wherever the logger is suppose to log, file or stdout, logging.error isn't internally redirected to stderr.
Second, it should exit with a 1, which should trigger the fail message, not a pass based on this command in the job description:
command: rendercheck_test -d -o $CHECKBOX_DATA/rendercheck-results && echo "Rendercheck tests completed successfully" || echo "Rendercheck completed, but there are errors. Please see the log $CHECKBOX_DATA/rendercheck-results for details"
which gives me this when I move the rendercheck tool:
bladernr@klaatu:~/development/checkbox$ which rendercheck
/usr/bin/rendercheck
bladernr@klaatu:~/development/checkbox$ sudo mv /usr/bin/rendercheck /usr/bin/not-the-rendercheck-youre-looking-for
[sudo] password for bladernr:
bladernr@klaatu:~/development/checkbox$ which rendercheck
bladernr@klaatu:~/development/checkbox$ ./scripts/rendercheck_test -d -o /tmp/rendercheck.log
Traceback (most recent call last):
File "./scripts/rendercheck_test", line 134, in get_suites_list
stderr=PIPE, universal_newlines=True)
File "/usr/lib/python3.2/subprocess.py", line 745, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.2/subprocess.py", line 1361, in _execute_child
raise child_exception_type(errno_num, err_msg)
OSError: [Errno 2] No such file or directory: 'rendercheck'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./scripts/rendercheck_test", line 255, in <module>
main()
File "./scripts/rendercheck_test", line 165, in main
all_tests = RenderCheck().get_suites_list()
File "./scripts/rendercheck_test", line 136, in get_suites_list
if exc.errno == errno.ENOENT:
NameError: global name 'errno' is not defined
So really, the root problem lies here:
try:
universal_ newlines= True)
logging. error(' Error: please make sure that rendercheck '
'is installed.')
exit( 1)
raise
# Let's dump the output into file as it can be very large
# and we don't want to store it in memory
process = Popen(full_command, stdout=temp_file,
except OSError as exc:
if exc.errno == errno.ENOENT:
else:
Problem is, if I read that correctly, assuming Jeffrey's case is correct and rendercheck is not present, it "should" throw ENOENT (doesn't exist) and log a message and exit with a 1.
So logging.error, IIRC logs to wherever the logger is suppose to log, file or stdout, logging.error isn't internally redirected to stderr.
Second, it should exit with a 1, which should trigger the fail message, not a pass based on this command in the job description:
command: rendercheck_test -d -o $CHECKBOX_ DATA/renderchec k-results && echo "Rendercheck tests completed successfully" || echo "Rendercheck completed, but there are errors. Please see the log $CHECKBOX_ DATA/renderchec k-results for details"
which gives me this when I move the rendercheck tool:
bladernr@ klaatu: ~/development/ checkbox$ which rendercheck rendercheck klaatu: ~/development/ checkbox$ sudo mv /usr/bin/ rendercheck /usr/bin/ not-the- rendercheck- youre-looking- for klaatu: ~/development/ checkbox$ which rendercheck klaatu: ~/development/ checkbox$ ./scripts/ rendercheck_ test -d -o /tmp/renderchec k.log rendercheck_ test", line 134, in get_suites_list newlines= True) python3. 2/subprocess. py", line 745, in __init__ signals, start_new_session) python3. 2/subprocess. py", line 1361, in _execute_child _type(errno_ num, err_msg)
/usr/bin/
bladernr@
[sudo] password for bladernr:
bladernr@
bladernr@
Traceback (most recent call last):
File "./scripts/
stderr=PIPE, universal_
File "/usr/lib/
restore_
File "/usr/lib/
raise child_exception
OSError: [Errno 2] No such file or directory: 'rendercheck'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): rendercheck_ test", line 255, in <module> rendercheck_ test", line 165, in main ).get_suites_ list() rendercheck_ test", line 136, in get_suites_list
File "./scripts/
main()
File "./scripts/
all_tests = RenderCheck(
File "./scripts/
if exc.errno == errno.ENOENT:
NameError: global name 'errno' is not defined