From 9a07d88a2f43a507a13259518b153d23d9c5f260 Mon Sep 17 00:00:00 2001 From: Shreyans Doshi Date: Sat, 25 Nov 2017 21:27:02 +0530 Subject: [PATCH] Test coala -B --json command https://github.com/coala/coala/issues/4881 --- .misc/appveyor.yml | 1 + .travis.yml | 1 + circle.yml | 2 ++ coalib/output/ConsoleInteraction.py | 1 + 4 files changed, 5 insertions(+) diff --git a/.misc/appveyor.yml b/.misc/appveyor.yml index f464db33cd..10cc93b771 100644 --- a/.misc/appveyor.yml +++ b/.misc/appveyor.yml @@ -41,6 +41,7 @@ install: build: false # Not a C# project, build stuff at the test step instead. test_script: + - "%CMD_IN_ENV% coala -B --json" - "%CMD_IN_ENV% py.test" - "%CMD_IN_ENV% python setup.py install" diff --git a/.travis.yml b/.travis.yml index f863919145..a4ce474b4b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,6 +80,7 @@ script: sed -i.bak '/bears = GitCommitBear/d' .coafile fi - coala --non-interactive + - coala -B --json - python setup.py docs after_success: diff --git a/circle.yml b/circle.yml index b5f5253993..d1d2ba69f5 100644 --- a/circle.yml +++ b/circle.yml @@ -26,6 +26,8 @@ test: parallel: true - coala --non-interactive: parallel: true + - coala -B --json: + parallel: false - codecov: parallel: true - python setup.py docs diff --git a/coalib/output/ConsoleInteraction.py b/coalib/output/ConsoleInteraction.py index 1aaee4958e..15fa41eee8 100644 --- a/coalib/output/ConsoleInteraction.py +++ b/coalib/output/ConsoleInteraction.py @@ -942,6 +942,7 @@ def print_bears(bears, from coalib.output.JSONEncoder import create_json_encoder JSONEncoder = create_json_encoder(use_relpath=args.relpath) json_output = {'bears': results} + print(json_output) import json json_formatted_output = json.dumps(json_output, cls=JSONEncoder,