Bug 1391123 - Add a newline to the end of try_task_config.json
MozReview-Commit-ID: BtQntIHOo2G
--- 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)