update tests to use python 3.13#9028
Conversation
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Hi @bavneetsingh16, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces PowerShell-based integration tests for Azure CLI K8s extensions and configurations. The tests utilize the Pester framework and are designed to validate Azure Arc K8s extension and configuration functionality.
Key changes:
- Adds comprehensive test infrastructure with helper functions for extension and configuration testing
- Provides test suites for various Azure extensions (Azure Monitor, Azure ML, Azure Defender, Azure Policy)
- Creates test configurations for Flux Git/Blob storage scenarios
- Establishes CI/CD pipeline templates for automated testing
Reviewed Changes
Copilot reviewed 29 out of 33 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| testing/test/helper/*.ps1 | Helper functions for extension data retrieval and common test operations |
| testing/test/extensions/**/*.ps1 | Test suites for Azure extensions using Pester framework |
| testing/test/configurations/*.ps1 | Test suites for Flux configuration scenarios with various storage backends |
| testing/pipeline/*.yml | Azure DevOps pipeline configuration for automated testing |
| testing/*.ps1 | Main test orchestration and environment setup scripts |
| testing/docs/*.md | Documentation for test authoring and setup procedures |
Comments suppressed due to low confidence (4)
testing/pipeline/k8s-custom-pipelines.yml:22
- Python 3.13 may not be available or supported in Azure DevOps hosted agents. Consider using a stable Python version like 3.11 or 3.12.
jobs:
testing/pipeline/templates/run-test.yml:22
- Python 3.13 may not be available or supported in Azure DevOps hosted agents. Consider using a stable Python version like 3.11 or 3.12.
displayName: 'Use Python 3.13'
testing/pipeline/k8s-custom-pipelines.yml:44
- Python 3.13 may not be available or supported in Azure DevOps hosted agents. Consider using a stable Python version like 3.11 or 3.12.
displayName: 'Use Python 3.13'
testing/pipeline/k8s-custom-pipelines.yml:81
- Python 3.13 may not be available or supported in Azure DevOps hosted agents. Consider using a stable Python version like 3.11 or 3.12.
displayName: 'Use Python 3.13'
| ) | ||
|
|
||
| $output = kubectl get gitconfigs -A -o json | ConvertFrom-Json | ||
| return $output.items | Where-Object { $_.metadata.name -eq $configurationName } |
There was a problem hiding this comment.
The variable $configurationName is not defined in this function. It should be $configName to match the parameter name.
| return $output.items | Where-Object { $_.metadata.name -eq $configurationName } | |
| return $output.items | Where-Object { $_.metadata.name -eq $configName } |
| ) | ||
|
|
||
| $output = kubectl get fc -A -o json | ConvertFrom-Json | ||
| return $output.items | Where-Object { $_.metadata.name -eq $configurationName } |
There was a problem hiding this comment.
The variable $configurationName is not defined in this function. It should be $configName to match the parameter name.
| return $output.items | Where-Object { $_.metadata.name -eq $configurationName } | |
| return $output.items | Where-Object { $_.metadata.name -eq $configName } |
| { | ||
| $readyConfigs = 0 | ||
| foreach($configData in $CONFIG_ARR) { | ||
| $output = az k8s-configuration flux show -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters -n $CONFIGdATA.Item1 |
There was a problem hiding this comment.
There is a typo in the variable name $CONFIGdATA.Item1. It should be $configData.Item1 with lowercase 'd' to match the variable defined in the loop.
| $output = az k8s-configuration flux show -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters -n $CONFIGdATA.Item1 | |
| $output = az k8s-configuration flux show -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters -n $configData.Item1 |
|
|
||
| It "Performs another list after the delete" { | ||
| $output = az $Env:K8sExtensionName list -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters | ||
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName } |
There was a problem hiding this comment.
The filter condition should use $extensionType instead of $extensionName to correctly filter by extension type.
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName } | |
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionType } |
|
|
||
| It "Performs another list after the delete" { | ||
| $output = az $Env:K8sExtensionName list -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters | ||
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName } |
There was a problem hiding this comment.
The filter condition should use $extensionType instead of $extensionName to correctly filter by extension type.
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName } | |
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionType } |
|
|
||
| It "Performs another list after the delete" { | ||
| $output = az $Env:K8sExtensionName list -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters | ||
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName } |
There was a problem hiding this comment.
The filter condition should use $extensionType instead of $extensionName to correctly filter by extension type.
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName } | |
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionType } |
|
|
||
| It "Performs another list after the delete" { | ||
| $output = az k8s-extension list --cluster-name $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters | ||
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName } |
There was a problem hiding this comment.
The filter condition should use $extensionType instead of $extensionName to correctly filter by extension type.
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionName } | |
| $extensionExists = $output | ConvertFrom-Json | Where-Object { $_.extensionType -eq $extensionType } |
|
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.