Skip to content

Instantly share code, notes, and snippets.

@harshhx17
Last active February 26, 2018 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harshhx17/fa4d3f3cac5b8162e4df7327355f7531 to your computer and use it in GitHub Desktop.
Save harshhx17/fa4d3f3cac5b8162e4df7327355f7531 to your computer and use it in GitHub Desktop.
test on coala repo
============================= test session starts ==============================
platform linux -- Python 3.6.3, pytest-3.1.3, py-1.5.2, pluggy-0.4.0
rootdir: /home/bhartiya/coala-bears, inifile: setup.cfg
plugins: xdist-1.22.1, timeout-1.2.1, reqs-0.0.7, reorder-0.1.0, mock-1.7.0, instafail-0.3.0, forked-0.2, error-for-skips-1.0.0, env-0.6.2, cov-2.5.1
timeout: 35.0s method: signal
collected 798 items
tests/coalaBearTest.py .
tests/generate_packageTest.py ............
tests/apertium/ApertiumLintBearTest.py ..
tests/c_languages/ArtisticStyleBearTest.py sssssssssssss
tests/c_languages/CPPCheckBearTest.py ss
tests/c_languages/CPPCleanBearTest.py ......
tests/c_languages/CPPLintBearTest.py ........
tests/c_languages/CSecurityBearTest.py ss
tests/c_languages/CSharpLintBearTest.py .
tests/c_languages/ClangBearTest.py .s.ssss
tests/c_languages/ClangComplexityBearTest.py ssss
tests/c_languages/GNUIndentBearTest.py ................
tests/c_languages/codeclone_detection/ClangASTPrintBearTest.py ss
tests/c_languages/codeclone_detection/ClangCloneDetectionBearTest.py ssss
tests/c_languages/codeclone_detection/ClangCountVectorCreatorTest.py ss
tests/c_languages/codeclone_detection/ClangCountingConditionsTest.py sssssssssssssss
tests/c_languages/codeclone_detection/CloneDetectionRoutinesTest.py .
tests/c_languages/codeclone_detection/CountVectorTest.py .........
tests/cmake/CMakeLintBearTest.py ....
tests/coffee_script/CoffeeLintBearTest.py ................................
tests/configfiles/DockerfileLintBearTest.py FFFFFF
tests/configfiles/PuppetLintBearTest.py ss
tests/configfiles/TOMLBearTest.py ss
tests/css/CSSAutoPrefixBearTest.py ss
tests/css/CSSCombBearTest.py ssssssssssss
tests/css/CSSLintBearTest.py ..
tests/css/StyleLintBearTest.py s
tests/csv/CSVLintBearTest.py ssss
tests/dart/DartLintBearTest.py ssss
tests/documentation/DocGrammarBearTest.py ..........
tests/documentation/DocumentationStyleBearTest.py ............
tests/elm/ElmLintBearTest.py sssssssssssss
tests/general/AnnotationBearTest.py ........
tests/general/CPDBearTest.py sss
tests/general/DuplicateFileBearTest.py ....
tests/general/FilenameBearTest.py .................
tests/general/IndentationBearTest.py ............
tests/general/InvalidLinkBearTest.py .................
tests/general/KeywordBearTest.py ...........
tests/general/LicenseCheckBearTest.py ss
tests/general/LineCountBearTest.py ..
tests/general/LineLengthBearTest.py ....
tests/general/MementoBearTest.py .........
tests/general/QuotesBearTest.py ...
tests/general/SpaceConsistencyBearTest.py .....
tests/general/TextLintBearTest.py ssssssssss
tests/general/URLBearTest.py .......
tests/general/coalaBearTest.py ..
tests/gettext/DennisBearTest.py ..
tests/go/GoErrCheckBearTest.py ssssssssss
tests/go/GoImportsBearTest.py ss
tests/go/GoLintBearTest.py ssss
tests/go/GoReturnsBearTest.py ss
tests/go/GoTypeBearTest.py ss
tests/go/GoVetBearTest.py s
tests/go/GofmtBearTest.py FF
tests/haml/HAMLLintBearTest.py sssssssssssss
tests/haskell/GhcModBearTest.py ss
tests/haskell/HaskellLintBearTest.py ss
tests/hypertext/BootLintBearTest.py ssss
tests/hypertext/HTMLHintBearTest.py ssssssssss
tests/hypertext/HTMLLintBearTest.py ........
tests/hypertext/HTTPoliceLintBearTest.py ....
tests/java/CheckstyleBearTest.py ........
tests/java/InferBearTest.py ss
tests/java/JavaPMDBearTest.py ss
tests/jinja2/Jinja2BearTest.py ................
tests/js/ESLintBearTest.py ssssssss
tests/js/HappinessLintBearTest.py sss
tests/js/JSComplexityBearTest.py ssssss
tests/js/JSHintBearTest.py ..........
tests/js/JSONFormatBearTest.py ..........
tests/js/JSStandardBearTest.py ss
tests/js/PrettierLintBearTest.py ss
tests/julia/JuliaLintBearTest.py ss
tests/latex/LatexLintBearTest.py ss
tests/lua/LuaLintBearTest.py ss
tests/markdown/MarkdownBearTest.py ssssssssssssssss
tests/matlab/MatlabIndentationBearTest.py ..
tests/natural_language/AlexBearTest.py ...F.
tests/natural_language/LanguageToolBearTest.py ...........
tests/natural_language/ProseLintBearTest.py ..
tests/natural_language/SpellCheckBearTest.py ..
tests/natural_language/WriteGoodLintBearTest.py ssssssssssssssssss
tests/perl/PerlCriticBearTest.py ssss
tests/php/PHPCodeSnifferBearTest.py ssss
tests/php/PHPLintBearTest.py .
tests/php/PHPMessDetectorBearTest.py sssss
tests/pug/PugLintBearTest.py sssssssss
tests/python/BanditBearTest.py .......
tests/python/MypyBearTest.py ..........
tests/python/PEP8BearTest.py .....
tests/python/PEP8NotebookBearTest.py ....
tests/python/PyCommentedCodeBearTest.py ..
tests/python/PyDocStyleBearTest.py ................
tests/python/PyFlakesBearTest.py ..
tests/python/PyImportSortBearTest.py .........
tests/python/PyLintBearTest.py ..
tests/python/PyUnusedCodeBearTest.py ........
tests/python/PycodestyleBearTest.py ..........
tests/python/PyromaBearTest.py ...
tests/python/PythonPackageInitBearTest.py ..
tests/python/RadonBearTest.py ......
tests/python/VultureBearTest.py ..........
tests/python/YapfBearTest.py .......
tests/python/requirements/PinRequirementsBearTest.py ....
tests/python/requirements/PySafetyBearTest.py .....
tests/r/FormatRBearTest.py ssssssssssssssss
tests/r/RLintBearTest.py ss
tests/rest/RSTcheckBearTest.py ........
tests/rest/reSTLintBearTest.py ..
tests/ruby/RuboCopBearTest.py ssssss
tests/ruby/RubySmellBearTest.py ssss
tests/ruby/RubySyntaxBearTest.py ss
tests/scala/ScalaLintBearTest.py ....
tests/scss/SCSSLintBearTest.py ssss
tests/shell/ShellCheckBearTest.py ssssssssss
tests/sql/SQLintBearTest.py ss
tests/stylus/StylintBearTest.py ssssssssss
tests/swift/TailorBearTest.py ssssss
tests/typescript/TSLintBearTest.py ssssss
tests/vcs/git/GitCommitBearTest.py ................
tests/verilog/VerilogLintBearTest.py ss
tests/vhdl/VHDLLintBearTest.py ss
tests/vimscript/VintBearTest.py ..
tests/xml2/XMLBearTest.py ssssssssssss
tests/yaml/RAMLLintBearTest.py ss
tests/yaml/TravisLintBearTest.py ssss
tests/yaml/YAMLLintBearTest.py .............
=================================== FAILURES ===================================
__________________ DockerfileLintBearTest.test_invalid_files ___________________
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb094bb0860>
args = ('/tmp/tmp6tkhhwrx', ['\n', 'FROM ubuntu:14.04\n', '\n', '# Install basic tools\n', 'apt-get -y -qq update\n', 'apt-get -y -qq upgrade\n'])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094bb06d8>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094ba5510>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094ba51e0>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmp6tkhhwrx'", 'Bear DockerfileLintBea...ar 1)', "Program arguments:\n('--json', '-f', '/tmp/tmp6tkhhwrx')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
> 'Bear returned None on execution\n'
E AssertionError: Bear returned None on execution
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:62: AssertionError
During handling of the above exception, another exception occurred:
self = <coalib.testing.LocalBearTestHelper.verify_local_bear.<locals>.LocalBearTest testMethod=test_invalid_files>
 def test_invalid_files(self):
 self.assertIsInstance(invalid_files, (list, tuple))
 for file in invalid_files:
 self.check_validity(self.uut,
 file.splitlines(keepends=True),
 filename,
 valid=False,
 force_linebreaks=force_linebreaks,
 create_tempfile=create_tempfile,
> tempfile_kwargs=tempfile_kwargs)
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:376:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:173: in check_validity
 settings=settings,
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:209: in check_invalidity
 settings=settings,
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:99: in get_results
 **local_bear.get_metadata().filter_parameters(settings)
/usr/lib/python3.6/contextlib.py:81: in __enter__
 return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb094bb0860>
args = ('/tmp/tmp6tkhhwrx', ['\n', 'FROM ubuntu:14.04\n', '\n', '# Install basic tools\n', 'apt-get -y -qq update\n', 'apt-get -y -qq upgrade\n'])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094bb06d8>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094ba5510>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094ba51e0>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmp6tkhhwrx'", 'Bear DockerfileLintBea...ar 1)', "Program arguments:\n('--json', '-f', '/tmp/tmp6tkhhwrx')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
 'Bear returned None on execution\n'
 yield bear_output_generator
 except Exception as err:
 msg = []
 while not bear.message_queue.empty():
 msg.append(bear.message_queue.get().message)
 msg += console_output
> raise AssertionError(str(err) + ''.join('\n' + m for m in msg))
E AssertionError: Bear returned None on execution
E 
E Running bear DockerfileLintBear...
E Running 'dockerfile_lint --json -f /tmp/tmp6tkhhwrx'
E Bear DockerfileLintBear failed to run on file /tmp/tmp6tkhhwrx. Take a look at debug messages (`-V`) for further information.
E The bear DockerfileLintBear raised an exception. If you are the author of this bear, please make sure to catch all exceptions. If not and this error annoys you, you might want to get in contact with the author of this bear.
E 
E Traceback information is provided below:
E 
E Traceback (most recent call last):
E File "/home/bhartiya/venv/lib/python3.6/site-packages/coalib/bears/Bear.py", line 308, in execute
E return [] if result is None else list(result)
E File "/home/bhartiya/coala-bears/bears/configfiles/DockerfileLintBear.py", line 44, in process_output
E output = json.loads(output)
E File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
E return _default_decoder.decode(s)
E File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
E obj, end = self.raw_decode(s, idx=_w(s, 0).end())
E File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
E raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
E Program arguments:
E ('--json', '-f', '/tmp/tmp6tkhhwrx')
E The program yielded the following output:
E 
E 
E # Analyzing /tmp/tmp6tkhhwrx
E 
E {
E "error": {
E "count": 6,
E "data": [
E {
E "message": "Invalid Command",
E "line": 5,
E "level": "error",
E "lineContent": "apt-get -y -qq update",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E },
E {
E "message": "Invalid instruction",
E "line": 5,
E "level": "error",
E "lineContent": "apt-get -y -qq update",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E },
E {
E "message": "Invalid Command",
E "line": 6,
E "level": "error",
E "lineContent": "apt-get -y -qq upgrade",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E },
E {
E "message": "Invalid instruction",
E "line": 6,
E "level": "error",
E "lineContent": "apt-get -y -qq upgrade",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E },
E {
E "message": "Required LABEL name/key 'Name' is not defined",
E "line": -1,
E "level": "error",
E "lineContent": "",
E "reference_url": [
E "http://docs.projectatomic.io/container-best-practices/#",
E "_recommended_labels_for_your_project"
E ]
E },
E {
E "message": "Required LABEL name/key 'Version' is not defined",
E "line": -1,
E "level": "error",
E "lineContent": "",
E "reference_url": [
E "http://docs.projectatomic.io/container-best-practices/#",
E "_recommended_labels_for_your_project"
E ]
E }
E ]
E },
E "warn": {
E "count": 0,
E "data": []
E },
E "info": {
E "count": 2,
E "data": [
E {
E "instruction": "EXPOSE",
E "count": 1,
E "level": "info",
E "message": "There is no 'EXPOSE' instruction",
E "description": "Without exposed ports how will the service of the container be accessed?",
E "reference_url": [
E "https://docs.docker.com/engine/reference/builder/",
E "#expose"
E ]
E },
E {
E "instruction": "CMD",
E "count": 1,
E "level": "info",
E "message": "There is no 'CMD' instruction",
E "description": "None",
E "reference_url": [
E "https://docs.docker.com/engine/reference/builder/",
E "#cmd"
E ]
E }
E ]
E },
E "summary": []
E }
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:69: AssertionError
___________________ DockerfileLintBearTest.test_valid_files ____________________
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb097cc75f8>
args = ('/tmp/tmplyrz9db4', ['\n', 'FROM ubuntu:14.04\n', 'MAINTAINER coala\n', 'LABEL Name coala-docker\n', 'LABEL Version 0.1\n', '\n', ...])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094c0deb8>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094bd7ae8>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094bf3bf8>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmplyrz9db4'", 'Bear DockerfileLintBea...ar 1)', "Program arguments:\n('--json', '-f', '/tmp/tmplyrz9db4')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
> 'Bear returned None on execution\n'
E AssertionError: Bear returned None on execution
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:62: AssertionError
During handling of the above exception, another exception occurred:
self = <coalib.testing.LocalBearTestHelper.verify_local_bear.<locals>.LocalBearTest testMethod=test_valid_files>
 def test_valid_files(self):
 self.assertIsInstance(valid_files, (list, tuple))
 for file in valid_files:
 self.check_validity(self.uut,
 file.splitlines(keepends=True),
 filename,
 valid=True,
 force_linebreaks=force_linebreaks,
 create_tempfile=create_tempfile,
> tempfile_kwargs=tempfile_kwargs)
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:365:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:165: in check_validity
 settings=settings,
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:261: in check_results
 settings=settings)
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:99: in get_results
 **local_bear.get_metadata().filter_parameters(settings)
/usr/lib/python3.6/contextlib.py:81: in __enter__
 return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb097cc75f8>
args = ('/tmp/tmplyrz9db4', ['\n', 'FROM ubuntu:14.04\n', 'MAINTAINER coala\n', 'LABEL Name coala-docker\n', 'LABEL Version 0.1\n', '\n', ...])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094c0deb8>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094bd7ae8>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094bf3bf8>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmplyrz9db4'", 'Bear DockerfileLintBea...ar 1)', "Program arguments:\n('--json', '-f', '/tmp/tmplyrz9db4')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
 'Bear returned None on execution\n'
 yield bear_output_generator
 except Exception as err:
 msg = []
 while not bear.message_queue.empty():
 msg.append(bear.message_queue.get().message)
 msg += console_output
> raise AssertionError(str(err) + ''.join('\n' + m for m in msg))
E AssertionError: Bear returned None on execution
E 
E Running bear DockerfileLintBear...
E Running 'dockerfile_lint --json -f /tmp/tmplyrz9db4'
E Bear DockerfileLintBear failed to run on file /tmp/tmplyrz9db4. Take a look at debug messages (`-V`) for further information.
E The bear DockerfileLintBear raised an exception. If you are the author of this bear, please make sure to catch all exceptions. If not and this error annoys you, you might want to get in contact with the author of this bear.
E 
E Traceback information is provided below:
E 
E Traceback (most recent call last):
E File "/home/bhartiya/venv/lib/python3.6/site-packages/coalib/bears/Bear.py", line 308, in execute
E return [] if result is None else list(result)
E File "/home/bhartiya/coala-bears/bears/configfiles/DockerfileLintBear.py", line 44, in process_output
E output = json.loads(output)
E File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
E return _default_decoder.decode(s)
E File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
E obj, end = self.raw_decode(s, idx=_w(s, 0).end())
E File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
E raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
E Program arguments:
E ('--json', '-f', '/tmp/tmplyrz9db4')
E The program yielded the following output:
E 
E 
E # Analyzing /tmp/tmplyrz9db4
E 
E {
E "error": {
E "count": 0,
E "data": []
E },
E "warn": {
E "count": 0,
E "data": []
E },
E "info": {
E "count": 1,
E "data": [
E {
E "label": "maintainer_deprecated",
E "regex": {},
E "level": "info",
E "message": "the MAINTAINER command is deprecated",
E "description": "MAINTAINER is deprecated in favor of using LABEL since Docker v1.13.0",
E "reference_url": [
E "https://github.com/docker/docker/blob/master/docs/deprecated.md",
E "#maintainer-in-dockerfile"
E ],
E "lineContent": "MAINTAINER coala",
E "line": 3
E }
E ]
E },
E "summary": []
E }
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:69: AssertionError
_____________ DockerfileLintBearDefaultRuleTest.test_invalid_files _____________
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb094be75c0>
args = ('/tmp/tmpr22b2gg9', ['\n', 'FROM ubuntu\n', '\n', 'apt-get -y -qq update\n', 'apt-get -y -qq upgrade\n', 'curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -\n'])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094be7940>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094c13510>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094c132f0>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmpr22b2gg9 -r /home/bhartiya/coala-be.../tests/configfiles/dockerfile_lint_test_files/default_rule.yaml')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
> 'Bear returned None on execution\n'
E AssertionError: Bear returned None on execution
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:62: AssertionError
During handling of the above exception, another exception occurred:
self = <coalib.testing.LocalBearTestHelper.verify_local_bear.<locals>.LocalBearTest testMethod=test_invalid_files>
 def test_invalid_files(self):
 self.assertIsInstance(invalid_files, (list, tuple))
 for file in invalid_files:
 self.check_validity(self.uut,
 file.splitlines(keepends=True),
 filename,
 valid=False,
 force_linebreaks=force_linebreaks,
 create_tempfile=create_tempfile,
> tempfile_kwargs=tempfile_kwargs)
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:376:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:173: in check_validity
 settings=settings,
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:209: in check_invalidity
 settings=settings,
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:99: in get_results
 **local_bear.get_metadata().filter_parameters(settings)
