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:
Andrew Nester 2025-02-07 14:54:24 +00:00 committed by GitHub
parent ecc05689ca
commit ecb816446e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 1 deletions

View File

@ -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() {

View File

@ -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: