-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Reporter - Fails to generate docx, html and xlsx reports #144
Comments
I can confirm it's related to this issue you mentioned in Discord https://stackoverflow.com/questions/69792938/tkinter-fonts-in-a-seprate-file When using -n there is no tkinter window (nor should there be), but rs_setting_get_font function is using tkinter to load the operating system's font list as I was trying to prevent another bug in the GUI where it would try load the preview with a font chosen in the template that didn't exist in the OS. Here's the offending code: def rs_setting_get_font(self):
fontlst = list(tkFont.families())
base.debugmsg(9, "fontlst", fontlst)
value = self.rs_setting_get('font')
if value not in fontlst:
value = None
if value is None:
# Verdana, Tahoma, Arial, Helvetica, sans-serif
fontorder = ['Helvetica', 'Verdana', 'Tahoma', 'Arial', 'FreeSans']
for fnt in fontorder:
if fnt in fontlst:
return fnt
for fnt in fontlst:
if 'Sans' in fnt or 'sans' in fnt:
return fnt
return 'sans-serif'
else:
return value My initial thought is to not load the font list first, but rather read the value form the template and if running with -n just return the font name without any checks, then only if in GUI mode do the checks. My concern here is how the docx and xlsx generation will work, will they error is the font is not found? I guess I need to try it out and see what happens |
…3/rfswarm into Issue-#144-fails-with--n
Issue #144 Still expect this to fail as fix is not implimented
…3/rfswarm into Issue-#144-fails-with--n
…3/rfswarm into Issue-#144-fails-with--n
…3/rfswarm into Issue-#144-fails-with--n
Hopefully this doesn't break something else, particularly i'm concerned about docx and xlsx generation, lets see
…3/rfswarm into Issue-#144-fails-with--n
…3/rfswarm into Issue-#144-fails-with--n
…3/rfswarm into Issue-#144-fails-with--n
…3/rfswarm into Issue-#144-fails-with--n
…3/rfswarm into Issue-#144-fails-with--n
Add -g 1 so the output file is shown check filename.extension rather than just extension in output Issue #144
Regression Test case for Issue #144 found it :-)
Issue #144 For some reason stdout is empty when RC=0
This is the first issue with a regression test as I added the ability to run regression tests on Windows, Mac and Linux (Ubuntu) on several versions of python each as part of V1.1.0. Now there is a regression test for this we should be able to catch it if this issue occurs again. |
So far this bug report has been very productive, in addition to the original issue it's also found:
Now all builds are passing except Manager (macos-latest, 3.10), which I'm going to ignore for now as:
|
Merged into release v1.1.1 branch |
Describe the bug
Reporter - Fail to generate docx, html and xlsx reports
To Reproduce
Steps to reproduce the behavior:
rfswarm-reporter -n -i '/Users/patrick/Library/Application Support/Copado/QConnect/execution/performance-testing/files/configuration/RFSwarmReporter.ini' --debug 1 -d '/Users/patrick/Library/Application Support/Copado/QConnect/execution/performance-testing/20230424_105440_qconnect-load-test/20230424_105440_qconnect-load-test.db' -t '/Users/patrick/Library/Application Support/Copado/QConnect/execution/performance-testing/files/reporting/default.template' --html --xlsx --docx
Expected behavior
Reports formats should be generated.
Desktop (please complete the following information):
Log
`rfswarm-reporter -n -i '/Users/patrick/Library/Application Support/Copado/QConnect/execution/performance-testing/files/configuration/RFSwarmReporter.ini' --debug 1 -d '/Users/patrick/Library/Application Support/Copado/QConnect/execution/performance-testing/20230424_105440_qconnect-load-test/20230424_105440_qconnect-load-test.db' -t '/Users/patrick/Library/Application Support/Copado/QConnect/execution/performance-testing/files/reporting/default.template' --html --xlsx --docx
Robot Framework Swarm: Reporter
self.args.ini: /Users/patrick/Library/Application Support/Copado/QConnect/execution/performance-testing/files/configuration/RFSwarmReporter.ini
Generating XHTML Report
Generating Word Report
Exception in thread Thread-1:
Traceback (most recent call last):
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/threading.py", line 973, in _bootstrap_inner
Generating Excel Report
Exception in thread Thread-3:
Traceback (most recent call last):
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/threading.py", line 973, in _bootstrap_inner
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/threading.py", line 910, in run
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/site-packages/rfswarm_reporter/rfswarm-reporter", line 2524, in export_xhtml
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/threading.py", line 910, in run
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/site-packages/rfswarm_reporter/rfswarm-reporter", line 2621, in export_excel
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/site-packages/rfswarm_reporter/rfswarm-reporter", line 533, in rs_setting_get_font
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/tkinter/font.py", line 183, in families
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/tkinter/init.py", line 297, in _get_default_root
RuntimeError: Too early to use font.families(): no default root window
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/site-packages/rfswarm_reporter/rfswarm-reporter", line 3772, in xlsx_configure_style
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/site-packages/rfswarm_reporter/rfswarm-reporter", line 533, in rs_setting_get_font
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/tkinter/font.py", line 183, in families
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/tkinter/init.py", line 297, in _get_default_root
RuntimeError: Too early to use font.families(): no default root window
Exception in thread Thread-2:
Traceback (most recent call last):
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/threading.py", line 973, in _bootstrap_inner
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/threading.py", line 910, in run
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/site-packages/rfswarm_reporter/rfswarm-reporter", line 2585, in export_word
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/site-packages/rfswarm_reporter/rfswarm-reporter", line 3158, in docx_configure_style
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/site-packages/rfswarm_reporter/rfswarm-reporter", line 533, in rs_setting_get_font
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/tkinter/font.py", line 183, in families
File "/Applications/QConnect.app/Contents/Resources/standalone_python/install/lib/python3.9/tkinter/init.py", line 297, in _get_default_root
RuntimeError: Too early to use font.families(): no default root window
patrick@MacBook-Pro-van-Patrick ~ % `
The text was updated successfully, but these errors were encountered: