Skip to content

Commit

Permalink
Disable updates on configuration tests (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Nov 10, 2021
1 parent 8f622c6 commit d011762
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 112 deletions.
85 changes: 0 additions & 85 deletions testing/test/configurations/Configuration.HelmOperator.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,91 +27,6 @@ Describe 'Source Control Configuration (Helm Operator Properties) Testing' {
$n | Should -BeLessOrEqual $MAX_RETRY_ATTEMPTS
}

It "Updates the helm operator params and performs a show" {
Set-ItResult -Skipped -Because "Update is not a valid scenario for now"

az k8s-configuration update -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type "connectedClusters" -n $configurationName --helm-operator-params $customOperatorParams
$? | Should -BeTrue

$output = az k8s-configuration show --cluster-name $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters -n $configurationName
$? | Should -BeTrue

$configData = $output | ConvertFrom-Json | Where-Object { $_.id -Match $configurationName }
($configData.helmOperatorProperties.chartValues -eq $customOperatorParams) | Should -BeTrue

# Loop and retry until the configuration updates
$n = 0
do
{
$helmOperatorChartValues = (Get-ConfigData $configurationName).spec.helmOperatorProperties.chartValues
if ($helmOperatorChartValues -ne $null -And $helmOperatorChartValues.ToString() -eq $customOperatorParams) {
if (Get-ConfigStatus $configurationName -Match $SUCCESS_MESSAGE) {
break
}
}
Start-Sleep -Seconds 10
$n += 1
} while ($n -le $MAX_RETRY_ATTEMPTS)
$n | Should -BeLessOrEqual $MAX_RETRY_ATTEMPTS
}

It "Updates the helm operator chart version and performs a show" {
Set-ItResult -Skipped -Because "Update is not a valid scenario for now"

az k8s-configuration update -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type "connectedClusters" -n $configurationName --helm-operator-chart-version $customChartVersion
$? | Should -BeTrue

$output = az k8s-configuration show --cluster-name $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters -n $configurationName
$? | Should -BeTrue

# Check that the helmOperatorProperties chartValues didn't change
$configData = $output | ConvertFrom-Json | Where-Object { $_.id -Match $configurationName }
($configData.helmOperatorProperties.chartValues -eq $customOperatorParams) | Should -BeTrue
($configData.helmOperatorProperties.chartVersion -eq $customChartVersion) | Should -BeTrue

# Loop and retry until the configuration updates
$n = 0
do
{
$helmOperatorChartVersion = (Get-ConfigData $configurationName).spec.helmOperatorProperties.chartVersion
if ($helmOperatorChartVersion -ne $null -And $helmOperatorChartVersion.ToString() -eq $customChartVersion) {
if (Get-ConfigStatus $configurationName -Match $SUCCESS_MESSAGE) {
break
}
}
Start-Sleep -Seconds 10
$n += 1
} while ($n -le $MAX_RETRY_ATTEMPTS)
$n | Should -BeLessOrEqual $MAX_RETRY_ATTEMPTS
}

It "Disables the helm operator on the cluster" {
Set-ItResult -Skipped -Because "Update is not a valid scenario for now"

az k8s-configuration update -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type "connectedClusters" -n $configurationName --enable-helm-operator=false
$? | Should -BeTrue

$output = az k8s-configuration show --cluster-name $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters -n $configurationName
$? | Should -BeTrue

$helmOperatorEnabled = ($output | ConvertFrom-Json).enableHelmOperator
$helmOperatorEnabled.ToString() -eq "False" | Should -BeTrue

# Loop and retry until the configuration updates
$n = 0
do {
$helmOperatorEnabled = (Get-ConfigData $configurationName).spec.enableHelmOperator
if ($helmOperatorEnabled -ne $null -And $helmOperatorEnabled.ToString() -eq "False") {
if (Get-ConfigStatus $configurationName -Match $SUCCESS_MESSAGE) {
break
}
}
Start-Sleep -Seconds 10
$n += 1
} while ($n -le $MAX_RETRY_ATTEMPTS)
$n | Should -BeLessOrEqual $MAX_RETRY_ATTEMPTS
}

It "Lists the configurations on the cluster" {
$output = az k8s-configuration list -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters
$? | Should -BeTrue
Expand Down
27 changes: 0 additions & 27 deletions testing/test/configurations/Configuration.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,6 @@ Describe 'Basic Source Control Configuration Testing' {
$output | Should -Not -BeNullOrEmpty
}

It "Runs an update on the configuration on the cluster" {
Set-ItResult -Skipped -Because "Update is not a valid scenario for now"

az k8s-configuration update -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters -n $configurationName --enable-helm-operator
$? | Should -BeTrue

$output = az k8s-configuration show --cluster-name $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type connectedClusters -n $configurationName
$? | Should -BeTrue

$helmOperatorEnabled = ($output | ConvertFrom-Json).enableHelmOperator
$helmOperatorEnabled.ToString() -eq "True" | Should -BeTrue

# Loop and retry until the configuration updates
$n = 0
do {
$helmOperatorEnabled = (Get-ConfigData $configurationName).spec.enableHelmOperator
if ($helmOperatorEnabled -And $helmOperatorEnabled.ToString() -eq "True") {
if (Get-ConfigStatus $configurationName -Match $SUCCESS_MESSAGE) {
break
}
}
Start-Sleep -Seconds 10
$n += 1
} while ($n -le $MAX_RETRY_ATTEMPTS)
$n | Should -BeLessOrEqual $MAX_RETRY_ATTEMPTS
}

It "Performs a re-PUT of the configuration on the cluster, with HTTPS in caps" {
az k8s-configuration create -c $ENVCONFIG.arcClusterName -g $ENVCONFIG.resourceGroup --cluster-type "connectedClusters" -u "HTTPS://github.com/Azure/arc-k8s-demo" -n $configurationName --scope cluster --enable-helm-operator=false --operator-namespace $configurationName
$? | Should -BeTrue
Expand Down

0 comments on commit d011762

Please sign in to comment.