Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove resources post test #13379

Merged
merged 34 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b65525a
pruning tests.yml
seankane-msft Aug 26, 2020
f2d496c
potential fix
seankane-msft Aug 26, 2020
501e6a5
updated environment variables
seankane-msft Aug 26, 2020
b3a8b8d
another change to tests.yml
seankane-msft Aug 26, 2020
2ba8ce3
change
seankane-msft Aug 26, 2020
68d317f
edits to testcase
seankane-msft Aug 26, 2020
09412a2
setting storage_name and rg_kwargs to None to help identify problem
seankane-msft Aug 27, 2020
767325a
forcing i_need_to_create_rg to be True
seankane-msft Aug 27, 2020
13b9453
flirting with version change
seankane-msft Aug 27, 2020
da5a993
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-pytho…
seankane-msft Aug 27, 2020
1e10147
reverting back to normal for both testcase and version
seankane-msft Aug 27, 2020
cd8ecca
Packaging update of azure-data-tables
AutorestCI Aug 27, 2020
c7265d6
adding azure identity to dev reqs
seankane-msft Aug 28, 2020
f913e14
Merge branch 'remove-resources-post-test' of https://github.com/Azure…
seankane-msft Aug 28, 2020
1041fd3
adding azure-identity to dev_reqs
seankane-msft Aug 28, 2020
5af3cc5
mirror updates from personal branch
scbedd Aug 28, 2020
81d22a7
adding continue on error so we can see the env
scbedd Aug 28, 2020
8cff49e
update shared test case rg_kwargs resource to mapping instead of None…
scbedd Aug 28, 2020
656cabc
updating dev_reqs
seankane-msft Aug 28, 2020
61e20d8
random issues gone?
scbedd Aug 28, 2020
b3ecea3
build-test changes
scbedd Aug 28, 2020
032935f
Merge branch 'remove-resources-post-test' of https://github.com/Azure…
seankane-msft Aug 31, 2020
efb41da
undoing all the bot changes from AutorestCI
seankane-msft Aug 31, 2020
4b39948
edits thanks to Kristas suggestion, hopefully stops AutorestCI from s…
seankane-msft Aug 31, 2020
356252d
import directly from file, python2 can't find the module
seankane-msft Aug 31, 2020
dd64612
pylint fixes
seankane-msft Aug 31, 2020
2f6bf8b
debugging why python 2.7 can't find azure data tables
seankane-msft Sep 1, 2020
3168551
undoing last change
seankane-msft Sep 1, 2020
8c95651
reverting setup.py to master branch, adding space in inits just incase
seankane-msft Sep 1, 2020
d343b96
add comprehension of nspkg to azure-data-tables
scbedd Sep 1, 2020
8bae8fc
adding nspkg to shared_reqs
seankane-msft Sep 1, 2020
2e3bfb0
Merge https://github.com/Azure/azure-sdk-for-python into remove-resou…
seankane-msft Sep 1, 2020
cb2de0d
Merge branch 'remove-resources-post-test' of https://github.com/Azure…
seankane-msft Sep 1, 2020
58c8568
updating shared_req to freeze nspkg at the same version
seankane-msft Sep 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions sdk/tables/azure-data-tables/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
include azure/data/__init__.py
include LICENSE.txt
recursive-include tests *.py
recursive-include samples *.py *.md

302 changes: 12 additions & 290 deletions sdk/tables/azure-data-tables/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/tables/azure-data-tables/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
2 changes: 1 addition & 1 deletion sdk/tables/azure-data-tables/azure/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: str
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
2 changes: 1 addition & 1 deletion sdk/tables/azure-data-tables/dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
../../core/azure-core
cryptography>=2.1.4
aiohttp>=3.0; python_version >= '3.5'

../../identity/azure-identity
8 changes: 8 additions & 0 deletions sdk/tables/azure-data-tables/sdk_packaging.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[packaging]
package_name = "azure-data-tables"
package_nspkg = "azure-data-nspkg"
package_pprint_name = "MyService Management"
package_doc_id = ""
is_stable = false
is_arm = true
need_msrestazure = true
40 changes: 23 additions & 17 deletions sdk/tables/azure-data-tables/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import re
import os.path
from io import open
from setuptools import find_packages, setup # type: ignore
from setuptools import find_packages, setup

# Change the PACKAGE_NAME only to change folder and different name
PACKAGE_NAME = "azure-data-tables"
PACKAGE_PPRINT_NAME = "Azure Data Tables"
PACKAGE_PPRINT_NAME = "MyService Management"
seankane-msft marked this conversation as resolved.
Show resolved Hide resolved

# a-b-c => a/b/c
package_folder_path = PACKAGE_NAME.replace('-', '/')
Expand All @@ -25,7 +25,7 @@
try:
import azure
try:
ver = azure.__version__ # type: ignore
ver = azure.__version__
raise Exception(
'This package is incompatible with azure=={}. '.format(ver) +
'Uninstall it with "pip uninstall azure".'
Expand All @@ -36,25 +36,32 @@
pass

# Version extraction inspired from 'requests'
with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', # type: ignore
with open(os.path.join(package_folder_path, 'version.py')
if os.path.exists(os.path.join(package_folder_path, 'version.py'))
else os.path.join(package_folder_path, '_version.py'), 'r') as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)

if not version:
raise RuntimeError('Cannot find version information')

with open('README.md', encoding='utf-8') as f:
readme = f.read()
with open('CHANGELOG.md', encoding='utf-8') as f:
changelog = f.read()

setup(
name=PACKAGE_NAME,
version=version,
description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME),
long_description='\n\n',
long_description=readme + '\n\n' + changelog,
long_description_content_type='text/markdown',
license='MIT License',
author='Microsoft Corporation',
author_email='ascl@microsoft.com',
url='https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/table/azure-table',
author_email='azpysdkhelp@microsoft.com',
url='https://github.com/Azure/azure-sdk-for-python',
classifiers=[
"Development Status :: 4 - Beta",
'Development Status :: 4 - Beta',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
Expand All @@ -67,18 +74,17 @@
],
zip_safe=False,
packages=find_packages(exclude=[
'tests',
# Exclude packages that will be covered by PEP420 or nspkg
'azure',
'tests',
'azure.data',
]),
install_requires=[
"azure-core<2.0.0,>=1.2.2",
"msrest>=0.6.10"
# azure-data-tables
'msrest>=0.5.0',
seankane-msft marked this conversation as resolved.
Show resolved Hide resolved
'msrestazure>=0.4.32,<2.0.0',
seankane-msft marked this conversation as resolved.
Show resolved Hide resolved
'azure-common~=1.1',
],
extras_require={
":python_version<'3.0'": ['futures'],
":python_version<'3.4'": ['enum34>=1.0.4'],
":python_version<'3.5'": ["typing"]
},
":python_version<'3.0'": ['azure-data-nspkg'],
seankane-msft marked this conversation as resolved.
Show resolved Hide resolved
}
)
14 changes: 9 additions & 5 deletions sdk/tables/azure-data-tables/tests/_shared/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ def storage_account():
i_need_to_create_rg = not (existing_rg_name or existing_storage_name or storage_connection_string)
got_storage_info_from_env = existing_storage_name or storage_connection_string

storage_name = None
rg_kwargs = {}

try:
if i_need_to_create_rg:
rg_name, rg_kwargs = rg_preparer._prepare_create_resource(test_case)
Expand Down Expand Up @@ -431,11 +434,12 @@ def build_service_endpoint(service):
TableTestCase._STORAGE_CONNECTION_STRING = storage_connection_string
yield
finally:
if not got_storage_info_from_env:
storage_preparer.remove_resource(
storage_name,
resource_group=rg
)
if storage_name is not None:
if not got_storage_info_from_env:
storage_preparer.remove_resource(
storage_name,
resource_group=rg
)
finally:
if i_need_to_create_rg:
rg_preparer.remove_resource(rg_name)
Expand Down
27 changes: 5 additions & 22 deletions sdk/tables/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,12 @@ jobs:
parameters:
BuildTargetingString: azure-data-tables
ServiceDirectory: tables
AllocateResourceGroup: 'false'
EnvVars:
STORAGE_ACCOUNT_NAME: $(python-storage-storage-account-name)
STORAGE_ACCOUNT_KEY: $(python-storage-storage-account-key)
STORAGE_DATA_LAKE_ACCOUNT_NAME: $(python-storage-data-lake-account-name)
STORAGE_DATA_LAKE_ACCOUNT_KEY: $(python-storage-data-lake-account-key)
BLOB_STORAGE_ACCOUNT_NAME: $(python-storage-blob-storage-account-name)
BLOB_STORAGE_ACCOUNT_KEY: $(python-storage-blob-storage-account-key)
REMOTE_STORAGE_ACCOUNT_NAME: $(python-storage-remote-storage-account-name)
REMOTE_STORAGE_ACCOUNT_KEY: $(python-storage-remote-storage-account-key)
PREMIUM_STORAGE_ACCOUNT_NAME: $(python-storage-premium-storage-account-name)
PREMIUM_STORAGE_ACCOUNT_KEY: $(python-storage-premium-storage-account-key)
OAUTH_STORAGE_ACCOUNT_NAME: $(python-storage-oauth-storage-account-name)
OAUTH_STORAGE_ACCOUNT_KEY: $(python-storage-oauth-storage-account-key)
ACTIVE_DIRECTORY_APPLICATION_ID: $(aad-azure-sdk-test-client-id)
ACTIVE_DIRECTORY_APPLICATION_SECRET: $(aad-azure-sdk-test-client-secret)
ACTIVE_DIRECTORY_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
CONNECTION_STRING: $(python-storage-blob-connection-string)
BLOB_CONNECTION_STRING: $(python-storage-blob-connection-string)
PREMIUM_CONNECTION_STRING: $(python-storage-premium-connection-string)
TEST_MODE: 'RunLiveNoRecord'
AZURE_SKIP_LIVE_RECORDING: 'True'
AZURE_TEST_RUN_LIVE: 'true'
AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id)
AZURE_SUBSCRIPTION_ID: $(azure-subscription-id)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id)
AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret)
TEST_MODE: 'RunLiveNoRecord'
AZURE_SKIP_LIVE_RECORDING: 'True'
AZURE_TEST_RUN_LIVE: 'true'