Skip to content

Improve Unit Test Experience for Functionality using Azure CLI Configuration #25796

Description

Is your feature request related to a problem? Please describe.

When writing unit test for functionality that leverages Azure CLI Configuration, the config is persisted across tests leading to misleading results.

Most recently, new functionality in the az bicep sub-command leveraged Azure CLI Configuration but a bug slipped through the tests due to the config value not being reset with each test, causing numerous build pipeline failures for customers.

Describe the solution you'd like

Better unit testing experience for such functionality. Based on this last experience, here are some thoughts I had:

  • Reset config for each test or In-Memory Config for DummyCLI
  • Should Config API throw error for No Section
  • Lint Rule for cli_ctx.config.get() without default value. Warning at the minimum.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAzure CLI TeamThe command of the issue is owned by Azure CLI teamTest Frameworkfeature-request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions