mirror of https://github.com/databricks/cli.git
Update app deploy test to confirm app config changes on redeploy (#2301)
## Changes Adds additional step to integration test which changes the app config and confirms it's updated after redeploy ## Tests ``` helpers_test.go:156: stderr: Deleting files... helpers_test.go:156: stderr: Destroy complete! --- PASS: TestDeployBundleWithApp (470.25s) PASS coverage: [no statements] ok github.com/databricks/cli/integration/bundle 470.981s coverage: [no statements] ```
This commit is contained in:
parent
ecc05689ca
commit
ecb816446e
|
@ -98,6 +98,24 @@ func TestDeployBundleWithApp(t *testing.T) {
|
|||
- run
|
||||
env:
|
||||
- name: JOB_ID
|
||||
value: "%d"`, job.JobId))
|
||||
|
||||
// Redeploy bundle with changed config env for app and confirm it's updated in app.yaml
|
||||
deployBundleWithArgs(t, ctx, root, `--var="env_var_name=ANOTHER_JOB_ID"`, "--force-lock", "--auto-approve")
|
||||
reader, err = wt.W.Workspace.Download(ctx, pathToAppYml)
|
||||
require.NoError(t, err)
|
||||
|
||||
data, err = io.ReadAll(reader)
|
||||
require.NoError(t, err)
|
||||
|
||||
content = string(data)
|
||||
require.Contains(t, content, fmt.Sprintf(`command:
|
||||
- flask
|
||||
- --app
|
||||
- app
|
||||
- run
|
||||
env:
|
||||
- name: ANOTHER_JOB_ID
|
||||
value: "%d"`, job.JobId))
|
||||
|
||||
if testing.Short() {
|
||||
|
|
|
@ -4,6 +4,10 @@ bundle:
|
|||
workspace:
|
||||
root_path: "~/.bundle/{{.unique_id}}"
|
||||
|
||||
variables:
|
||||
env_var_name:
|
||||
default: "JOB_ID"
|
||||
|
||||
resources:
|
||||
apps:
|
||||
test_app:
|
||||
|
@ -17,7 +21,7 @@ resources:
|
|||
- app
|
||||
- run
|
||||
env:
|
||||
- name: JOB_ID
|
||||
- name: ${var.env_var_name}
|
||||
value: ${resources.jobs.foo.id}
|
||||
|
||||
resources:
|
||||
|
|
Loading…
Reference in New Issue