Universum icon indicating copy to clipboard operation
Universum copied to clipboard

Static Analysis' diff is not called

Open a-osipov-toxa opened this issue 6 years ago • 0 comments

Description

As far as I understand, the Static Analysis's "diff" action is not called for the following config:

import os
from distutils.spawn import find_executable

from _universum.configuration_support import Variations, get_project_root

# Pylint check #
check = Variations([
    dict(name="Run",
         critical=True)
])
configs = check * Variations([
    dict(name=" first step",
         command=["echo", "test"]),
    dict(name=" second step for Static Analizer",
         code_report=True,
         command=["echo", "test"]),

])

Steps to reproduce

  • Prepare the config file as mentioned above
  • Run the command: universum --clean-build --vcs-type none -lo console --file-source-dir ./test_project/ --launcher-config-path ./universum_config.py

Expected result

The "NotImplementedError" exception must be raised

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/_universum/lib/utils.py", line 178, in excepted_function
    func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/_universum/main.py", line 80, in execute
    repo_diff = self.vcs.revert_repository()
  File "/usr/local/lib/python2.7/dist-packages/_universum/lib/utils.py", line 201, in function_in_block
    return self.structure.run_in_block(func, block_name, pass_errors, self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/_universum/modules/structure_handler.py", line 131, in run_in_block
    result = operation(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/_universum/modules/vcs/vcs.py", line 130, in revert_repository
    diff = self.driver.copy_cl_files_and_revert()
  File "/usr/local/lib/python2.7/dist-packages/_universum/modules/vcs/base_vcs.py", line 61, in copy_cl_files_and_revert
    raise NotImplementedError

Actual result

There are not any errors

Environment

  • OS: Ubuntu 14.04
  • Python version 2.7.6
  • Universum version 0.17.0

Additional context

This exception should be raised because "diff" action for "--vcs-type none" is not yet implemented for Static Analysis module. And "--no-diff" command line argument was not used for suppress diff action. Additionally, you can modify (remove first step) the previous config and obtain the target exception

Modified config:

check = Variations([
    dict(name="Run",
         critical=True)
])
configs = check * Variations([
    dict(name=" second step for Static Analizer",
         code_report=True,
         command=["echo", "test"]),
])

a-osipov-toxa avatar Apr 03 '19 17:04 a-osipov-toxa