redundant checks for results_server/link in run_tests.py

RESOLVED FIXED

Status

Testing
Talos
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: Jeff Hammel, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
http://hg.mozilla.org/build/talos/file/5ae66b11330f/talos/run_tests.py#l545

  if (results_server != '') and (results_link != ''):
    #send results to the graph server
    try:
      if (results_server is not None and 
          results_server is not '' and 
          results_link is not None and 
          results_link is not ''):

This logic is very redundant.  You basically want results_server and
results_link both not to be False:

  if results_server and results_link:
(Reporter)

Comment 1

7 years ago
Created attachment 577791 [details] [diff] [review]
a much simpler check

Note that the `is ''` is just plain wrong as it is up to python when it caches instances string literals.  It will *probably* be cached in this case, but it is not guaranteed.
(Reporter)

Comment 2

7 years ago
Comment on attachment 577791 [details] [diff] [review]
a much simpler check

tested on A*Team staging and with tsvg locally on my Samsung tablet
Attachment #577791 - Flags: review?(jmaher)
Comment on attachment 577791 [details] [diff] [review]
a much simpler check

Review of attachment 577791 [details] [diff] [review]:
-----------------------------------------------------------------

that looks so much better!
Attachment #577791 - Flags: review?(jmaher) → review+
(Reporter)

Comment 4

7 years ago
pushed: http://hg.mozilla.org/build/talos/rev/705a12151bf2
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.