Recorded tests and fixed packaging and build

This commit is contained in:
annatisch 2017-10-03 13:38:15 -07:00
Родитель f0082a49d2
Коммит 399341e0b9
22 изменённых файлов: 1574 добавлений и 1711 удалений

60
.gitignore поставляемый
Просмотреть файл

@ -1,7 +1,3 @@
<<<<<<< HEAD
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
=======
# Python cache
__pycache__/
*.pyc
@ -9,6 +5,7 @@ __pycache__/
# Virtual environment
env/
env27/
.azure/
# PTVS analysis
.ptvs/
@ -24,22 +21,13 @@ build/
*.egg-info/
# Test results
TestResults/
test_results/
# Credentials
credentials_real.json
testsettings_local.json
servicebus_settings_real.py
storage_settings_real.py
legacy_mgmt_settings_real.py
mgmt_settings_real.py
app_creds_real.py
>>>>>>> b74a47282b203bc484a07045a987b44bf758e08f
# User-specific files
*.suo
*.user
<<<<<<< HEAD
*.userosscache
*.sln.docstates
@ -286,45 +274,3 @@ paket-files/
# JetBrains Rider
.idea/
*.sln.iml
=======
*.sln.docstates
.vs/
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac desktop service store files
.DS_Store
.idea
src/build
*.iml
/doc/_build
/doc/sphinx/_build
/.vs/config/applicationhost.config
.vscode/settings.json
.vscode/.ropeproject/
.project
.pydevproject
# Azure deployment credentials
*.pubxml
# Auxiliary files
command_coverage.txt
# Test artifacts
private_config.json
scripts/smart_create_gen/config.ini
test_results/
# Code coverage
.coverage
>>>>>>> b74a47282b203bc484a07045a987b44bf758e08f

Просмотреть файл

@ -4,6 +4,8 @@ python:
- '2.7'
- '3.5'
- '3.6'
env:
- AZURE_EXTENSION_DIR=./.azure/devcliextensions
install:
- pip install -qqq virtualenv
- python scripts/dev_setup.py

Просмотреть файл

@ -1,3 +0,0 @@
FROM azuresdk/azure-cli-python:2.0.10
RUN pip install azure-cli-batch-extensions==1.0.0
CMD bash

Просмотреть файл

@ -90,66 +90,11 @@ You can find futher instructions in the `official documentation <https://docs.mi
`Azure CLI GitHub repository <https://github.com/azure/azure-cli>`_.
This extension package can be installed to supplement the existing Azure CLI Batch commands.
It can be installed using the CLI component tools:
It can be installed using the CLI extension tools:
.. code-block:: bash
$ az component update --add batch-extensions --allow-third-party
Depending on how the Azure CLI was installed, the `az component` feature may be disabled. In this
case use one of these OS-specified workarounds.
Windows - CLI installed via MSI
+++++++++++++++++++++++++++++++
This command uses the default install location, and can be adapted as necessary.
If you uninstall the CLI using the MSI, these files will need to be cleaned up manually.
.. code-block:: bash
> C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe -m pip install azure-cli-batch-extensions
MacOS - CLI installed via InstallAzureCLI script (using curl)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This command uses the default install location, and can be adapted as necessary.
.. code-block:: bash
$ /Users/<username>/lib/azure-cli/bin/pip install azure-cli-batch-extensions
Linux - CLI installed via InstallAzureCLI script (using curl)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This command uses the default install location, and can be adapted as necessary.
.. code-block:: bash
$ /home/<username>/lib/azure-cli/bin/pip install azure-cli-batch-extensions
Linux - CLI installed via apt-get
+++++++++++++++++++++++++++++++++
The install location used by apt-get may vary. Use the command :code:`dpkg -L azure-cli` to determine the
install location. If you uninstall the CLI using :code:`apt-get remove`, these files will need to be cleaned up manually.
You can use the command (adjusted according to install location) :code:`rm -r /opt/az` to remove them.
.. code-block:: bash
$ sudo /opt/az/bin/python3 -m pip install azure-cli-batch-extensions
Docker (any OS)
+++++++++++++++
The Dockerfile `here <https://github.com/Azure/azure-batch-cli-extensions/blob/master/Dockerfile>`_ can
be used to run the extended CLI on any machine with Docker installed.
Download the Dockerfile to a location of choice, in a directory called 'batch-extensions', then run the
following commands to build and run the image.
.. code-block:: bash
$ docker build -t batch-cli <download-location>/batch-extensions/
$ docker run -it batch-cli
$ az extension add --source [URL to latest release package]
Azure Batch account requirements

Просмотреть файл

