-
Notifications
You must be signed in to change notification settings - Fork 66
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
Generate resources for Central tests #498
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, put some comments on creating new app flow, btw have you run the integration tests successfully with auto created apps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
I removed the functionality in the integration tests that would run the tests twice (once with a token and once without). This meant that tests took twice as long. Instead, the integration tests will rely on the configuration to determine if they are going to be run with a token or not; if there is a token defined then the integration tests will use that token and if there is no token, the integration tests will run without a token. In a future pr, I will add unit tests to ensure that the tokens are generated properly. Specifically the unit tests will cover the functions in the central utility. |
Automate resource generation for central tests. If the resource values are provided in the configuration file, they will be used. Otherwise, new resources will be created to run the tests. Within a given testing resource group,
Specifically, these configuration variables can be safely removed:
Generated variables
If the central app id is not provided, the resource group to create the central app must be provided with:
If a central app is provided, the resource group value will be retrieved in case it is needed for storage account creation.
Then, the following variables will be populated:
Limitations and non-generated variables
Note that with the current commands, two parameters will still be needed to run all tests:
If one of these parameters is not provided, then this test will be skipped:
If only azext_iot_central_primarykey is provided, then the primary key value will be nulled out because the newly created central app would not have the same primary key as the one that is defined in the configuration file.
For internal testing, these parameters will only be populated (and used) if present in the pytest.ini configuration file:
Other fixes
Delete device templates
Changed the _delete_device_template code to invoke the correct command each time. There was an issue in which the list command defined after was invoked instead of the delete command.
sys.excepthook error
In addition, fixing sys.excepthook error by specifying which loop is to be closed.
The issue is here: #475
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Thank you for contributing to the IoT extension!
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
Intent for Production
dev
ormain
are of production grade. Corollary to this, any merged contributions to these branches may be deployed in a public release at any given time. By checking this box, you agree and commit to the expected production quality of code.Basic expectations
pytest <project root> -vv
. Please provide evidence in the form of a screenshot showing a succesful run of tests locally OR a link to a test pipeline that has been run against the change-set..pylintrc
and.flake8
rules? Look at the CI scripts for example usage.- [x] Have you made an entry in HISTORY.rst which concisely explains your user-facing feature or change?Azure IoT CLI maintainers reserve the right to enforce any of the outlined expectations.
A PR is considered ready for review when all basic expectations have been met (or do not apply).