Repository navigation
test(terraform): add plan-level tests for 080-azureml and 140-azureml - #875
Merged
Katrien De Graeve (katriendg) merged 2 commits intoOct 13, 2026
Merged
Katrien De Graeve (katriendg) merged 2 commits into
Katrien De Graeve (katriendg) merged 2 commits into
Conversation
Part of microsoft#152. - 080-azureml: default workspace, compute subnet and compute cluster, custom names with an existing subnet, no compute cluster, workspace private endpoint and DNS zones, AKS integration naming, and the single-variable validations. - 140-azureml: default Arc compute target, custom compute settings and user-assigned identity, extension settings with TLS, tolerations and workload identity federation (integration module), and the inference router service type validation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Shivam Sharma <192242476+ShivamSharma43@users.noreply.github.com>
Shivam Sharma (ShivamSharma43)
requested review from
a team
and
a balanced review from Copilot
October 12, 2026 10:18
Katrien De Graeve (katriendg)
approved these changes
Oct 13, 2026
Katrien De Graeve (katriendg)
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for the contribution, this is looking good.
Katrien De Graeve (katriendg)
merged commit Oct 13, 2026
f479861
into
microsoft:main
43 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Adds plan-level Terraform tests for the last two untested components listed in #152:
080-azuremland140-azureml. Each component gets atests/base.tftest.hcland atests/setupmodule, following the pattern from #821 and #874. All runs usecommand = planwithmock_provider, so no Azure credentials are needed.Related Issue
Relates to #152
With #821, #861 and #874, this covers the remaining components in that issue. It doesn't touch any component code.
Type of Change
Implementation Details
080-azureml(mocksazapiandazurerm;azurerm_client_configis overridden):create_default_configuration: the workspace name (mlw-...), location and resource group, the compute subnet name (subnet-<prefix>-azureml-...) and the compute cluster name (cluster-...). No registry, private endpoint, DNS zones, AKS integration or workload identity by default.create_with_custom_names_and_existing_subnet: provided workspace and cluster names are used. Withshould_create_compute_cluster_snet = falseandcompute_cluster_subnet, no subnet is created but the cluster still is.create_without_compute_cluster: neither the cluster nor its subnet is created, and the cluster outputs are null.create_with_private_endpoint: the workspace private endpoint name (pe-mlw-...) and the two private DNS zones (privatelink.api.azureml.ms,privatelink.notebooks.azure.net).integrate_aks_cluster: the extension name, and the compute target name with hyphens removed and truncated to 16 characters (environment = "staging-west").reject_invalid_inputs/reject_invalid_resource_prefix: the single-variable validations (compute_cluster_max_nodes,compute_cluster_vm_priority,inference_router_service_type,aks_cluster_purpose,resource_prefix).140-azureml(mocksazapi,azurermandtls):create_default_configuration: extension name (azureml-...) and compute target name (arck-...), the target's workspace, location,Kubernetescompute type and connected cluster ID, the default description, local auth disabled,azuremlnamespace, the component's default instance type (8Gimemory limit),Stablerelease train, and a system-assigned identity.create_with_custom_compute_settings: provided names, description, local auth, namespace, default instance type, release train and virtual cluster name are passed through. Provided instance types replace the default, andcluster_integration_workspace_identity_idswitches the target to a user-assigned identity.configure_extension_with_tls_tolerations_and_workload_identity: runs theinference-cluster-integrationmodule directly, because the extension settings and federated credentials are not exposed as component outputs. Checks the string-typed feature flags,relayserver.enabled = "true",allowInsecureConnections = "false"with the protected TLS settings when CNAME, certificate and key are all set, the indexedtoleration[n]/workLoadToleration[n]keys (unset fields left out), and one federated identity credential per subject, with the name derived from the subject, the cluster OIDC issuer and the workload identity.reject_invalid_inference_router_service_type: the variable validation.Some outputs (
kubernetes_compute,azureml_extension) wrap whole resources intry(), so a single unknown computed attribute makes them unknown at plan. The tests override only the computed attributes they depend on (the extensionidand identity principal, and the computeid) withoverride_during = plan.The 080 tests don't cover the cross-variable validations (
nat_gateway,network_security_group,ml_workload_identity, min/max nodes) because #862 moves them. I also ran these 080 tests against the #862 head, and all 8 runs pass there too.Testing Performed
terraform test(plan-level, mock providers)Run with no
ARM_*orAZURE_*variables set:terraform init -backend=falseandterraform testin each component, with Terraform 1.16.5 and 1.15.0:080-azureml8 passed, 0 failed;140-azureml5 passed, 0 failed.terraform validatein each component: valid.terraform fmt -check -recursiveon bothtests/directories: no changes.tflint --disable-rule=terraform_required_providers --recursivewith the repo.tflint.hcl: no findings.I also checked that the tests fail when the component is wrong. I broke a copy of each component, one change at a time, and every one of these 10 changes made at least one run fail:
relayserver.enabledworkLoadTolerationkeyAdditional Notes
While writing the registry case for 080 I found that
should_deploy_registry = truecurrently fails at plan with azapi 2.13.0:The root module always passes a
description(coalesce(var.registry_description, ...)), and theMicrosoft.MachineLearningServices/registries@2025-07-01-previewschema has noproperties.description, so the registry can't be planned with schema validation on. I left the registry out of these tests. I'm happy to open a separate issue or fix for it if you'd like.Validation Steps
cd src/000-cloud/080-azureml/terraform && terraform init -backend=false && terraform testcd src/100-edge/140-azureml/terraform && terraform init -backend=false && terraform testNo Azure login is needed for either.
Checklist
terraform fmton all Terraform codeterraform validateon all Terraform codeaz bicep formaton all Bicep code🤖 Generated with Claude Code