/usr/lib/python3.6/contextlib.py:81: in __enter__
 return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb094be75c0>
args = ('/tmp/tmpr22b2gg9', ['\n', 'FROM ubuntu\n', '\n', 'apt-get -y -qq update\n', 'apt-get -y -qq upgrade\n', 'curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -\n'])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094be7940>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094c13510>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094c132f0>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmpr22b2gg9 -r /home/bhartiya/coala-be.../tests/configfiles/dockerfile_lint_test_files/default_rule.yaml')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
 'Bear returned None on execution\n'
 yield bear_output_generator
 except Exception as err:
 msg = []
 while not bear.message_queue.empty():
 msg.append(bear.message_queue.get().message)
 msg += console_output
> raise AssertionError(str(err) + ''.join('\n' + m for m in msg))
E AssertionError: Bear returned None on execution
E 
E Running bear DockerfileLintBear...
E Running 'dockerfile_lint --json -f /tmp/tmpr22b2gg9 -r /home/bhartiya/coala-bears/tests/configfiles/dockerfile_lint_test_files/default_rule.yaml'
E Bear DockerfileLintBear failed to run on file /tmp/tmpr22b2gg9. Take a look at debug messages (`-V`) for further information.
E The bear DockerfileLintBear raised an exception. If you are the author of this bear, please make sure to catch all exceptions. If not and this error annoys you, you might want to get in contact with the author of this bear.
E 
E Traceback information is provided below:
E 
E Traceback (most recent call last):
E File "/home/bhartiya/venv/lib/python3.6/site-packages/coalib/bears/Bear.py", line 308, in execute
E return [] if result is None else list(result)
E File "/home/bhartiya/coala-bears/bears/configfiles/DockerfileLintBear.py", line 44, in process_output
E output = json.loads(output)
E File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
E return _default_decoder.decode(s)
E File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
E obj, end = self.raw_decode(s, idx=_w(s, 0).end())
E File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
E raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
E Program arguments:
E ('--json', '-f', '/tmp/tmpr22b2gg9', '-r', '/home/bhartiya/coala-bears/tests/configfiles/dockerfile_lint_test_files/default_rule.yaml')
E The program yielded the following output:
E 
E 
E # Analyzing /tmp/tmpr22b2gg9
E 
E {
E "error": {
E "count": 8,
E "data": [
E {
E "message": "Invalid Command",
E "line": 4,
E "level": "error",
E "lineContent": "apt-get -y -qq update",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E },
E {
E "message": "Invalid instruction",
E "line": 4,
E "level": "error",
E "lineContent": "apt-get -y -qq update",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E },
E {
E "message": "Invalid Command",
E "line": 5,
E "level": "error",
E "lineContent": "apt-get -y -qq upgrade",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E },
E {
E "message": "Invalid instruction",
E "line": 5,
E "level": "error",
E "lineContent": "apt-get -y -qq upgrade",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E },
E {
E "message": "Invalid Command",
E "line": 6,
E "level": "error",
E "lineContent": "curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E },
E {
E "message": "Invalid instruction",
E "line": 6,
E "level": "error",
E "lineContent": "curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E },
E {
E "message": "Required LABEL name/key 'Name' is not defined",
E "line": -1,
E "level": "error",
E "lineContent": "",
E "reference_url": [
E "http://docs.projectatomic.io/container-best-practices/#",
E "_recommended_labels_for_your_project"
E ]
E },
E {
E "message": "Required LABEL name/key 'Version' is not defined",
E "line": -1,
E "level": "error",
E "lineContent": "",
E "reference_url": [
E "http://docs.projectatomic.io/container-best-practices/#",
E "_recommended_labels_for_your_project"
E ]
E }
E ]
E },
E "warn": {
E "count": 0,
E "data": []
E },
E "info": {
E "count": 2,
E "data": [
E {
E "instruction": "EXPOSE",
E "count": 1,
E "level": "info",
E "message": "There is no 'EXPOSE' instruction",
E "description": "Without exposed ports how will the service of the container be accessed?",
E "reference_url": [
E "https://docs.docker.com/engine/reference/builder/",
E "#expose"
E ]
E },
E {
E "instruction": "CMD",
E "count": 1,
E "level": "info",
E "message": "There is no 'CMD' instruction",
E "description": "None",
E "reference_url": [
E "https://docs.docker.com/engine/reference/builder/",
E "#cmd"
E ]
E }
E ]
E },
E "summary": []
E }
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:69: AssertionError
______________ DockerfileLintBearDefaultRuleTest.test_valid_files ______________
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb094bf6b38>
args = ('/tmp/tmp_1qgquzo', ['\n', 'FROM ubuntu\n', 'MAINTAINER coala\n', 'LABEL Name coala-docker\n', 'LABEL Version 0.1\n', '\n', ...])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094bf6b00>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094ba5b70>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094ba50d0>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmp_1qgquzo -r /home/bhartiya/coala-be.../tests/configfiles/dockerfile_lint_test_files/default_rule.yaml')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
> 'Bear returned None on execution\n'
E AssertionError: Bear returned None on execution
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:62: AssertionError
During handling of the above exception, another exception occurred:
self = <coalib.testing.LocalBearTestHelper.verify_local_bear.<locals>.LocalBearTest testMethod=test_valid_files>
 def test_valid_files(self):
 self.assertIsInstance(valid_files, (list, tuple))
 for file in valid_files:
 self.check_validity(self.uut,
 file.splitlines(keepends=True),
 filename,
 valid=True,
 force_linebreaks=force_linebreaks,
 create_tempfile=create_tempfile,
> tempfile_kwargs=tempfile_kwargs)
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:365:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:165: in check_validity
 settings=settings,
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:261: in check_results
 settings=settings)
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:99: in get_results
 **local_bear.get_metadata().filter_parameters(settings)
/usr/lib/python3.6/contextlib.py:81: in __enter__
 return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb094bf6b38>
args = ('/tmp/tmp_1qgquzo', ['\n', 'FROM ubuntu\n', 'MAINTAINER coala\n', 'LABEL Name coala-docker\n', 'LABEL Version 0.1\n', '\n', ...])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094bf6b00>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094ba5b70>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094ba50d0>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmp_1qgquzo -r /home/bhartiya/coala-be.../tests/configfiles/dockerfile_lint_test_files/default_rule.yaml')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
 'Bear returned None on execution\n'
 yield bear_output_generator
 except Exception as err:
 msg = []
 while not bear.message_queue.empty():
 msg.append(bear.message_queue.get().message)
 msg += console_output
> raise AssertionError(str(err) + ''.join('\n' + m for m in msg))
E AssertionError: Bear returned None on execution
E 
E Running bear DockerfileLintBear...
E Running 'dockerfile_lint --json -f /tmp/tmp_1qgquzo -r /home/bhartiya/coala-bears/tests/configfiles/dockerfile_lint_test_files/default_rule.yaml'
E Bear DockerfileLintBear failed to run on file /tmp/tmp_1qgquzo. Take a look at debug messages (`-V`) for further information.
E The bear DockerfileLintBear raised an exception. If you are the author of this bear, please make sure to catch all exceptions. If not and this error annoys you, you might want to get in contact with the author of this bear.
E 
E Traceback information is provided below:
E 
E Traceback (most recent call last):
E File "/home/bhartiya/venv/lib/python3.6/site-packages/coalib/bears/Bear.py", line 308, in execute
E return [] if result is None else list(result)
E File "/home/bhartiya/coala-bears/bears/configfiles/DockerfileLintBear.py", line 44, in process_output
E output = json.loads(output)
E File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
E return _default_decoder.decode(s)
E File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
E obj, end = self.raw_decode(s, idx=_w(s, 0).end())
E File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
E raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
E Program arguments:
E ('--json', '-f', '/tmp/tmp_1qgquzo', '-r', '/home/bhartiya/coala-bears/tests/configfiles/dockerfile_lint_test_files/default_rule.yaml')
E The program yielded the following output:
E 
E 
E # Analyzing /tmp/tmp_1qgquzo
E 
E {
E "error": {
E "count": 0,
E "data": []
E },
E "warn": {
E "count": 0,
E "data": []
E },
E "info": {
E "count": 0,
E "data": []
E },
E "summary": []
E }
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:69: AssertionError
_____________ DockerfileLintBearCustomRuleTest.test_invalid_files ______________
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb094c30f28>
args = ('/tmp/tmpeeq2tzte', ['\n', 'FROM kali\n', 'LABEL Name\n', 'LABEL Version\n'])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094c30cf8>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094b7ff28>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094b7fea0>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmpeeq2tzte -r /home/bhartiya/coala-be...s/tests/configfiles/dockerfile_lint_test_files/sample_rule.yaml')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
> 'Bear returned None on execution\n'
E AssertionError: Bear returned None on execution
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:62: AssertionError
During handling of the above exception, another exception occurred:
self = <coalib.testing.LocalBearTestHelper.verify_local_bear.<locals>.LocalBearTest testMethod=test_invalid_files>
 def test_invalid_files(self):
 self.assertIsInstance(invalid_files, (list, tuple))
 for file in invalid_files:
 self.check_validity(self.uut,
 file.splitlines(keepends=True),
 filename,
 valid=False,
 force_linebreaks=force_linebreaks,
 create_tempfile=create_tempfile,
> tempfile_kwargs=tempfile_kwargs)
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:376:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:173: in check_validity
 settings=settings,
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:209: in check_invalidity
 settings=settings,
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:99: in get_results
 **local_bear.get_metadata().filter_parameters(settings)
/usr/lib/python3.6/contextlib.py:81: in __enter__
 return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb094c30f28>
args = ('/tmp/tmpeeq2tzte', ['\n', 'FROM kali\n', 'LABEL Name\n', 'LABEL Version\n'])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094c30cf8>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094b7ff28>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094b7fea0>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmpeeq2tzte -r /home/bhartiya/coala-be...s/tests/configfiles/dockerfile_lint_test_files/sample_rule.yaml')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
 'Bear returned None on execution\n'
 yield bear_output_generator
 except Exception as err:
 msg = []
 while not bear.message_queue.empty():
 msg.append(bear.message_queue.get().message)
 msg += console_output
> raise AssertionError(str(err) + ''.join('\n' + m for m in msg))
E AssertionError: Bear returned None on execution
E 
E Running bear DockerfileLintBear...
E Running 'dockerfile_lint --json -f /tmp/tmpeeq2tzte -r /home/bhartiya/coala-bears/tests/configfiles/dockerfile_lint_test_files/sample_rule.yaml'
E Bear DockerfileLintBear failed to run on file /tmp/tmpeeq2tzte. Take a look at debug messages (`-V`) for further information.
E The bear DockerfileLintBear raised an exception. If you are the author of this bear, please make sure to catch all exceptions. If not and this error annoys you, you might want to get in contact with the author of this bear.
E 
E Traceback information is provided below:
E 
E Traceback (most recent call last):
E File "/home/bhartiya/venv/lib/python3.6/site-packages/coalib/bears/Bear.py", line 308, in execute
E return [] if result is None else list(result)
E File "/home/bhartiya/coala-bears/bears/configfiles/DockerfileLintBear.py", line 44, in process_output
E output = json.loads(output)
E File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
E return _default_decoder.decode(s)
E File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
E obj, end = self.raw_decode(s, idx=_w(s, 0).end())
E File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
E raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
E Program arguments:
E ('--json', '-f', '/tmp/tmpeeq2tzte', '-r', '/home/bhartiya/coala-bears/tests/configfiles/dockerfile_lint_test_files/sample_rule.yaml')
E The program yielded the following output:
E 
E 
E # Analyzing /tmp/tmpeeq2tzte
E 
E {
E "error": {
E "count": 2,
E "data": [
E {
E "message": "LABEL must have two arguments, got Name",
E "line": 3,
E "level": "error",
E "lineContent": "LABEL Name",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E },
E {
E "message": "LABEL must have two arguments, got Version",
E "line": 4,
E "level": "error",
E "lineContent": "LABEL Version",
E "reference_url": "https://docs.docker.com/engine/reference/builder/"
E }
E ]
E },
E "warn": {
E "count": 0,
E "data": []
E },
E "info": {
E "count": 2,
E "data": [
E {
E "instruction": "MAINTAINER",
E "count": 1,
E "level": "info",
E "message": "Maintainer is not defined",
E "description": "The MAINTAINER line is useful for identifying the author in the form of MAINTAINER Joe Smith <joe.smith@example.com>",
E "reference_url": [
E "https://docs.docker.com/engine/reference/builder/",
E "#maintainer"
E ]
E },
E {
E "instruction": "EXPOSE",
E "count": 1,
E "level": "info",
E "message": "There is no 'EXPOSE' instruction",
E "description": "Without exposed ports how will the service of the container be accessed?",
E "reference_url": [
E "https://docs.docker.com/engine/reference/builder/",
E "#expose"
E ]
E }
E ]
E },
E "summary": []
E }
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:69: AssertionError
______________ DockerfileLintBearCustomRuleTest.test_valid_files _______________
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb094c45a58>
args = ('/tmp/tmpdyb77ln2', ['\n', 'FROM kali\n', 'MAINTAINER coala\n', 'LABEL Name coala-docker\n', 'LABEL Version 0.1\n', 'EXPOSE 5432\n'])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094c45668>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094b346a8>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094b347b8>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmpdyb77ln2 -r /home/bhartiya/coala-be...s/tests/configfiles/dockerfile_lint_test_files/sample_rule.yaml')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
> 'Bear returned None on execution\n'
E AssertionError: Bear returned None on execution
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:62: AssertionError
During handling of the above exception, another exception occurred:
self = <coalib.testing.LocalBearTestHelper.verify_local_bear.<locals>.LocalBearTest testMethod=test_valid_files>
 def test_valid_files(self):
 self.assertIsInstance(valid_files, (list, tuple))
 for file in valid_files:
 self.check_validity(self.uut,
 file.splitlines(keepends=True),
 filename,
 valid=True,
 force_linebreaks=force_linebreaks,
 create_tempfile=create_tempfile,
> tempfile_kwargs=tempfile_kwargs)
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:365:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:165: in check_validity
 settings=settings,
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:261: in check_results
 settings=settings)
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:99: in get_results
 **local_bear.get_metadata().filter_parameters(settings)
/usr/lib/python3.6/contextlib.py:81: in __enter__
 return next(self.gen)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
bear = <DockerfileLintBear linter object (wrapping 'dockerfile_lint') at 0x7fb094c45a58>
args = ('/tmp/tmpdyb77ln2', ['\n', 'FROM kali\n', 'MAINTAINER coala\n', 'LABEL Name coala-docker\n', 'LABEL Version 0.1\n', 'EXPOSE 5432\n'])
kwargs = {'dependency_results': None}
stack = <contextlib.ExitStack object at 0x7fb094c45668>
new_create_arguments = <function execute_bear.<locals>.new_create_arguments at 0x7fb094b346a8>
new_process_output = <function execute_bear.<locals>.new_process_output at 0x7fb094b347b8>
bear_output_generator = None
msg = ['Running bear DockerfileLintBear...', "Running 'dockerfile_lint --json -f /tmp/tmpdyb77ln2 -r /home/bhartiya/coala-be...s/tests/configfiles/dockerfile_lint_test_files/sample_rule.yaml')", 'The program yielded the following output:\n', ...]
 @contextmanager
 def execute_bear(bear, *args, **kwargs):
 try:
 console_output = []
 
 # For linters provide additional information, such as
 # stdout and stderr.
 with ExitStack() as stack:
 if isinstance(bear, LinterClass):
 old_process_output = bear.process_output
 old_create_arguments = bear.create_arguments
 
 def new_create_arguments(filename, file, config_file,
 *args, **kwargs):
 arguments = old_create_arguments(filename, file,
 config_file, *args,
 **kwargs)
 console_output.append(
 'Program arguments:\n' + repr(arguments))
 
 return arguments
 
 def new_process_output(output, filename=None, file=None,
 **process_output_kwargs):
 
 console_output.append('The program yielded '
 'the following output:\n')
 if isinstance(output, tuple):
 stdout, stderr = output
 console_output.append('Stdout:\n' + stdout)
 console_output.append('Stderr:\n' + stderr)
 else:
 console_output.append(output)
 return old_process_output(output, filename, file,
 **process_output_kwargs)
 
 stack.enter_context(patch.object(
 bear, 'process_output', wraps=new_process_output))
 
 stack.enter_context(patch.object(
 bear, 'create_arguments', wraps=new_create_arguments))
 
 bear_output_generator = bear.execute(*args, **kwargs)
 
 assert bear_output_generator is not None, \
 'Bear returned None on execution\n'
 yield bear_output_generator
 except Exception as err:
 msg = []
 while not bear.message_queue.empty():
 msg.append(bear.message_queue.get().message)
 msg += console_output
