Azure / Azure/azure-cli-dev-tools

azdev test --debug doesn't work

Abierto
#145 0 comentarios 0 reacciones 1 asignado Ver en GitHub

@haroldrandom ya está trabajando en esto.

Desde el 26/3/2020.

Test
Lenguaje dominante
Python
Estrellas
91
Forks
134
Merge medio
2 h 51 min
PR fusionados (30 d)
1

Descripción

--debug doesn't print API call information as expected.

(env) E:\Microsoft\AzureCLI\azure-cli>azdev test test_functionapp_access_restriction_add --live --debug
Command arguments: ['test', 'test_functionapp_access_restriction_add', '--live', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x0000023F4657E8B8>, <function OutputProducer.on_global_arguments at 0x0000023F468E1AF8>, <function CLIQuery.on_global_arguments at 0
x0000023F4690E438>]
Event: CommandInvoker.OnPreCommandTableCreate []
Event: CommandLoader.OnLoadCommandTable []
Event: CommandLoader.OnLoadArguments []
Event: CommandInvoker.OnPostCommandTableCreate []
Event: CommandInvoker.OnCommandTableLoaded []
Event: CommandInvoker.OnPreParseArgs []
Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x0000023F468E1B88>, <function CLIQuery.handle_query_parameter at 0x0000023F4690E4C8>]

=============
| Run Tests |
=============

The tests are set to run against current profile latest.

test index found: C:\Users\zuh\.azdev\env_config\Microsoft\AzureCLI\azure-cli\env\test_index\latest.json

TESTS: test_functionapp_access_restriction_add

RUNNING TESTS LIVE
Running: python -m pytest -p no:warnings --no-print-logs --junit-xml C:\Users\zuh\.azdev\env_config\Microsoft\AzureCLI\azure-cli\env\test_results.xml e:\microsoft\azurecli\azure-cli\src\azure-cli\azure\cli\command_modules\a
ppservice\tests\latest\test_functionapp_access_restriction_commands.py::FunctionAppAccessRestrictionScenarioTest::test_functionapp_access_restriction_add -n auto
==================================================================================================== test session starts =====================================================================================================
platform win32 -- Python 3.7.4, pytest-4.4.2, py-1.8.0, pluggy-0.13.0
rootdir: e:\microsoft\azurecli\azure-cli\src\azure-cli
plugins: forked-1.1.1, xdist-1.30.0
gw0 [1] / gw1 [1] / gw2 [1] / gw3 [1] / gw4 [1] / gw5 [1] / gw6 [1] / gw7 [1]
F                                                                                                                                                                                                                       [100%]
========================================================================================================== FAILURES ==========================================================================================================
______________________________________________________________________ FunctionAppAccessRestrictionScenarioTest.test_functionapp_access_restriction_add ______________________________________________________________________
[gw0] win32 -- Python 3.7.4 E:\Microsoft\AzureCLI\azure-cli\env\Scripts\python.exe

self = <azure.cli.command_modules.appservice.tests.latest.test_functionapp_access_restriction_commands.FunctionAppAccessRestrictionScenarioTest testMethod=test_functionapp_access_restriction_add>
resource_group = 'clitest.rgtnivwr7ja4rqjex4qeptlkahjqwdmj3gsliszba2btnx47dnvjulptec6oj5uzps6', location = 'westus'

    @ResourceGroupPreparer(parameter_name_for_location='location')
    @StorageAccountPreparer()
    def test_functionapp_access_restriction_add(self, resource_group, location):
        self.kwargs.update({
            'app_name': self.create_random_name(prefix='cli-funcapp-nwr', length=24),
            'loc': location
        })
    
        self.cmd('functionapp create -g {rg} -n {app_name} --consumption-plan-location {loc} -s {sa}', checks=[
            JMESPathCheck('state', 'Running')
        ])
    
        self.cmd('functionapp config access-restriction add -g {rg} -n {app_name} --rule-name developers --action Allow --ip-address 130.220.0.0/27 --priority 200', checks=[
            JMESPathCheck('length(@)', 2),
            JMESPathCheck('[0].name', 'developers'),
            JMESPathCheck('[0].action', 'Allow'),
            JMESPathCheck('[1].name', 'Deny all'),
>           JMESPathCheck('[1].action', 'Deny')
        ])

src\azure-cli\azure\cli\command_modules\appservice\tests\latest\test_functionapp_access_restriction_commands.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src\azure-cli-testsdk\azure\cli\testsdk\base.py:161: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
src\azure-cli-testsdk\azure\cli\testsdk\base.py:227: in assert_with_checks
    c(self)
src\azure-cli-testsdk\azure\cli\testsdk\checkers.py:18: in __call__
    json_value = execution_result.get_output_in_json()
src\azure-cli-testsdk\azure\cli\testsdk\base.py:233: in get_output_in_json
    self.json_value = json.loads(self.output)
C:\Users\zuh\AppData\Local\Programs\Python\Python37\lib\json\__init__.py:348: in loads
    return _default_decoder.decode(s)
C:\Users\zuh\AppData\Local\Programs\Python\Python37\lib\json\decoder.py:337: in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x00000241B86725C8>, s = '', idx = 0

    def raw_decode(self, s, idx=0):
        """Decode a JSON document from ``s`` (a ``str`` beginning with
        a JSON document) and return a 2-tuple of the Python
        representation and the index in ``s`` where the document ended.
    
        This can be used to decode a JSON document from a string that may
        have extraneous data at the end.
    
        """
        try:
            obj, end = self.scan_once(s, idx)
        except StopIteration as err:
>           raise JSONDecodeError("Expecting value", s, err.value) from None
E           json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

C:\Users\zuh\AppData\Local\Programs\Python\Python37\lib\json\decoder.py:355: JSONDecodeError
---------------------------------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------------------------------
WARNING: The behavior of this command has been altered by the following extension: storage-preview
WARNING: The behavior of this command has been altered by the following extension: storage-preview
WARNING: Application Insights "cli-funcapp-nwrcpyerwhzl" was created for this Function App. You can visit https://portal.azure.com/#resource/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/clitest.rgtnivwr
7ja4rqjex4qeptlkahjqwdmj3gsliszba2btnx47dnvjulptec6oj5uzps6/providers/microsoft.insights/components/cli-funcapp-nwrcpyerwhzl/overview to view your Application Insights component
This command group is in preview. It may be changed/removed in a future release.
------------------------------------------------------------ generated xml file: C:\Users\zuh\.azdev\env_config\Microsoft\AzureCLI\azure-cli\env\test_results.xml ------------------------------------------------------------
================================================================================================= 1 failed in 113.28 seconds =================================================================================================

 Results
=========

Time: 113.230 sec       Tests: 1        Skipped: None   Failures: 1     Errors: 0

 FAILURES
==========

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.