@ -11,8 +11,10 @@
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
<LaunchProvider>Standard Python launcher</LaunchProvider>
<InterpreterId>{305dc1c7-e94b-442f-9516-643a6718b3eb}</InterpreterId>
<InterpreterVersion>3.5</InterpreterVersion>
<InterpreterId>
</InterpreterId>
<InterpreterVersion>
</InterpreterVersion>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<CommandLineArguments>
</CommandLineArguments>
@ -156,9 +158,13 @@
<Folder Include="scripts\license\" />
<Folder Include="tests\data\" />
<Folder Include="tests\" />
<Folder Include="tests\recordings\" />
</ItemGroup>
<ItemGroup>
<Content Include=".travis.yml" />
<Content Include="batch-cli-extensions\azext_batch\azext_metadata.json">
<SubType>Code</SubType>
</Content>
<Content Include="batch-cli-extensions\HISTORY.rst" />
<Content Include="batch-cli-extensions\MANIFEST.in" />
<Content Include="batch-cli-extensions\README.rst" />
@ -243,19 +249,8 @@
<Content Include="tests\data\batch.pool.parameters.json" />
<Content Include="tests\data\batch.pool.simple.json" />
<Content Include="MANIFEST.in" />
</ItemGroup>
<ItemGroup>
<Interpreter Include="env\">
<Id>{305dc1c7-e94b-442f-9516-643a6718b3eb}</Id>
<BaseInterpreter>{9a7a9026-48c1-4688-9d5d-e5699d47d074}</BaseInterpreter>
<Version>3.5</Version>
<Description>env (Python 64-bit 3.5)</Description>
<InterpreterPath>Scripts\python.exe</InterpreterPath>
<WindowsInterpreterPath>Scripts\pythonw.exe</WindowsInterpreterPath>
<LibraryPath>Lib\</LibraryPath>
<PathEnvironmentVariable>PYTHONPATH</PathEnvironmentVariable>
<Architecture>Amd64</Architecture>
</Interpreter>
<Content Include="tests\recordings\test_batch_extensions_live.yaml" />
<Content Include="tests\recordings\test_batch_upload_live.yaml" />
</ItemGroup>
<Import Project="$(PtvsTargetsFile)" Condition="Exists($(PtvsTargetsFile))" />
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="!Exists($(PtvsTargetsFile))" />

Просмотреть файл

@ -125,12 +125,13 @@ class ExtendedJobOperations(JobOperations):
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: :class:`TaskAddCollectionResult
<azure.batch.models.TaskAddCollectionResult>` if task_factory used otherwise
None
:return: :class:`TaskAddCollectionResult
<azure.batch.models.TaskAddCollectionResult>` if task_factory used otherwise
None
<azure.batch.models.TaskAddCollectionResult>` if using TaskFactory or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if
raw=true, otherwise None
:rtype: None or :class:`TaskAddCollectionResult
<azure.batch.models.TaskAddCollectionResult>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
:raises:
:class:`BatchErrorException<azure.batch.models.BatchErrorException>`
"""

Просмотреть файл

@ -3,4 +3,4 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
VERSION = "0.2.0"
VERSION = "1.0.0"

Просмотреть файл

@ -3,6 +3,13 @@
Release History
===============
2.0.0 (unreleased)
------------------
* Restructured to support new CLI extensions framework
* Support for Azure Batch SDK 4.0 and Batch Extensions SDK 1.0
1.0.0 (2017-07-31)
------------------

Просмотреть файл

@ -78,11 +78,11 @@ You can find futher instructions in the `official documentation <https://docs.mi
`Azure CLI GitHub repository <https://github.com/azure/azure-cli>`_.
This extension package can be installed to supplement the existing Azure CLI Batch commands.
It can be installed using the CLI component tools:
It can be installed using the CLI extension tools:
.. code-block:: bash
$ az component update --add batch-extensions --allow-third-party
$ az extension add --source [URL to latest release package]
Azure Batch account requirements

Просмотреть файл

@ -0,0 +1,4 @@
{
"azext.minCliCoreVersion": "2.0.17",
"azext.maxCliCoreVersion": "2.0.18"
}

Просмотреть файл

@ -11,15 +11,16 @@ import azure.cli.core.azlogging as azlogging
from azure.batch import __version__ as batch_version
from azure.mgmt.batch import __version__ as batch_mgmt_version
#from azure.cli.batch import __version__ as batch_cli_version
from azure.batch_extensions import __version__ as batch_ext_version
from azext_batch._client_factory import (
batch_extensions_client)
logger = azlogging.get_az_logger(__name__)
SUPPORTED_CORE_VERSION = "2.1"
SUPPORTED_BATCH_VERSION = "3.2"
SUPPORTED_BATCH_VERSION = "4.1"
SUPPORTED_BMGMT_VERSION = "4.2"
SUPPORTED_BATCH_EXT_VERSION = "1.1"
def confirm_version(current, supported, package):
@ -28,12 +29,11 @@ def confirm_version(current, supported, package):
"%s up to version %s. The current version %s has not been "
"tested for compatibility.", package, supported, current)
confirm_version(core_version, SUPPORTED_CORE_VERSION, "Azure CLI Core")
confirm_version(batch_version, SUPPORTED_BATCH_VERSION, "Azure Batch")
confirm_version(batch_mgmt_version, SUPPORTED_BMGMT_VERSION, "Azure Batch Management")
#confirm_version(batch_cli_version, SUPPORTED_CORE_VERSION, "Azure Batch CLI")
confirm_version(batch_ext_version, SUPPORTED_BATCH_EXT_VERSION, "Azure Batch Extensions")
custom_path = 'azure.cli.command_modules.batch_extensions.custom#{}'
custom_path = 'azext_batch.custom#{}'
# pylint: disable=line-too-long
# NCJ Commands

Просмотреть файл

@ -3,4 +3,4 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
VERSION = "1.0.0"
VERSION = "2.0.0"

Просмотреть файл

@ -7,9 +7,9 @@
import os
from codecs import open
from setuptools import setup
from setuptools import setup, find_packages
VERSION = '1.0.0'
VERSION = '2.0.0'
# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
@ -27,19 +27,7 @@ CLASSIFIERS = [
'License :: OSI Approved :: MIT License',
]
DEPENDENCIES = [
'msrestazure>=0.4.11,<1',
'azure-batch>=3.1,<4',
'azure-mgmt-batch>=4.0,<5',
'azure-cli-core',
'azure-cli-batch',
'azure-storage>=0.34,<0.35',
'azure-mgmt-storage>=1.0,<2',
'azure-batch-extensions>=0.2,<1'
]
DEPENDENCIES_27 = {
":python_version<'3.4'": ['pathlib>=1.0.1']
}
DEPENDENCIES = []
with open('README.rst', 'r', encoding='utf-8') as f:
README = f.read()
@ -47,23 +35,16 @@ with open('HISTORY.rst', 'r', encoding='utf-8') as f:
HISTORY = f.read()
setup(
name='azure-cli-batch-extensions',
name='azure-batch-cli-extensions',
version=VERSION,
description='Microsoft Azure Command-Line Tools Extended Batch Command Module',
long_description=README + '\n\n' + HISTORY,
license='MIT',
author='Microsoft Corporation',
author_email='askwabatch@microsoft.com',
author_email='azpycli@microsoft.com',
url='https://github.com/Azure/azure-batch-cli-extensions',
classifiers=CLASSIFIERS,
namespace_packages=[
'azure',
'azure.cli',
'azure.cli.command_modules'
],
packages=[
'azure.cli.command_modules.batch_extensions'
],
install_requires=DEPENDENCIES,
extras_require=DEPENDENCIES_27,
)
package_data={'azext_batch': ['azext_metadata.json']},
packages=find_packages(),
install_requires=DEPENDENCIES
)

Просмотреть файл

@ -47,6 +47,7 @@ def set_version(path_to_setup):
line = line.replace('azure-batch-extensions>=0.1,<1', 'azure-batch-extensions==1000.0.0')
sys.stdout.write(line)
def reset_version(path_to_setup):
"""
Revert package to original version no. for PyPI package and deploy.
@ -65,8 +66,9 @@ def build_package(path_to_package, dist_dir):
if not cmd_success:
print_heading('Error building {}!'.format(path_to_package), f=sys.stderr)
sys.exit(1)
print_heading('Built {}'.format(path_to_package))
reset_version(path_to_setup)
print('reset setup version')
print_heading('Built {}'.format(path_to_package))
def install_pip_package(package_name):
@ -78,6 +80,7 @@ def install_pip_package(package_name):
sys.exit(1)
print_heading('Installed {}'.format(package_name))
def install_package(path_to_package, package_name, dist_dir):
egg_path = os.path.join(path_to_package, '{}.egg-info'.format(package_name.replace('-', '_')))
print("deleting {}".format(egg_path))
@ -112,23 +115,34 @@ def verify_packages():
for name, path in all_modules:
build_package(path, built_packages_dir)
# Revert version
# Install the remaining command modules
for name, fullpath in all_modules:
install_package(fullpath, name, built_packages_dir)
# STEP 3:: Install Batch Extensions and validate
install_package(all_modules[0][1], all_modules[0][0], built_packages_dir)
try:
importlib.import_module('azure.batch_extensions')
except ImportError as err:
print("Unable to import {}".format(name))
print(err)
sys.exit(1)
# STEP 3:: Validate the installation
for name in ['azure.batch_extensions', 'azure.cli.command_modules.batch_extensions']:
try:
importlib.import_module(name)
except ImportError as err:
print("Unable to import {}".format(name))
print(err)
sys.exit(1)
# STEP 4:: Add CLI extension wheel to CLI
try:
extension_whl = os.path.join(built_packages_dir, 'azure_batch_cli_extensions-1000.0.0-py2.py3-none-any.whl')
az_output = subprocess.check_output(['az', 'extension', 'add', '--source', extension_whl, '--debug'], stderr=subprocess.STDOUT,
universal_newlines=True)
success = 'Successfully installed azure-batch-cli-extensions-1000.0.0' in az_output
print(az_output, file=sys.stderr)
except subprocess.CalledProcessError as err:
success = False
print(err, file=sys.stderr)
# STEP 5:: Verify extension loading correctly
try:
az_output = subprocess.check_output(['az', '--debug'], stderr=subprocess.STDOUT,
universal_newlines=True)
success = 'Error loading command module' not in az_output
if success:
success = 'Loaded extension \'azure-batch-cli-extensions\'' in az_output
print(az_output, file=sys.stderr)
except subprocess.CalledProcessError as err:
success = False
@ -145,7 +159,7 @@ def verify_packages():
print('Installed command modules', installed_modules)
missing_modules = \
set([name for name, fullpath in all_modules]) - set(installed_modules)
set([all_modules[0][0]]) - set(installed_modules)
if missing_modules:
print_heading('Error: The following modules were not installed successfully', f=sys.stderr)

Просмотреть файл

@ -28,9 +28,10 @@ def get_command_modules_paths(include_prefix=False):
modules = []
name = 'batch-extensions'
sdk_name = 'azure-' + name if include_prefix else name
modules.append((sdk_name, os.path.join(root, name)))
modules.append((sdk_name, root))
cli_name = COMMAND_MODULE_PREFIX + name if include_prefix else name
name = 'batch-cli-extensions'
cli_name = 'azure-' + name if include_prefix else name
modules.append((cli_name, os.path.join(root, 'batch-cli-extensions')))
return modules

Просмотреть файл

@ -11,6 +11,8 @@ scripts_root=$(cd $(dirname $0); pwd)
export PYTHONPATH=$PATHONPATH:./src
python -m azure.cli -h --debug
python -m azure.cli batch -h --debug
python -m azure.cli batch job create -h --debug
# PyLint crashes on Python 3.6
LOCAL_PYTHON_VERSION=$(python -c 'import sys; print("{0}.{1}".format(sys.version_info[0], sys.version_info[1]))')

Просмотреть файл

@ -11,7 +11,6 @@ import sys
import os
from subprocess import check_call, CalledProcessError
modules = ['batch-extensions', 'batch-cli-extensions']
root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..'))
@ -25,6 +24,7 @@ def exec_command(command):
sys.exit(1)
print('Running dev setup...')
print(os.environ)
print('Root directory \'{}\'\n'.format(root_dir))
# install general requirements and azure-cli
@ -33,8 +33,8 @@ exec_command('pip install -r requirements.txt')
# install automation package
exec_command('pip install -e ./scripts')
for m in modules:
# install reference to extension module package
exec_command('pip install -e {}'.format(os.path.join(root_dir, m)))
# install reference to extension module package
exec_command('pip install -e {}'.format(root_dir))
exec_command('pip install --upgrade --target ./.azure/devcliextensions/azure-batch-cli-extensions {0}/batch-cli-extensions'.format(root_dir))
print('Finished dev setup.')

Просмотреть файл

@ -31,7 +31,7 @@ DEPENDENCIES = [
'msrestazure>=0.4.14,<1',
'azure-batch>=4.0,<5',
'azure-mgmt-batch>=4.0,<5',
'azure-storage>=0.34,<0.35',
'azure-storage>=0.32,<0.35',
'azure-mgmt-storage>=1.0,<2'
]
DEPENDENCIES_27 = {
@ -51,7 +51,7 @@ setup(
long_description=README + '\n\n' + HISTORY,
license='MIT',
author='Microsoft Corporation',
author_email='azpysdkhelp@microsoft.com',
author_email='azpycli@microsoft.com',
url='https://github.com/Azure/azure-batch-cli-extensions',
classifiers=CLASSIFIERS,
namespace_packages=[

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -6,28 +6,28 @@ interactions:
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.2 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.11
msrest_azure/0.4.11 batchmanagementclient/4.0.0 Azure-SDK-For-Python]
User-Agent: [python/3.6.1 (Windows-10-10.0.15063-SP0) requests/2.9.1 msrest/0.4.14
msrest_azure/0.4.14 batchmanagementclient/4.1.0 Azure-SDK-For-Python]
accept-language: [en-US]
x-ms-client-request-id: [5cafde40-74ed-11e7-847c-54ee750f2fc7]
x-ms-client-request-id: [a4c61314-a55b-11e7-9cd1-ecb1d755839a]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Batch/batchAccounts/test1?api-version=2017-05-01
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Batch/batchAccounts/test1","name":"test1","type":"Microsoft.Batch/batchAccounts","location":"westus","properties":{"accountEndpoint":"test1.westus.batch.azure.com","provisioningState":"Succeeded","dedicatedCoreQuota":800,"lowPriorityCoreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Storage/storageAccounts/testaccountforbatch","lastKeySync":"2017-07-22T22:41:15.9792828Z"},"poolAllocationMode":"batchservice"},"tags":{"Value":"tagValue","test":"test1","Name":"tagName"}}'}
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Batch/batchAccounts/test1","name":"test1","type":"Microsoft.Batch/batchAccounts","location":"westus","properties":{"accountEndpoint":"test1.westus.batch.azure.com","provisioningState":"Succeeded","dedicatedCoreQuota":20,"lowPriorityCoreQuota":50,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Storage/storageAccounts/batchtest1","lastKeySync":"2017-07-22T23:00:06.9397085Z"},"poolAllocationMode":"batchservice"},"tags":{"Name":"tagName","Value":"tagValue"}}'}
headers:
Cache-Control: [no-cache]
Content-Type: [application/json; charset=utf-8]
Date: ['Sun, 30 Jul 2017 06:07:25 GMT']
ETag: ['"0x8D4D152C346A4BC"']
Date: ['Fri, 29 Sep 2017 21:17:49 GMT']
ETag: ['"0x8D4D1556561825D"']
Expires: ['-1']
Last-Modified: ['Sat, 22 Jul 2017 22:41:15 GMT']
Last-Modified: ['Sat, 22 Jul 2017 23:00:06 GMT']
Pragma: [no-cache]
Server: [Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Transfer-Encoding: [chunked]
Vary: [Accept-Encoding]
X-Content-Type-Options: [nosniff]
content-length: ['772']
content-length: ['761']
status: {code: 200, message: OK}
- request:
body: null
@ -37,18 +37,18 @@ interactions:
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.2 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.11
msrest_azure/0.4.11 storagemanagementclient/1.1.0 Azure-SDK-For-Python]
User-Agent: [python/3.6.1 (Windows-10-10.0.15063-SP0) requests/2.9.1 msrest/0.4.14
msrest_azure/0.4.14 storagemanagementclient/1.2.0 Azure-SDK-For-Python]
accept-language: [en-US]
x-ms-client-request-id: [5df9a63a-74ed-11e7-b083-54ee750f2fc7]
x-ms-client-request-id: [a59b4f9c-a55b-11e7-a5d0-ecb1d755839a]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Storage/storageAccounts/testaccountforbatch/listKeys?api-version=2017-06-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Storage/storageAccounts/batchtest1/listKeys?api-version=2017-06-01
response:
body: {string: '{"keys":[{"keyName":"key1","permissions":"Full","value":"abc=="},{"keyName":"key2","permissions":"Full","value":"xyz=="}]}'}
headers:
Cache-Control: [no-cache]
Content-Type: [application/json]
Date: ['Sun, 30 Jul 2017 06:07:25 GMT']
Date: ['Fri, 29 Sep 2017 21:17:50 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -56,27 +56,27 @@ interactions:
Transfer-Encoding: [chunked]
Vary: [Accept-Encoding]
content-length: ['289']
x-ms-ratelimit-remaining-subscription-writes: ['1198']
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: null
headers:
Connection: [keep-alive]
Content-Length: ['0']
User-Agent: [Azure-Storage/0.34.3 (Python CPython 3.5.2; Windows 8.1)]
x-ms-client-request-id: [5e324a6e-74ed-11e7-9cd7-54ee750f2fc7]
x-ms-date: ['Sun, 30 Jul 2017 06:07:29 GMT']
User-Agent: [Azure-Storage/0.34.0 (Python CPython 3.6.1; Windows 10)]
x-ms-client-request-id: [a61a7ff6-a55b-11e7-b360-ecb1d755839a]
x-ms-date: ['Fri, 29 Sep 2017 21:17:50 GMT']
x-ms-version: ['2016-05-31']
method: PUT
uri: https://testaccountforbatch.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests?restype=container
uri: https://batchtest1.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests?restype=container
response:
body: {string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ContainerAlreadyExists</Code><Message>The\
\ specified container already exists.\nRequestId:97a382f0-0001-0124-20fa-0865ff000000\n\
Time:2017-07-30T06:07:26.8130286Z</Message></Error>"}
\ specified container already exists.\nRequestId:96e53d8d-001e-0012-7168-3992dc000000\n\
Time:2017-09-29T21:17:51.1443037Z</Message></Error>"}
headers:
Content-Length: ['230']
Content-Type: [application/xml]
Date: ['Sun, 30 Jul 2017 06:07:26 GMT']
Date: ['Fri, 29 Sep 2017 21:17:50 GMT']
Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
x-ms-version: ['2016-05-31']
status: {code: 409, message: The specified container already exists.}
@ -84,20 +84,20 @@ interactions:
body: null
headers:
Connection: [keep-alive]
User-Agent: [Azure-Storage/0.34.3 (Python CPython 3.5.2; Windows 8.1)]
x-ms-client-request-id: [5e615206-74ed-11e7-abfc-54ee750f2fc7]
x-ms-date: ['Sun, 30 Jul 2017 06:07:29 GMT']
User-Agent: [Azure-Storage/0.34.0 (Python CPython 3.6.1; Windows 10)]
x-ms-client-request-id: [a694cbc0-a55b-11e7-8fc8-ecb1d755839a]
x-ms-date: ['Fri, 29 Sep 2017 21:17:51 GMT']
x-ms-version: ['2016-05-31']
method: GET
uri: https://testaccountforbatch.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests/foo.txt?comp=metadata
uri: https://batchtest1.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests/foo.txt?comp=metadata
response:
body: {string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>BlobNotFound</Code><Message>The\
\ specified blob does not exist.\nRequestId:97a382f8-0001-0124-25fa-0865ff000000\n\
Time:2017-07-30T06:07:26.8570707Z</Message></Error>"}
\ specified blob does not exist.\nRequestId:96e53da4-001e-0012-0368-3992dc000000\n\
Time:2017-09-29T21:17:51.3434456Z</Message></Error>"}
headers:
Content-Length: ['215']
Content-Type: [application/xml]
Date: ['Sun, 30 Jul 2017 06:07:26 GMT']
Date: ['Fri, 29 Sep 2017 21:17:51 GMT']
Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
x-ms-version: ['2016-05-31']
status: {code: 404, message: The specified blob does not exist.}
@ -107,21 +107,21 @@ interactions:
Connection: [keep-alive]
Content-Length: ['1']
Content-MD5: [xMpCOKC5I4INzFCab3WEmw==]
User-Agent: [Azure-Storage/0.34.3 (Python CPython 3.5.2; Windows 8.1)]
User-Agent: [Azure-Storage/0.34.0 (Python CPython 3.6.1; Windows 10)]
x-ms-blob-type: [BlockBlob]
x-ms-client-request-id: [5e67459e-74ed-11e7-9400-54ee750f2fc7]
x-ms-date: ['Sun, 30 Jul 2017 06:07:29 GMT']
x-ms-meta-lastmodified: ['1490100978.0']
x-ms-client-request-id: [a6b33c64-a55b-11e7-bbc4-ecb1d755839a]
x-ms-date: ['Fri, 29 Sep 2017 21:17:51 GMT']
x-ms-meta-lastmodified: ['1490129895.872718']
x-ms-version: ['2016-05-31']
method: PUT
uri: https://testaccountforbatch.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests/foo.txt
uri: https://batchtest1.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests/foo.txt
response:
body: {string: ''}
headers:
Content-MD5: [xMpCOKC5I4INzFCab3WEmw==]
Date: ['Sun, 30 Jul 2017 06:07:26 GMT']
ETag: ['"0x8D4D71140D3F419"']
Last-Modified: ['Sun, 30 Jul 2017 06:07:26 GMT']
Date: ['Fri, 29 Sep 2017 21:17:51 GMT']
ETag: ['"0x8D5077F8B4C6D2B"']
Last-Modified: ['Fri, 29 Sep 2017 21:17:52 GMT']
Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
Transfer-Encoding: [chunked]
x-ms-request-server-encrypted: ['false']
@ -134,28 +134,28 @@ interactions:
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.2 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.11
msrest_azure/0.4.11 batchmanagementclient/4.0.0 Azure-SDK-For-Python]
User-Agent: [python/3.6.1 (Windows-10-10.0.15063-SP0) requests/2.9.1 msrest/0.4.14
msrest_azure/0.4.14 batchmanagementclient/4.1.0 Azure-SDK-For-Python]
accept-language: [en-US]
x-ms-client-request-id: [5e7671de-74ed-11e7-bd13-54ee750f2fc7]
x-ms-client-request-id: [a6d68fba-a55b-11e7-95af-ecb1d755839a]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Batch/batchAccounts/test1?api-version=2017-05-01
response:
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Batch/batchAccounts/test1","name":"test1","type":"Microsoft.Batch/batchAccounts","location":"westus","properties":{"accountEndpoint":"test1.westus.batch.azure.com","provisioningState":"Succeeded","dedicatedCoreQuota":800,"lowPriorityCoreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Storage/storageAccounts/testaccountforbatch","lastKeySync":"2017-07-22T22:41:15.9792828Z"},"poolAllocationMode":"batchservice"},"tags":{"Value":"tagValue","test":"test1","Name":"tagName"}}'}
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Batch/batchAccounts/test1","name":"test1","type":"Microsoft.Batch/batchAccounts","location":"westus","properties":{"accountEndpoint":"test1.westus.batch.azure.com","provisioningState":"Succeeded","dedicatedCoreQuota":20,"lowPriorityCoreQuota":50,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Storage/storageAccounts/batchtest1","lastKeySync":"2017-07-22T23:00:06.9397085Z"},"poolAllocationMode":"batchservice"},"tags":{"Name":"tagName","Value":"tagValue"}}'}
headers:
Cache-Control: [no-cache]
Content-Type: [application/json; charset=utf-8]
Date: ['Sun, 30 Jul 2017 06:07:26 GMT']
ETag: ['"0x8D4D152C346A4BC"']
Date: ['Fri, 29 Sep 2017 21:17:52 GMT']
ETag: ['"0x8D4D1556561825D"']
Expires: ['-1']
Last-Modified: ['Sat, 22 Jul 2017 22:41:15 GMT']
Last-Modified: ['Sat, 22 Jul 2017 23:00:06 GMT']
Pragma: [no-cache]
Server: [Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Transfer-Encoding: [chunked]
Vary: [Accept-Encoding]
X-Content-Type-Options: [nosniff]
content-length: ['772']
content-length: ['761']
status: {code: 200, message: OK}
- request:
body: null
@ -165,18 +165,18 @@ interactions:
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.2 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.11
msrest_azure/0.4.11 storagemanagementclient/1.1.0 Azure-SDK-For-Python]
User-Agent: [python/3.6.1 (Windows-10-10.0.15063-SP0) requests/2.9.1 msrest/0.4.14
msrest_azure/0.4.14 storagemanagementclient/1.2.0 Azure-SDK-For-Python]
accept-language: [en-US]
x-ms-client-request-id: [5eb25dee-74ed-11e7-9915-54ee750f2fc7]
x-ms-client-request-id: [a782c0d2-a55b-11e7-9903-ecb1d755839a]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Storage/storageAccounts/testaccountforbatch/listKeys?api-version=2017-06-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_rg/providers/Microsoft.Storage/storageAccounts/batchtest1/listKeys?api-version=2017-06-01
response:
body: {string: '{"keys":[{"keyName":"key1","permissions":"Full","value":"abc=="},{"keyName":"key2","permissions":"Full","value":"xyz=="}]}'}
headers:
Cache-Control: [no-cache]
Content-Type: [application/json]
Date: ['Sun, 30 Jul 2017 06:07:27 GMT']
Date: ['Fri, 29 Sep 2017 21:17:52 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
@ -184,27 +184,27 @@ interactions:
Transfer-Encoding: [chunked]
Vary: [Accept-Encoding]
content-length: ['289']
x-ms-ratelimit-remaining-subscription-writes: ['1197']
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
body: null
headers:
Connection: [keep-alive]
Content-Length: ['0']
User-Agent: [Azure-Storage/0.34.3 (Python CPython 3.5.2; Windows 8.1)]
x-ms-client-request-id: [5f0aae68-74ed-11e7-bed3-54ee750f2fc7]
x-ms-date: ['Sun, 30 Jul 2017 06:07:30 GMT']
User-Agent: [Azure-Storage/0.34.0 (Python CPython 3.6.1; Windows 10)]
x-ms-client-request-id: [a7b10f40-a55b-11e7-b17e-ecb1d755839a]
x-ms-date: ['Fri, 29 Sep 2017 21:17:53 GMT']
x-ms-version: ['2016-05-31']
method: PUT
uri: https://testaccountforbatch.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests?restype=container
uri: https://batchtest1.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests?restype=container
response:
body: {string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>ContainerAlreadyExists</Code><Message>The\
\ specified container already exists.\nRequestId:d8d13ac8-0001-007c-3ffa-0827d1000000\n\
Time:2017-07-30T06:07:29.3680985Z</Message></Error>"}
\ specified container already exists.\nRequestId:f3a32ec0-001e-005f-7768-39543e000000\n\
Time:2017-09-29T21:17:53.6939273Z</Message></Error>"}
headers:
Content-Length: ['230']
Content-Type: [application/xml]
Date: ['Sun, 30 Jul 2017 06:07:29 GMT']
Date: ['Fri, 29 Sep 2017 21:17:53 GMT']
Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
x-ms-version: ['2016-05-31']
status: {code: 409, message: The specified container already exists.}
@ -212,20 +212,20 @@ interactions:
body: null
headers:
Connection: [keep-alive]
User-Agent: [Azure-Storage/0.34.3 (Python CPython 3.5.2; Windows 8.1)]
x-ms-client-request-id: [5f2c8ea8-74ed-11e7-afcd-54ee750f2fc7]
x-ms-date: ['Sun, 30 Jul 2017 06:07:31 GMT']
User-Agent: [Azure-Storage/0.34.0 (Python CPython 3.6.1; Windows 10)]
x-ms-client-request-id: [a82b9b64-a55b-11e7-9188-ecb1d755839a]
x-ms-date: ['Fri, 29 Sep 2017 21:17:54 GMT']
x-ms-version: ['2016-05-31']
method: GET
uri: https://testaccountforbatch.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests/test/data/foo.txt?comp=metadata
uri: https://batchtest1.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests/test/data/foo.txt?comp=metadata
response:
body: {string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>BlobNotFound</Code><Message>The\
\ specified blob does not exist.\nRequestId:d8d13ad8-0001-007c-4cfa-0827d1000000\n\
Time:2017-07-30T06:07:29.4261565Z</Message></Error>"}
\ specified blob does not exist.\nRequestId:f3a32ede-001e-005f-1068-39543e000000\n\
Time:2017-09-29T21:17:53.8960714Z</Message></Error>"}
headers:
Content-Length: ['215']
Content-Type: [application/xml]
Date: ['Sun, 30 Jul 2017 06:07:29 GMT']
Date: ['Fri, 29 Sep 2017 21:17:53 GMT']
Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
x-ms-version: ['2016-05-31']
status: {code: 404, message: The specified blob does not exist.}
@ -235,21 +235,21 @@ interactions:
Connection: [keep-alive]
Content-Length: ['1']
Content-MD5: [xMpCOKC5I4INzFCab3WEmw==]
User-Agent: [Azure-Storage/0.34.3 (Python CPython 3.5.2; Windows 8.1)]
User-Agent: [Azure-Storage/0.34.0 (Python CPython 3.6.1; Windows 10)]
x-ms-blob-type: [BlockBlob]
x-ms-client-request-id: [5f561048-74ed-11e7-9767-54ee750f2fc7]
x-ms-date: ['Sun, 30 Jul 2017 06:07:31 GMT']
x-ms-meta-lastmodified: ['1490100978.0']
x-ms-client-request-id: [a84a6dd8-a55b-11e7-8328-ecb1d755839a]
x-ms-date: ['Fri, 29 Sep 2017 21:17:54 GMT']
x-ms-meta-lastmodified: ['1490129895.872718']
x-ms-version: ['2016-05-31']
method: PUT
uri: https://testaccountforbatch.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests/test/data/foo.txt
uri: https://batchtest1.blob.core.windows.net/fgrp-cli-batch-extensions-live-tests/test/data/foo.txt
response:
body: {string: ''}
headers:
Content-MD5: [xMpCOKC5I4INzFCab3WEmw==]
Date: ['Sun, 30 Jul 2017 06:07:29 GMT']
ETag: ['"0x8D4D71141C31FEE"']
Last-Modified: ['Sun, 30 Jul 2017 06:07:28 GMT']
Date: ['Fri, 29 Sep 2017 21:17:53 GMT']
ETag: ['"0x8D5077F8CE3FC7D"']
Last-Modified: ['Fri, 29 Sep 2017 21:17:54 GMT']
Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
Transfer-Encoding: [chunked]
x-ms-request-server-encrypted: ['false']

Просмотреть файл

@ -85,7 +85,7 @@ class TestBatchExtensionsLive(VCRTestBase):
storage_account,
self.output_blob_container,
sas_token)
self.output_container_sas = 'https://pythonsdkteststorage.blob.core.windows.net:443/aaatestcontainer?sv=2015-04-05&sr=c&sig=ATi60Em20tc2KTXRl4E5Tl2wrjM1I2roHs1BnZS4JXM%3D&se=2018-12-31T17%3A43%3A53Z&sp=rwdl'
self.output_container_sas = 'https://testaccountforbatch.blob.core.windows.net:443/aaatestcontainer'
print('Full container sas: {}'.format(self.output_container_sas))
def cmd(self, command, checks=None, allowed_exceptions=None,

Просмотреть файл

@ -441,7 +441,6 @@ class VCRTestBase(unittest.TestCase): # pylint: disable=too-many-instance-attri
def execute(self):
''' Method to actually start execution of the test. Must be called from the test_<name>
method of the test class. '''
self.skipTest("pending")
try:
if self.run_live:
print('RUN LIVE: {}'.format(self.test_name))