package host import ( "context" "testing" "github.com/carlosframework/platform/internal/release" ) // A deployment directory (CARLOS_DEPLOYMENT_DIR) is a deployment like the // bucket: the opener's store bumps the change index after a scoped write. // getenv is injected, so nothing here touches the process environment. func TestDeployDirOpenerBumpsScopedKey(t *testing.T) { t.Parallel() ctx := context.Background() dir := t.TempDir() s, err := openDeployStoreEnv(ctx, envFunc(map[string]string{"CARLOS_DEPLOYMENT_DIR": dir})) if err != nil { t.Fatal(err) } if _, err := s.Put(ctx, "accounts/shop/manifest.json", []byte("{}"), ""); err != nil { t.Fatal(err) } idx, _, err := release.ReadChangeIndex(ctx, s) if err != nil { t.Fatal(err) } if got := idx.Entries["accounts/shop"]; got != 1 { t.Fatalf("accounts/shop generation = %d after one scoped Put, want 1 (entries %v)", got, idx.Entries) } }