> raise AssertionError(str(err) + ''.join('\n' + m for m in msg))
E AssertionError: Bear returned None on execution
E 
E Running bear DockerfileLintBear...
E Running 'dockerfile_lint --json -f /tmp/tmpdyb77ln2 -r /home/bhartiya/coala-bears/tests/configfiles/dockerfile_lint_test_files/sample_rule.yaml'
E Bear DockerfileLintBear failed to run on file /tmp/tmpdyb77ln2. Take a look at debug messages (`-V`) for further information.
E The bear DockerfileLintBear raised an exception. If you are the author of this bear, please make sure to catch all exceptions. If not and this error annoys you, you might want to get in contact with the author of this bear.
E 
E Traceback information is provided below:
E 
E Traceback (most recent call last):
E File "/home/bhartiya/venv/lib/python3.6/site-packages/coalib/bears/Bear.py", line 308, in execute
E return [] if result is None else list(result)
E File "/home/bhartiya/coala-bears/bears/configfiles/DockerfileLintBear.py", line 44, in process_output
E output = json.loads(output)
E File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
E return _default_decoder.decode(s)
E File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
E obj, end = self.raw_decode(s, idx=_w(s, 0).end())
E File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
E raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)
E Program arguments:
E ('--json', '-f', '/tmp/tmpdyb77ln2', '-r', '/home/bhartiya/coala-bears/tests/configfiles/dockerfile_lint_test_files/sample_rule.yaml')
E The program yielded the following output:
E 
E 
E # Analyzing /tmp/tmpdyb77ln2
E 
E {
E "error": {
E "count": 0,
E "data": []
E },
E "warn": {
E "count": 0,
E "data": []
E },
E "info": {
E "count": 0,
E "data": []
E },
E "summary": []
E }
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:69: AssertionError
_______________________ GofmtBearTest.test_with_simplify _______________________
self = <tests.go.GofmtBearTest.GofmtBearTest testMethod=test_with_simplify>
 def setUp(self):
 self.section = Section('')
> self.uut = GofmtBear(self.section, Queue())
tests/go/GofmtBearTest.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../venv/lib/python3.6/site-packages/coala_utils/decorators.py:430: in decorated
 return function(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <GofmtBear linter object (wrapping 'gofmt') at 0x7fb09423ef28>
section = <Section object(aspects=None, contents=OrderedDict(), defaults=None, language=None, name='') at 0x7fb09423e6a0>
message_queue = <queue.Queue object at 0x7fb09423e198>, timeout = 0
 @enforce_signature
 def __init__(self,
 section: Section,
 message_queue,
 timeout=0):
 """
 Constructs a new bear.
 
 :param section: The section object where bear settings are
 contained.
 :param message_queue: The queue object for messages. Can be ``None``.
 :param timeout: The time the bear is allowed to run. To set no
 time limit, use 0.
 :raises TypeError: Raised when ``message_queue`` is no queue.
 :raises RuntimeError: Raised when bear requirements are not fulfilled.
 """
 Printer.__init__(self)
 
 if message_queue is not None and not hasattr(message_queue, 'put'):
 raise TypeError('message_queue has to be a Queue or None.')
 
 self.section = section
 self.message_queue = message_queue
 self.timeout = timeout
 
 self.setup_dependencies()
 cp = type(self).check_prerequisites()
 if cp is not True:
 error_string = ('The bear ' + self.name +
 ' does not fulfill all requirements.')
 if cp is not False:
 error_string += ' ' + cp
 
 self.err(error_string)
> raise RuntimeError(error_string)
E RuntimeError: The bear GofmtBear does not fulfill all requirements. 'gofmt' is not installed.
../venv/lib/python3.6/site-packages/coalib/bears/Bear.py:264: RuntimeError
_____________________ GofmtBearTest.test_without_simplify ______________________
self = <tests.go.GofmtBearTest.GofmtBearTest testMethod=test_without_simplify>
 def setUp(self):
 self.section = Section('')
> self.uut = GofmtBear(self.section, Queue())
tests/go/GofmtBearTest.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../venv/lib/python3.6/site-packages/coala_utils/decorators.py:430: in decorated
 return function(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <GofmtBear linter object (wrapping 'gofmt') at 0x7fb09424e7f0>
section = <Section object(aspects=None, contents=OrderedDict(), defaults=None, language=None, name='') at 0x7fb09424e710>
message_queue = <queue.Queue object at 0x7fb09424e978>, timeout = 0
 @enforce_signature
 def __init__(self,
 section: Section,
 message_queue,
 timeout=0):
 """
 Constructs a new bear.
 
 :param section: The section object where bear settings are
 contained.
 :param message_queue: The queue object for messages. Can be ``None``.
 :param timeout: The time the bear is allowed to run. To set no
 time limit, use 0.
 :raises TypeError: Raised when ``message_queue`` is no queue.
 :raises RuntimeError: Raised when bear requirements are not fulfilled.
 """
 Printer.__init__(self)
 
 if message_queue is not None and not hasattr(message_queue, 'put'):
 raise TypeError('message_queue has to be a Queue or None.')
 
 self.section = section
 self.message_queue = message_queue
 self.timeout = timeout
 
 self.setup_dependencies()
 cp = type(self).check_prerequisites()
 if cp is not True:
 error_string = ('The bear ' + self.name +
 ' does not fulfill all requirements.')
 if cp is not False:
 error_string += ' ' + cp
 
 self.err(error_string)
> raise RuntimeError(error_string)
E RuntimeError: The bear GofmtBear does not fulfill all requirements. 'gofmt' is not installed.
../venv/lib/python3.6/site-packages/coalib/bears/Bear.py:264: RuntimeError
_______________________ AlexBearTest.test_invalid_files ________________________
self = <coalib.testing.LocalBearTestHelper.verify_local_bear.<locals>.LocalBearTest testMethod=test_invalid_files>
 def test_invalid_files(self):
 self.assertIsInstance(invalid_files, (list, tuple))
 for file in invalid_files:
 self.check_validity(self.uut,
 file.splitlines(keepends=True),
 filename,
 valid=False,
 force_linebreaks=force_linebreaks,
 create_tempfile=create_tempfile,
> tempfile_kwargs=tempfile_kwargs)
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:376:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:173: in check_validity
 settings=settings,
../venv/lib/python3.6/site-packages/coalib/testing/LocalBearTestHelper.py:213: in check_invalidity
 self.assertNotEqual(len(bear_output), 0, msg=msg)
E AssertionError: 0 == 0 : The local bear 'AlexBear' yields no result although it should.
=============================== warnings summary ===============================
tests/natural_language/LanguageToolBearTest.py::SkipTest
cannot collect test class 'SkipTest' because it has a __init__ constructor
tests/python/PyromaBearTest.py::PyromaBearTest::test_minimal
/home/bhartiya/venv/lib/python3.6/site-packages/setuptools/dist.py:364: UserWarning: The version specified ('0.0foo') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
"details." % self.metadata.version
-- Docs: http://doc.pytest.org/en/latest/warnings.html
======== 9 failed, 456 passed, 333 skipped, 2 warnings in 92.72 seconds ========
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment