Closed Bug 706313 Opened 13 years ago Closed 13 years ago

redundant checks for results_server/link in run_tests.py

Categories

(Testing :: Talos, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: k0scist, Unassigned)

Details

Attachments

(1 file)

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:
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.
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+
pushed: http://hg.mozilla.org/build/talos/rev/705a12151bf2
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: