Skip to content

Commit 8313404

Browse files
ilia-dbpietern
andauthored
Upgrade Go to 1.25.1 (#3575)
## Changes Changelog: https://tip.golang.org/doc/go1.25 * Fix one acceptance test on Windows due to a changed error message. * Bump golangci-lint to v2.4.0 (must be built with the same Go minor version). ## Why [`testing/synctest` is finally here!](https://tip.golang.org/doc/go1.25#new-testingsynctest-package) --------- Co-authored-by: Pieter Noordhuis <[email protected]>
1 parent 1d8164d commit 8313404

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
- name: Run Go lint checks (does not include formatting checks)
119119
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
120120
with:
121-
version: v2.1.6
121+
version: v2.4.0
122122
args: --timeout=15m
123123
- name: Run ruff (Python linter and formatter)
124124
uses: astral-sh/ruff-action@0c50076f12c38c3d0115b7b519b54a91cb9cf0ad # v3.5.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Replace error message from windows
22
[[Repls]]
3-
Old = "CreateFile foo/bar/doesnotexist: The system cannot find the path specified."
3+
Old = "GetFileAttributesEx foo/bar/doesnotexist: The system cannot find the path specified."
44
New = "stat foo/bar/doesnotexist: no such file or directory"

acceptance/internal/prepare_server.go

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,27 @@ func StartDefaultServer(t *testing.T) {
3131

3232
t.Setenv("DATABRICKS_DEFAULT_HOST", s.URL)
3333

34-
// Do not read user's ~/.databrickscfg
35-
homeDir := t.TempDir()
34+
// Do not read user's ~/.databrickscfg.
35+
//
36+
// We use a custom temporary home directory and cleanup routine here to avoid
37+
// issues observed with t.TempDir() on Windows, where Go 1.25's test cleanup
38+
// can fail to remove certain directories (e.g., due to locked or system-managed files).
39+
// Instead of failing the test, we log any errors encountered during cleanup.
40+
// This approach ensures test reliability across platforms.
41+
//
42+
// See debugging journey in https://github.com/databricks/cli/pull/3575.
43+
homeDir, err := os.MkdirTemp("", "acceptance-home-dir")
44+
require.NoError(t, err)
45+
t.Cleanup(func() {
46+
err := os.RemoveAll(homeDir)
47+
if err != nil {
48+
t.Logf("Failed to remove temporary home directory: %v", err)
49+
_ = filepath.Walk(homeDir, func(path string, info os.FileInfo, err error) error {
50+
t.Logf("%s", path)
51+
return nil
52+
})
53+
}
54+
})
3655
t.Setenv(env.HomeEnvVar(), homeDir)
3756
}
3857

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/databricks/cli
22

3-
go 1.24.0
3+
go 1.25.0
44

5-
toolchain go1.24.6
5+
toolchain go1.25.1
66

77
require (
88
dario.cat/mergo v1.0.2 // BSD 3-Clause

0 commit comments

Comments
 (0)