Scenario tests all failing trying to decode `None` as JSON
See original GitHub issueI’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:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would rather not have this in the tests.
I could add an explicit
-o json
to the scenario tests as a workaround.