Open Hazhzeng opened 4 years ago
This issue is related to https://github.com/Azure/azure-cli/pull/9784#issuecomment-505541134 cc: @ankitkumarr
@Hazhzeng Thanks for reporting the issue. I will look into details next week after holidays.
Thanks for your feedback.
Sorry for the late reply, we will take a look after Ignite.
@bim-msft add to S161.
@Hazhzeng Sorry for the late reply, I found the reason by debugging into the test code.
This happens when you decoding an invalid bytes into UTF-8 format string. The relevant code is here:
https://github.com/Azure/azure-cli/blob/ea5496bf7ee188da599dd3b009fc63d24967154a/src/azure-cli/azure/cli/command_modules/appservice/custom.py#L373-L378
This zip-content
in line 377 can not be decoded into a valid UTF-8 string.
https://github.com/Azure/azure-cli/blob/ea5496bf7ee188da599dd3b009fc63d24967154a/src/azure-cli-testsdk/azure/cli/testsdk/utilities.py#L52-L59
Finally the call str(byte_or_str, 'utf-8')
in line 57 throws the above described exception.
I have opened a PR to ignore this type of errors in decoding process, and I also uncommented your test function code in this PR, please see #11251 .
Ignoring the error is not necessary. I changed the test type to LiveScenarioTest instead.
@bim-msft thanks for the response, if you need any update from my side, please do let me know :)
@Hazhzeng Hi, I closed the PR so I didn't change anything. If you want to make this test runnable, then you should change ScenarioTest
to LiveScenarioTest
for this test case, which can bypass the recording of test framework. But currently the github CI will skip all live tests, you can just test it locally (set AZURE_TEST_RUN_LIVE=true
).
We plan to support binary recoding for this kind of cases in the future :-)
Describe the bug When implementing an E2E test scenario to upload a zip file to a storage account (using StorageAccountPreparer), the _py3_byte_to_str() function inside testsdk/utilities.py fails to convert byte to string.
This affects the recording in
env\lib\site-packages\azure_devtools\scenario_tests\base.py:157
if the test is decorated by StorageAccountPreparer and the test-covered code contains request to upload zip file.To Reproduce
azure-cli\src\azure-cli\azure\cli\command_modules\appservice\tests\latest\test_webapp_commands.py
azdev test test_functionapp_remote_build
Expected behavior
Environment summary Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (
az --version
) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)Appendix (Error Traceback)