Azure / azure-iot-cli-extension

Azure IoT extension for Azure CLI
Other
82 stars 64 forks source link

Tox Updates #629

Closed c-ryan-k closed 1 year ago

c-ryan-k commented 1 year ago

This overhauls our existing tox.ini to support the following local and pipeline test infrastructure. I highly advise giving their docs a quick overview, as it is much more in depth than this preview will cover.

Local Tox

This changes nothing about how you currently run tests - local pytest and virtualenvs are untouched and unrelated. In order to perform any of these new tasks, you must install tox (currently in dev_requirements, so already part of dev setup) and have the azure-cli repo cloned alongside your extension repo.

It supports local test configurations for the following environments (passed to tox with -e "env"):

image

If you choose not to select a specific python version (which is also the current default), you can use python instead, to invoke whichever version python invokes in your environment.

Important notes

Tox Pipeline

This also introduces a new tox pipeline (more work to come), which adds switches for each python version and azure CLI version, and distributes those tasks to simultaneous jobs: image

This is currently a standalone pipeline, but the goal is to eventually configure this pipeline to utilize the existing built wheel and test SDK from our current pipelines to ensure our tests pass on all possible python and Azure CLI versions with very minimal user configuration.


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

Basic expectations

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).

c-ryan-k commented 1 year ago

Here's an example of the tox pipeline running

vilit1 commented 1 year ago

do we need to update dev_requirements (ex: add tox)

Also would be nice if you can put the pr description into the page we have about testing

c-ryan-k commented 1 year ago

do we need to update dev_requirements (ex: add tox)

Also would be nice if you can put the pr description into the page we have about testing

tox is already in our dev_requirements - but I can absolutely work on a "tox testing guide", with this PR description as a base (and some examples of course)

digimaun commented 1 year ago

I'm thrilled about this contribution

digimaun commented 1 year ago

do we need to update dev_requirements (ex: add tox) Also would be nice if you can put the pr description into the page we have about testing

tox is already in our dev_requirements - but I can absolutely work on a "tox testing guide", with this PR description as a base (and some examples of course)

Will that tox testing guide be part of this PR or a follow up PR?