-
Notifications
You must be signed in to change notification settings - Fork 385
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
Local Compare mode HTML output files #1044
Conversation
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.
Do we clean up the export output every time?
I think it can be misleading if we only add html reports to the directory. The run at the server might change and the local analysis reports can change too.
|
||
output_path = os.path.join(args.export_dir, | ||
filename + '_' + str(file_id) + | ||
'_' + diff_type + '.html') |
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'm not sure we should add the diff type to the filename.
I thought for each diff type I would create a separate export folder -e new_reports
...
@@ -105,6 +105,10 @@ def getRunData(self, run_name_filter): | |||
pass | |||
|
|||
@ThriftClientCall | |||
def getReportDetails(self, reportId): |
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.
Did we miss this from the helper?
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.
Yes, we did.
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.
It wasn't missed per-se. I think this method was never actually used in the command-line client ever before.
086b90a
to
58f65ba
Compare
I have created a new |
e8b8efd
to
dfdc7bf
Compare
report_to_html(client, reports, output_dir) | ||
|
||
print('\nTo view the results in a browser run:\n' | ||
'> firefox {0}'.format(args.export_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.
What is >
? Linux prompt character is $
.
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.
If you print the directory path in this format file://home/myuser/report_directory
it will be clickable in the terminal right?
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.
In most Desktop terminal emulators, such as gnome-terminal
, yes. I think the ancient xterm
isn't capable of such feat.
print('Html file was generated for file {0}: {1}'.format( | ||
checked_file, output_path)) | ||
|
||
def printReports(client, reports, output_format, diff_type): |
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.
Parts of this file contains functions that break this convention, but Python uses print_reports
conventionally for function names. Let's not introduce more unneccessary breaking.
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.
dfdc7bf
to
705fcff
Compare
705fcff
to
9bf981b
Compare
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.
Please add some description to the newly introduced methods, what they do and why do we need them.
@@ -211,6 +228,20 @@ def __register_diff(parser): | |||
help="Show results that appear in both the 'base' and " | |||
"the 'new' run.") | |||
|
|||
def __handle(args): |
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.
Could you rename this to something more descriptive?
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.
This is the usual name for this method in server
and various other commands which have extra rules on their invocation.
This method only lives in the local scope of the registering function and isn't used anywhere else.
9bf981b
to
3a5f8fa
Compare
@@ -321,7 +327,79 @@ def get_diff_report_dir(client, baseids, report_dir, diff_type): | |||
filtered_reports.append(result) | |||
return filtered_reports | |||
|
|||
def print_reports(client, reports, output_format): | |||
def cache_report_file(file_cache, file_id): |
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 do not like the name of this function. The main purpose is not to cache the file but to lookup a file based on a file id.
I would rename it to something like cached_report_file_lookup
or get_report_file
.
file_report_map[report.fileId].append(report) | ||
|
||
file_cache = {} | ||
for file_id, file_reports in file_report_map.iteritems(): |
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.
Is iteritems
Python 3 compatible?
3a5f8fa
to
c8d1f43
Compare
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!
Local Compare mode should be able to generate HTML files with bug path.
c8d1f43
to
1d97c6f
Compare
Local Compare mode should be able to generate HTML files with bug path.
Closes #748