From ff00e9effdaab9cbba5c154098bc31e39097737d Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 18 Jun 2026 15:39:39 +0200 Subject: [PATCH] acc: make apps/inline_config runnable locally The testserver's AppsGetDeployment fabricated a deployment with only an ID and status, so the inline config.command and config.env never echoed back locally. Return the stored ActiveDeployment instead, masking env var values to match the real GET response (name only, no value). Co-authored-by: Isaac --- .../apps/inline_config/out.test.toml | 2 +- .../resources/apps/inline_config/test.toml | 2 +- libs/testserver/apps.go | 26 +++++++++++++------ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/acceptance/bundle/resources/apps/inline_config/out.test.toml b/acceptance/bundle/resources/apps/inline_config/out.test.toml index 650836edeb3..bbc7fcfd1bd 100644 --- a/acceptance/bundle/resources/apps/inline_config/out.test.toml +++ b/acceptance/bundle/resources/apps/inline_config/out.test.toml @@ -1,3 +1,3 @@ -Local = false +Local = true Cloud = true EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["terraform", "direct"] diff --git a/acceptance/bundle/resources/apps/inline_config/test.toml b/acceptance/bundle/resources/apps/inline_config/test.toml index 0bd19601805..0e8c8a38404 100644 --- a/acceptance/bundle/resources/apps/inline_config/test.toml +++ b/acceptance/bundle/resources/apps/inline_config/test.toml @@ -1,2 +1,2 @@ -Local = false +Local = true Cloud = true diff --git a/libs/testserver/apps.go b/libs/testserver/apps.go index b35632e27ad..4a5b05d6e2a 100644 --- a/libs/testserver/apps.go +++ b/libs/testserver/apps.go @@ -118,18 +118,28 @@ func (s *FakeWorkspace) AppsCreateDeployment(req Request, name string) Response func (s *FakeWorkspace) AppsGetDeployment(_ Request, name, deploymentID string) Response { defer s.LockUnlock()() - _, ok := s.Apps[name] + app, ok := s.Apps[name] if !ok { return Response{StatusCode: 404} } - return Response{Body: apps.AppDeployment{ - DeploymentId: deploymentID, - Status: &apps.AppDeploymentStatus{ - State: apps.AppDeploymentStateSucceeded, - Message: "Deployment succeeded", - }, - }} + if app.ActiveDeployment == nil || app.ActiveDeployment.DeploymentId != deploymentID { + return Response{StatusCode: 404} + } + + // Return a copy so the masking below does not mutate the stored deployment. + deployment := *app.ActiveDeployment + + // The real GET response strips env var values, returning only the name of + // each variable. Reproduce that masking so the local golden matches + // recorded cloud behavior. + maskedEnvVars := make([]apps.EnvVar, len(deployment.EnvVars)) + for i, ev := range deployment.EnvVars { + maskedEnvVars[i] = apps.EnvVar{Name: ev.Name} + } + deployment.EnvVars = maskedEnvVars + + return Response{Body: deployment} } func (s *FakeWorkspace) AppsStart(_ Request, name string) Response {