Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27683

burn_in_tests.py script doesn't handle when a new build variant is added to Evergreen

    • Fully Compatible
    • ALL
    • v3.4
    • Hide
      python -c 'from buildscripts import burn_in_tests; burn_in_tests.find_changed_tests("master", None, 1, "variant-that-does-not-exist", True)'
      

      The following patch can be applied to make an error be returned sooner by changing the number of revisions to check.

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      diff --git a/buildscripts/burn_in_tests.py b/buildscripts/burn_in_tests.py
      index b0c362824c..56fb3e6894 100644
      --- a/buildscripts/burn_in_tests.py
      +++ b/buildscripts/burn_in_tests.py
      @@ -199,7 +199,7 @@ def find_changed_tests(branch_name, base_commit, max_revisions, buildvariant, ch
               # previous commit when trying to find the most recent preceding commit that has been
               # activated.
               revs_to_check = callo(["git", "rev-list", base_commit,
      -                               "--max-count=200", "--skip=1"]).splitlines()
      +                               "--max-count=1", "--skip=1"]).splitlines()
               last_activated = find_last_activated_task(revs_to_check, buildvariant, branch_name)
               print "Comparing current branch against", last_activated
               revisions = callo(["git", "rev-list", base_commit + "..." + last_activated]).splitlines()
      
      Show
      python -c 'from buildscripts import burn_in_tests; burn_in_tests.find_changed_tests("master", None, 1, "variant-that-does-not-exist", True)' The following patch can be applied to make an error be returned sooner by changing the number of revisions to check. Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml diff --git a/buildscripts/burn_in_tests.py b/buildscripts/burn_in_tests.py index b0c362824c..56fb3e6894 100644 --- a/buildscripts/burn_in_tests.py +++ b/buildscripts/burn_in_tests.py @@ -199,7 +199,7 @@ def find_changed_tests(branch_name, base_commit, max_revisions, buildvariant, ch # previous commit when trying to find the most recent preceding commit that has been # activated. revs_to_check = callo([ "git" , "rev-list" , base_commit, - "--max-count=200" , "--skip=1" ]).splitlines() + "--max-count=1" , "--skip=1" ]).splitlines() last_activated = find_last_activated_task(revs_to_check, buildvariant, branch_name) print "Comparing current branch against" , last_activated revisions = callo([ "git" , "rev-list" , base_commit + "..." + last_activated]).splitlines()
    • TIG 2017-03-27
    • 0

      The find_last_activated_task() function script returns None when a build variant has never previously run before. This led to a transient failure when the "Enterprise Ubuntu 16.04 (Clang 3.7/libc++)" builder was added to Evergreen as part of SERVER-27434.

      [2016/12/29 20:34:56.709] # Capture a list of new and modified tests.
      [2016/12/29 20:34:56.709] python buildscripts/burn_in_tests.py --branch=master --buildVariant=enterprise-ubuntu1604-clang-3.7-libcxx --testListOutfile=jstests/new_tests.json --noExec $burn_in_args
      [2016/12/29 20:35:21.843] Traceback (most recent call last):
      [2016/12/29 20:35:21.843] Comparing current branch against None
      [2016/12/29 20:35:21.843]   File "buildscripts/burn_in_tests.py", line 425, in <module>
      [2016/12/29 20:35:21.843]     main()
      [2016/12/29 20:35:21.843]   File "buildscripts/burn_in_tests.py", line 391, in main
      [2016/12/29 20:35:21.843]     values.check_evergreen)
      [2016/12/29 20:35:21.843]   File "buildscripts/burn_in_tests.py", line 205, in find_changed_tests
      [2016/12/29 20:35:21.843]     revisions = callo(["git", "rev-list", base_commit + "..." + last_activated]).splitlines()
      [2016/12/29 20:35:21.843] TypeError: cannot concatenate 'str' and 'NoneType' objects
      

      I suspect the find_changed_tests() function should just be changed to default last_activated to "HEAD" when the find_last_activated_task() function returns None.

      def find_changed_tests(branch_name, base_commit, max_revisions, buildvariant, check_evergreen):
          """
          Use git to find which files have changed in this patch.
          TODO: This should be expanded to search for enterprise modules.
          """
          changed_tests = []
      
          if base_commit is None:
              base_commit = callo(["git", "merge-base", branch_name + "@{upstream}", "HEAD"]).rstrip()
          if check_evergreen:
              # We're going to check up to 200 commits in Evergreen for the last scheduled one.
              # The current commit will be activated in Evergreen; we use --skip to start at the
              # previous commit when trying to find the most recent preceding commit that has been
              # activated.
              revs_to_check = callo(["git", "rev-list", base_commit,
                                     "--max-count=200", "--skip=1"]).splitlines()
              last_activated = find_last_activated_task(revs_to_check, buildvariant, branch_name)
              print "Comparing current branch against", last_activated
              revisions = callo(["git", "rev-list", base_commit + "..." + last_activated]).splitlines()
              base_commit = last_activated
          ...
      

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: