Bug 1391123 - Add a newline to the end of try_task_config.json r=gps
authorWes Kocher <wkocher@mozilla.com>
Fri, 15 Sep 2017 19:02:13 -0700
changeset 666690 6835fc2e493bf7af55ee65b48153e80be2f0ee33
parent 666689 cb2b8b4f4e04feade93e494cc5ea9d12eb3b2017
child 666691 11b46d2109c423c10ad890282acd9da08c00a409
push id80486
push userbmo:tlin@mozilla.com
push dateTue, 19 Sep 2017 03:52:30 +0000
reviewersgps
bugs1391123
milestone57.0a1
Bug 1391123 - Add a newline to the end of try_task_config.json r=gps 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)