Bug 1391123 - Add a newline to the end of try_task_config.json draft
authorWes Kocher <wkocher@mozilla.com>
Fri, 15 Sep 2017 19:02:13 -0700
changeset 665841 0597d0353897c16b2811b274cefe64df3557e4c6
parent 665648 6be5c7d30d2def62a762ac187252eba626b23a92
child 731915 e5d9ebd38d9cf6542dd119cdc5eaafa0f1b33284
push id80207
push userbmo:wkocher@mozilla.com
push dateSat, 16 Sep 2017 02:37:11 +0000
bugs1391123
milestone57.0a1
Bug 1391123 - Add a newline to the end of try_task_config.json MozReview-Commit-ID: BtQntIHOo2G
tools/tryselect/test/test_fuzzy.t
tools/tryselect/test/test_preset.t
tools/tryselect/vcs.py
--- a/tools/tryselect/test/test_fuzzy.t
+++ b/tools/tryselect/test/test_fuzzy.t
@@ -6,48 +6,52 @@ Test fuzzy selector
   $ ./mach try fuzzy $testargs -q "'foo"
   Calculated try selector:
   {
     "tasks":[
       "test/foo-debug",
       "test/foo-opt"
     ]
   }
+  
   $ ./mach try fuzzy $testargs -q "'bar"
   no tasks selected
   $ ./mach try fuzzy $testargs --full -q "'bar"
   Calculated try selector:
   {
     "tasks":[
       "test/bar-debug",
       "test/bar-opt"
     ]
   }
+  
 
 Test templates
 
   $ ./mach try fuzzy --no-push --artifact -q "'foo"
   Calculated try selector:
   {
     "templates":{
       "artifact":{
         "enabled":"1"
       }
     },
     "tasks":[
       "test/foo-debug",
       "test/foo-opt"
     ]
   }
+  
   $ ./mach try fuzzy $testargs --env FOO=1 --env BAR=baz -q "'foo"
   Calculated try selector:
   {
     "templates":{
       "env":{
         "FOO":"1",
         "BAR":"baz"
       }
     },
     "tasks":[
       "test/foo-debug",
       "test/foo-opt"
     ]
   }
+  
--- a/tools/tryselect/test/test_preset.t
+++ b/tools/tryselect/test/test_preset.t
@@ -37,24 +37,27 @@ Test preset with fuzzy subcommand
   $ ./mach try fuzzy $testargs --save baz -q "'baz"
   preset saved, run with: --preset=baz
   Calculated try selector:
   {
     "tasks":[
       "build-baz"
     ]
   }
+  
   $ ./mach try fuzzy $testargs --preset baz
   Calculated try selector:
   {
     "tasks":[
       "build-baz"
     ]
   }
+  
   $ ./mach try $testargs --preset baz
   Calculated try selector:
   {
     "tasks":[
       "build-baz"
     ]
   }
+  
   $ ./mach try fuzzy $testargs --list-presets
   baz: 'baz
--- a/tools/tryselect/vcs.py
+++ b/tools/tryselect/vcs.py
@@ -81,16 +81,17 @@ class VCSHelper(object):
     def write_task_config(self, labels, templates=None):
         config = os.path.join(self.root, 'try_task_config.json')
         with open(config, 'w') as fh:
             try_task_config = {'tasks': sorted(labels)}
             if templates:
                 try_task_config['templates'] = templates
 
             json.dump(try_task_config, fh, indent=2, separators=(',', ':'))
+            fh.write('\n')
         return config
 
     def check_working_directory(self, push=True):
         if not push:
             return
 
         if self.has_uncommitted_changes:
             print(UNCOMMITTED_CHANGES)