test: Acceptance test for flag overrides

This commit is contained in:
Ilya Kuznetsov 2025-01-16 18:07:51 +01:00
parent a794490b64
commit 3f0b5f848e
No known key found for this signature in database
GPG Key ID: 91F3DDCF5D21CDDF
4 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,21 @@
bundle:
name: TestResolveVariablesFromFile
variables:
cluster:
type: "complex"
default:
node_type_id: "unused"
cluster_key:
default: "unused"
cluster_workers:
default: 1
resources:
jobs:
job1:
job_clusters:
- job_cluster_key: ${var.cluster_key}
new_cluster:
node_type_id: "${var.cluster.node_type_id}"
num_workers: ${var.cluster_workers}

View File

@ -0,0 +1,8 @@
{
"job_cluster_key": "mlops_stacks-cluster",
"new_cluster": {
"node_type_id": "Standard_DS3_v2",
"num_workers": 2
}
}
"mlops_stacks-cluster"

View File

@ -0,0 +1,5 @@
# variable file
$CLI bundle validate -o json --vars-file-path=vars.json | jq .resources.jobs.job1.job_clusters[0]
# variable flag
$CLI bundle validate -o json --var="cluster_key=mlops_stacks-cluster" | jq .resources.jobs.job1.job_clusters[0].job_cluster_key

View File

@ -0,0 +1,7 @@
{
"cluster": {
"node_type_id": "Standard_DS3_v2"
},
"cluster_key": "mlops_stacks-cluster",
"cluster_workers": 2
}