Skip to content

Commit

Permalink
Upgrade to Go 1.22, 1.23 (#1235)
Browse files Browse the repository at this point in the history
Go 1.23 is out, so we can change supported versions to 1.22 and 1.23.
Switch CI to test against 1.22 and 1.23 only,
and merge test files that were previously split on Go versions
back together.
  • Loading branch information
abhinav committed Aug 27, 2024
1 parent 67ed361 commit 27eba7c
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 235 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
go: ["1.21.x", "1.22.x"]
go: ["1.22.x", "1.23.x"]

steps:
- name: Checkout code
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x

- name: Test
run: make cover COVER_MODULES=./docs
Expand All @@ -68,7 +68,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x
cache: false # managed by golangci-lint

- uses: golangci/golangci-lint-action@v6
Expand Down
41 changes: 0 additions & 41 deletions app_121_test.go

This file was deleted.

41 changes: 0 additions & 41 deletions app_122_test.go

This file was deleted.

9 changes: 9 additions & 0 deletions app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2397,6 +2397,15 @@ func TestNopLogger(t *testing.T) {
app.RequireStart().RequireStop()
}

func TestNopLoggerOptionString(t *testing.T) {
t.Parallel()

assert.Equal(t,
"fx.WithLogger(go.uber.org/fx.init.func1())",
NopLogger.String(),
)
}

func TestCustomLoggerWithPrinter(t *testing.T) {
t.Parallel()

Expand Down
50 changes: 0 additions & 50 deletions internal/fxreflect/stack_120_test.go

This file was deleted.

50 changes: 0 additions & 50 deletions internal/fxreflect/stack_121_test.go

This file was deleted.

50 changes: 0 additions & 50 deletions internal/fxreflect/stack_122_test.go

This file was deleted.

19 changes: 19 additions & 0 deletions internal/fxreflect/stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@ func TestStack(t *testing.T) {
})
}

func TestDeepStack(t *testing.T) {
t.Run("nest", func(t *testing.T) {
// Introduce a few frames.
frames := func() []Frame {
return func() []Frame {
return CallerStack(0, 0)
}()
}()

require.True(t, len(frames) > 3, "expected at least three frames")
for i, name := range []string{"func1.TestDeepStack.func1.1.2", "func1.1", "func1"} {
f := frames[i]
assert.Equal(t, "go.uber.org/fx/internal/fxreflect.TestDeepStack."+name, f.Function)
assert.Contains(t, f.File, "internal/fxreflect/stack_test.go")
assert.NotZero(t, f.Line)
}
})
}

func TestStackCallerName(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 27eba7c

Please sign in to comment.