Skip to content
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

adding tests for all 4 extension types calls #183

Merged
merged 4 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/k8s-extension/azext_k8s_extension/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
APPLIANCE_API_VERSION = "2021-10-31-preview"
HYBRIDCONTAINERSERVICE_API_VERSION = "2022-05-01-preview"

EXTENSION_TYPE_API_VERSION = "2022-04-02-preview"
EXTENSION_TYPE_API_VERSION = "2022-01-15-preview"
4 changes: 4 additions & 0 deletions testing/pipeline/k8s-custom-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ stages:
parameters:
jobName: Cassandra
path: ./test/extensions/public/Cassandra.Tests.ps1
- template: ./templates/run-test.yml
parameters:
jobName: ExtensionTypes
path: ./test/extensions/public/ExtensionTypes.Tests.ps1
- template: ./templates/run-test.yml
parameters:
jobName: OpenServiceMesh
Expand Down
33 changes: 33 additions & 0 deletions testing/test/extensions/public/ExtensionTypes.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Describe 'Extension Types Testing' {
BeforeAll {
$extensionType = "cassandradatacentersoperator"
$location = "eastus2euap"

. $PSScriptRoot/../../helper/Constants.ps1
. $PSScriptRoot/../../helper/Helper.ps1
}

It 'Performs a show extension types call' {
$output = az $Env:K8sExtensionName extension-types show -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters --extension-type $extensionType
$? | Should -BeTrue
$output | Should -Not -BeNullOrEmpty
}

It "Performs a cluster-scoped list extension types call" {
$output = az $Env:K8sExtensionName extension-types list -c $($ENVCONFIG.arcClusterName) -g $($ENVCONFIG.resourceGroup) --cluster-type connectedClusters
$? | Should -BeTrue
$output | Should -Not -BeNullOrEmpty
}

It "Performs a location-scoped list extension types call" {
$output = az $Env:K8sExtensionName extension-types list-by-location --location $location
$? | Should -BeTrue
$output | Should -Not -BeNullOrEmpty
}

It "Performs a location-scoped list extension type versions call" {
$output = az $Env:K8sExtensionName extension-types list-versions --location $location --extension-type $extensionType
$? | Should -BeTrue
$output | Should -Not -BeNullOrEmpty
}
}