Addresses #13226 and #12717 . Screwed up my local git so I had to create a new PR, apologies @annatisch, I will address your comments from the previous PR.
* mindependency trick with compatibility mode works just fine. pinning local mindependency deps in tox.ini
* patch keyvaultmmgtpreparer to be backwards compatibile with previous major version
* Initial implementation of region-loading-from-config, and opting in for SB and EH to support canary region specification.
* Truncate DeleteAfter at milliseconds to hopefully allow it to get picked up by engsys. Add get_region_override to __init__ exports.
* Provide better validation semantics for the get_region_override function. (empty/null regions is invalid)
* change to the processor to check for BOM at the beginning
* changes to serialize and deserialize to be consistent with py2/3 strings/unicode types. new recordings for all that, changes to tests for everything, and a bug in sas file
* forgot to add a unicode explicitly, re-recorded some tests because of that
* Since resource names can be programmatically constructed, add scrubber at base preparer level so as to ensure recordings get the real resource name swapped out with a consistent moniker.
* In CI (but not locally) self.test_class_instance was not set before _preparer_wrapper is called, and thus self.is_live was failing. Since we have the test_class_instance, let's just use that.
* resource_moniker isn't guaranteed to be populated, so use moniker instead for default scrubbing strategy.
* Add remaining notes for how to run Keyvault tests to mgmt_settings_fake.
* Add set_delete_after_tag as a parameter on ResourceGroupPreparer so that test-prepared RGs can be automatically cleaned up by engsys.
* Populate this into the two "default helper RG preparers" (randomized/cached) to implicitly opt-in the tests consuming those into the best practice. (Currently this is a very limited set of SDKs)
* Make delete_after_tag take a timespan and be enabled by default.
Having some files using CRLF makes things extremely messy when
using tarballs on Linux, as the git repository gets automatically
converted, but the tarball stores the original line ending,
so the two do not match anymore.
* removing pytest from dev_reqs. it's locked in ci_tools and test_tools
* removing wheel from dev requirements in eventhubs
* adding pyyaml as there was a security issue with an older version. pinning to latest to be certain
* Add a clause in the preparer to attempt to consume fn as an async coroutine, falling back to synchronous if not. This allows use of preparers without an additional decorator to wrap the function.
* Add unit tests for the preparer async handling capabilities
* Add an additional exception check to the async fallback, for certain deployments of 2.7 where this is the response when trying to import asyncio that has been pip installed.
* Port storage async tests to give an example of the new async preparer working on another test suite.
* Initial commit of preparer resource caching functionality. Demonstrates use on the servicebus queue tests. This will allow tests that opt-in to utilize resources cached from previous equivalent resource creation steps, to improve test runtime. Deletion is delayed until the end of all pending tests, via a session fixture.
* Inferred caching is currently disabled. (You have to explicitly declare a parent resource is cached if a child is cached, otherwise an exception will be thrown before test run)
* Aggregates cache key with parents, such that, for instance, a service bus underneath a EU RG won't be swapped for a service bus underneath an NA RG.
* Switch cache usage in test classes to use decorators for ease, add helper to resource group preparer.
* Clean up preparer logging and documentation, tweaks to ensure pylint is happy.
* Add azure-devtools to servicebus dev-requirements (to allow local test runs to properly consume preparer logic)
* add random_name_enabled to resource_testcase cached helper wrapper so that this functionality is leveraged by default (solves a lot of engsys problems with resource collision)
* fix bug in how trimmed_kwargs are used such that we do not trim the kwargs that we pass to deletion, since we may remove elements needed for removal.
* Move resource cache cleanup into base conftest
* Default preparer logging to warn and above to ensure visibility of potential failures.
* Preparer logging is not on by default, but pushed more detail into creation failure exceptions to compensate, as the primary goal of the additional logging was to ensure users saw all possible details of what is typically a Critical Failure.
* Add longer timeout to tests.yml to support still-lengthy sb tests, make preparer exception catching more comprehensive
* Add unit tests for the caching preparer. Reverse the deferred delete order to try and emulate as closely as possible the first-in-last-out deletion behavior from non-cached resources.
Emplace this helper in servicebus management tests and regenerate recordings.
Ensure servicebus preparers use the scrubber to properly align live and nonlive test names.
* fixes to test framework b/c new release of azure-mgmt-cognitiveservices
* fix for recorded tests and service bug failing live tests
* actually fix live/recorded tests
* also fix for legacy tests
* Move Readme and Changelog template from RST -> MD
* Switch Management HISTORY.rst to CHANGELOG.md
* Include .md in Manifest
* Convert readmes and Update setup.py
* Fix manifest.in and setup.py
* Allow credential in testframework
* Adapt test framework to support azure-core based Mgmt client
* Fixing more credential things
* Fix missing script declaration
* Update azure_testcase.py
* refactor text analytics and cognitive services test case, remove core dev req for track1
* adds global text analytics preparer
* changes all tests to use global text analytics preparer
* testing ci pr validation
* update tests.yml
* run serially
* try running parallel with random name enabled
* remove AZURE_ prefix in env vars name for AAD auth tests
* add AZURE_ prefix to endpoint env var
* moves text analytics track 2 to sdk/textanalytics and renames to azure-ai-textanalytics
* more renames
* fix env var name for async testcase
* bump azure-core version in setup.py
* update shared reqs
* readme.rst -> readme.md for nspkg
* pylint fixes for nspkg
* change nspkg version
* update nspkg manifest.in
* temp add azure-ai-nspkg to dev_requirements.txt until pkg released
* update code from swagger fixes
* review updates
* adding generated code for TA v3-p1
* started work on convenience layer for detect entities
* working on batched operations
* fixes the document language model, swagger needs update
* working on single operations
* updated generated code, working on error handling
* more error handling work
* error handling for entities
* fixes results and errors combined response
* adds autosegmentation of batches and renames operations
* fix policy
* adds async client, refactoring, and ran black
* whole batch error handling
* fix async client
* fix error handler, fix testcase
* update generated code - commit c0df36f
* adds azure core to setup and updates to Error model
* add docstrings and fix python 2 errors
* fix bug in validate input
* add request id policy, update docstrings, and version
* fix python 2
* adds some tests and single operation samples
* add conftest
* fix python 2
* enable pylint in CI for textanalytics
* fix pylint mistake
* add another test
* fix single method raised errors and unskip tests
* more samples and a few fixes
* refactor error method
* re-generated code at commit 013ee15 and fixes as a result
* feedback - single operations return same type as batch
* simplify policy
* fix test for python 2
* add async single methods, samples, tests
* add samples to manifest.in
* DocumentLanguage returns a single DetectedLanguage per document
* support batch language/country hint
* models inherit from dictmixin + a few tests
* ignore samples readme and fix type hints
* aad support
* review feedback and wip readme
* fix readme
* fix readme again
* mypy clean and enabled mypy failures in CI
* default country and language hint + tests
* revert documentlanguage returning a single detectedlanguage per document
* add literalincludes to samples
* update history and convert .rst to .md
* renamed detect_language to detect_languages
* renames LanguageInput -> DetectLanguageInput and MultiLanguageInput -> TextDocumentInput
* review feedback
* update shared reqs for msrest
* Initital Commit
* Create a _shared folder for tests
* Share the session fixture as well
* More global preparers
* Fix collect_ignore_glob path
* Make list_queue compatible with global storage account
* Add @live_test pytest decorator
* Re-record
* Add live_test_only marker
* lru_cache doesn't exist on 2.7
* Make live_test_only a global marker
* Fix async test_token_credential test
* Read env variables and not settings if available
* Remove ADLA_JOB_ID from main MgmtTestCase
* Missing self
* Fix incorrect settings usage
* Remove AD_DOMAIN from mgmt testcase
* Add set_value_to_scrub
* Fix create_mgmt_client
* Remove CLIENT_OID from main mgmttestcase
* No packaging update for KV certificates
* Packaging update of azure-mgmt-datalake-analytics
* Packaging update of azure-graphrbac
* Fix missing return
* cog sci test framework
* wait for account creation
* add fixme for luis authoring key
* have mgmt testcase inherit from azure testcase
* move text analytics to new test framework
* add back code in constructor for mgmt testcase
* Storage swagger (#6777)
* Python swagger update
This only changes to the official swagger version and regenerates
* Upgrade blobs swagger to 2019-02-02
* Fixed namespace dir and header
* Enable XML for blobs
* Generate vanilla blobs
* Fixed global parameters in swagger spec
* Regenerated blobs
* Revert "Fixed global parameters in swagger spec"
This reverts commit 75bd21b00a.
* Moved parameter fix to readme
* Fixed blob list serialization
* Fix for new metadata model
* Fixed datetime formatting
* Fixed required access policy
* Fixed readme analysis
* Regenerated queues
* Regenerated files
* Fixed files datetime
* Skip tests pending msrest fix
* Fixed for queue XML
* Fix for docsettings
* [storage] Fix for Files upload return type (#6772)
* Fix missing import
* Fix for Files inconsistent return types
* Blob async trace decorators
* [SnapshotSAS]Add Snapshot SAS (#6819)
* [SnapshotSAS]Add Snapshot SAS
* [SnapshotSAS]Extract SharedAccessSignature for Blob File and Queue
* [SnapshotSAS]Fix Typo
* [SnapshotSAS]Delete Redundant code
The removed code is for another feature.
* [SnapshotSAS]Stylistic Tweak
* Updating Storage Files swagger to 2019-02-02 (#6872)
* Updating Storage Files swagger to 2019-02-02
This includes a few transform changes to set default values for new required
parameters and marked certain 8601 dates as strings when they use more precision
that Python's dates.
I'm seeing a few test failures that I'm hoping someone on the Python side can
investigate (mostly "The specified share is being deleted. Try operation later."
that I was seeing before my changes). There are a few other failures related to
new service features that we can fix if easy or disable and file a work item to
get these changes in. The recorded tests will also have to be updated, but we
don't need to block on that right now.
* skip file permission related tests
* [Storage] File swagger updates (#6926)
* Updating Storage Files swagger to 2019-02-02
This includes a few transform changes to set default values for new required
parameters and marked certain 8601 dates as strings when they use more precision
that Python's dates.
I'm seeing a few test failures that I'm hoping someone on the Python side can
investigate (mostly "The specified share is being deleted. Try operation later."
that I was seeing before my changes). There are a few other failures related to
new service features that we can fix if easy or disable and file a work item to
get these changes in. The recorded tests will also have to be updated, but we
don't need to block on that right now.
* swagger changes
* [storage] make storage pylint-clean (#6929)
* make storage pylint-clean
* feedback
* Remove Storage swagger files and reference azure-rest-api-specs (#6943)
Also includes some changes to the generated code updated to the latest version
of blobs
* Append block from url sync and async (#6925)
* [Sync][AppendBlock]
* [Async][AppendBlock]Add append_block_from_url
* [Blob][AppendBlock]add recordings for append_block_from_url
* [Blob][AppendBlock]fix failing CI
* [Blob][AppendBlock]fix Pylint
* [Blob][AppendBlock]Adjust Stylistic Things
* [UpdatePage]add upload_pages_from_url sync and async (#6960)
* [UpdatePage]add upload_pages_from_url sync and async
* [UploadPage]Adjust Stylistic Things
* Fix Pylint
* Fix Pylint
* [Queues] Migrate to devtools test framework (#6882)
* initial migration
* samples
* comments
* queues test fixes
* recodings update
* update
* comment address
* pylint fix
* comments address
* Put range from url (#7081)
* [File]Upload Range From Url Sync
* [File]Upload Range From Url ASync
* Fix Pylint
* Fix Pylint
* CPK--Client Provided Encryption Key (#7104)
* [Blob]CPK without test
* Add Generated Code
* Fix Pylint
* [Blob][CPK]Test
* Add Missing Recordings
* [Blob][CPK]use existing field self.scheme
* File rest parity (#7001)
* [File][RestParity]Rest Parity Sync
Add Rest Parity Sync part(except create permission)
tweak _shared package a bit
* [File][RestParity]Rest Parity Async
Add Rest Parity Async part(except create permission)
* [File][RestParity]Add Rest Parity Async Recording Files
Add recording files for both sync and async
* [File][RestParity]Fix CI
* [File][RestParity]Recording again to fix CI
* Add Generated Code
* Stylistic Things and Record
* [Swagger][BugFix]workaround to fix swagger generated code
* [File][RestParity]Add Create_Permission API and Test
* Fix Test
* Fix Pylint
* Revert the workaround
* [File][RestParity]Tweak Documentation and Tests
* delete .dat file
* [Blob][SAS] Added support for identity SAS (#7020)
* [Storage] Incremented version for preview 3 and updated change log (#7156)
* Update Azure Core and msrest
* Add Workaround for SharePermissions,revert msrest
* Update version and history.md
* updates on history.md
* minor change
* more changes
* [Storage] Fix flaky tests (#7179)
* Update HISTORY.md
* Fix some typo in error message
* Fix Some Tests
* some more fixes
* Skip OAUTH Test
* Initial commit
* Initial commit
* Initial commit
* wip: initial work - incomplete
* Copy code from https://github.com/Azure/azure-cli/tree/master/src/azure-cli-testsdk
* Add vcrpy version from azure-cli
* Add VSCode ignores
* Add Azure imports
* Start converting CLI commands to SDK calls
* Minor proofreading
* Add required common and mock modules
* Add deps, update pkgs and url
* Package structure
* Add more editor ignores
* Remove azure deps and nonexistent HISTORY ref
* Remove Azure mgmt dependencies
* Remove azure.common dependency
* Add dependency on six
* Remove CLI-specific stuff
* Remove CLI exception
* Remove most CLI-centric patches
* Remove older CLI-centric base class
* Add sleep patch back in
* First steps toward a unified config
* Config and no-record headers
Add config object to ScenarioTest
Add fake header for deactivating recording
Align cmdline options with vcr.py options
* Move recording-deactivation header detection to right place
* Add way to set default config file from scenario test
* Remove 'CLI' from env vars
* Reinstate patch_long_run_operation_delay
* New record disabling mechanism
* Modify config options for better backwards compatibility
* Ignore more VS stuff
* Remove jmespath dependency, update vcrpy
* Remove checkers
* Remove unuseds, make patches/processors kwargs
* Remove checkers, used only for CLI
* Update import and instance var name
* Remove unused imports
* line organization
* Update version number and vcrpy version
* Add a little more to README, add setup.cfg
* Add unit tests for TestConfig
* Add travis.yml and update dependencies
* Update author email
* Dummy push to try to trigger a Travis build
* Another dummy commit for Travis
* Switch to README.rst
* Update Travis tag pointer
* Use io to get encoding arg when reading README
* Remove unnecessary import
* Expose most everything in top-level namespace
* ScenarioTest -> ReplayableTest; update version
* Update version
* Remove unused os.path import
* Fix super call
* Fix super call in setUp
* Update ReplayableTest import
* Use earlier vcrpy, update version num
* Don't fix vcrpy version
* Drop "cli" from default random name prefix
* Add deployment to Travis
* Specify universal wheel
* Bump version to 0.2.2 for testing CI release process
* Let preparer subclasses override create_random_name
* De-"privatize" mock_in_unit_test and expose it
* Bump version to 0.3.0
* Set disable_recording from kwarg
* Don't treat mock_in_unit_test as a unittest
* Remove skip for mock_in_unit_test, specify test dir
* Update version numbers
* Remove extraneous requirements
* Remove outdated README.md stuff
* Update install for new requirements.txt
* Add 3.6-dev to pythons
* Update code style and run pylint in Travis
* Integrate with codecov.io
* Add test cover IntegrationTestBase
Also check in IntelliJ IDEA workspace configuration just in case someone
else is using PyCharm
* Add test case for LiveTest constructor
* Add tests cover create_random_name
* Add test covering get_sha1_hash
* Add test cover RecordingProcessor base class
* Add test covering SubscriptionRecordingProcessor
* Configure code coverage using configuration file
* Use unittest instead of nosetests to drive the automation
* Fix a few code style issues
* Rename coveragerc file
* Add AccessTokenProcessor
* Split intro and overview into clauses
* Back to paragraphs
* Update intro, add vcr link
* Update intro paragraph to be more general
* Remove reference to command modules
* Update test and module refs; clarify VCR.py role
* Remove outdated reference to class with builtin preparer
* Replace intro text
Use intro stolen from defunct recording_vcr_tests.md
* s/ScenarioTest/ReplayableTest/
* Add note about semantic linefeeds
* Make semantic linefeeds note an HTML comment
* Remove CLI examples and add links to consumers
* Remove doc for legacy test case class
* Finish sentence
* Add subclass kwarg information
* Fix subscription ID removal and test new cases
* Fix no-self-use linter complaint
* Downgrade the version of vcrpy dependency
from 1.11.1 to 1.11.0 due to a sympton similar to this
https://github.com/kevin1024/vcrpy/issues/318
* Bump version to 0.5.0 to prepare for release
* Fix import on Py3 not-TravisCI
* Fix recordmode
* Tight config test
* url parsing fix
* fixed pylint import order
* pylint import fix
* added record processor for slashes
* changed processor name
* Bump version 0.5.0 => 0.5.1
* Fix SubscriptionIdReplacer
* Update version 0.5.1 => 0.5.2
* Update __init__.py
* Detect leaked LRO poller
* PyLint happiness
* Improve error message
* wip
* fix error
* use base 64
* simplify
* add comments
* fix tests
* fix lint error
* use newer pylint to avoid invalid line errors
* add a new test
* address review feedback
* address review feedback
* support large response payload
* remove useless single quots from the error message
* setup: update version
* do not use preparer model for allowing large payload
* address review feedback
* Support Autorest.Python 3.x LRO leak (#42)
* Support Autorest.Python 3.x LRO leak
* PyLint happyness
* Bump version to 0.5.5
* Update the resource removal sequence
Also:
1. Adopt py.test over nosetest
2. Cleanup some test code
* remove x-ms-authorization-auxiliary header
* fix lint error
* update version
* Add some CI tools to devtools
* Readme update
* Some tests configuration
* Use Pytest as test launcher
* PyLint fixes
* CI tools tests are Py3.6 only
* PyLint CI tools only if 3.6
* CI tools tests recording
* Dont't Pylint the tests
* Fix incorrect usage of os.environ
* Make tests X-platform valid
* Fix test dependent of traceback
* Robust preparer testing
* PyGithub 1.40
* Release 1.1.0
* Allow clone_to_path to have both PR and SHA1 (#49)
* Allow clone_to_path to have both PR and SHA1
* Fix test
* Update github_tools.py (#55)
* SingleValueReplacer.process_request properly decodes request.body if its type is byte. (#56)
* Remove pointless files
* Move to tools
* Update dev_requirement file
* Don't record requests to AAD OAuth2 v2.0 endpoint
* Use devtools from repo, not from PyPI
* Fix mock dep
* Move to SDK tools
* Change them all
* Update dev_setup
* Template should ask no update by default
* Refix dev_setup
* Do not check Readme inside tools folder
* Re-re-fix and tested dev_setup
* Blackened