question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scenario tests all failing trying to decode `None` as JSON

See original GitHub issue

I’m trying to add to the scenario tests for ACS/AKS, but they all error out for me now. This same setup was working fine previously, so I’m wondering if some underlying library broke, or if any az folks have ideas.


Environment summary

macOS High Sierra 10.13.1, python 3.6.3 installed with brew, azure-cli checked out from GitHub and virtualenv configured as per developer docs. I’m running the HEAD of the dev branch. Here’s one example, but all ScenarioTests fail similarly:

$ run_tests --module acs --test test_aks_commands.AzureKubernetesServiceScenarioTest.test_aks_create_default_service
Run automation
Modules: acs
Drive test by unittest
E
======================================================================
ERROR: test_aks_create_default_service (azure.cli.command_modules.acs.tests.test_aks_commands.AzureKubernetesServiceScenarioTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/matt/Projects/azure-cli/env/lib/python3.6/site-packages/azure_devtools/scenario_tests/preparers.py", line 60, in _preparer_wrapper
    fn(test_class_instance, **kwargs)
  File "/Users/matt/Projects/azure-cli/src/command_modules/azure-cli-acs/azure/cli/command_modules/acs/tests/test_aks_commands.py", line 30, in test_aks_create_default_service
    JMESPathCheck('properties.provisioningState', 'Succeeded')
  File "/Users/matt/Projects/azure-cli/src/azure-cli-testsdk/azure/cli/testsdk/base.py", line 76, in cmd
    return execute(command, expect_failure=expect_failure).assert_with_checks(checks)
  File "/Users/matt/Projects/azure-cli/src/azure-cli-testsdk/azure/cli/testsdk/base.py", line 128, in assert_with_checks
    c(self)
  File "/Users/matt/Projects/azure-cli/src/azure-cli-testsdk/azure/cli/testsdk/checkers.py", line 34, in __call__
    json_value = execution_result.get_output_in_json()
  File "/Users/matt/Projects/azure-cli/src/azure-cli-testsdk/azure/cli/testsdk/base.py", line 134, in get_output_in_json
    self.json_value = json.loads(self.output)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

----------------------------------------------------------------------
Ran 1 test in 12.038s

FAILED (errors=1)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
derekbekoecommented, Nov 15, 2017

I would rather not have this in the tests.

0reactions
mboersmacommented, Nov 15, 2017

I could add an explicit -o json to the scenario tests as a workaround.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Displaying better error message than "No JSON object could ...
This will show you error in the JSON you are trying to decode. Share.
Read more >
Python JSONDecodeError Explanation and Solution | CK
The Python JSONDecodeError indicates there is an issue with how a JSON object is formatted. To fix this error, you should read the...
Read more >
No JSON object could be decoded - StartStopServices.py
I'm trying to run a python scrtipt to stop services, but I'm getting the following error message : "No JSON object could be...
Read more >
json — JSON encoder and decoder — Python 3.11.1 ...
A malicious JSON string may cause the decoder to consume considerable CPU and memory resources. Limiting the size of data to be parsed...
Read more >
Testing HTTP - Artillery.io
If a capture rule fails because nothing matches, any subsequent requests in the scenario will not run, and that virtual user will stop...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found