Skip to content

Commit 3344ecd

Browse files
authored
Merge pull request #54 from fredbi/prepare/release-v2.3
Prepare/release v2.3
2 parents 5d7eb76 + 03076a3 commit 3344ecd

File tree

194 files changed

+28317
-10378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+28317
-10378
lines changed

.github/workflows/auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ jobs:
1111
permissions:
1212
contents: write
1313
pull-requests: write
14-
uses: go-openapi/ci-workflows/.github/workflows/auto-merge.yml@ea0dfc9a8f78335f47355d842b76bcf95d29c846 # v0.2.5
14+
uses: go-openapi/ci-workflows/.github/workflows/auto-merge.yml@a94fc68a7e32794bbdc77ae00db80bd6567cb6f0 # v0.2.7
1515
secrets: inherit

.github/workflows/bump-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
permissions:
3333
contents: write
3434
pull-requests: write
35-
uses: go-openapi/ci-workflows/.github/workflows/bump-release-monorepo.yml@ea0dfc9a8f78335f47355d842b76bcf95d29c846 # v0.2.5
35+
uses: go-openapi/ci-workflows/.github/workflows/bump-release-monorepo.yml@a94fc68a7e32794bbdc77ae00db80bd6567cb6f0 # v0.2.7
3636
with:
3737
bump-type: ${{ inputs.bump-type }}
3838
tag-message-title: ${{ inputs.tag-message-title }}

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ jobs:
1818
permissions:
1919
contents: read
2020
security-events: write
21-
uses: go-openapi/ci-workflows/.github/workflows/codeql.yml@ea0dfc9a8f78335f47355d842b76bcf95d29c846 # v0.2.5
21+
uses: go-openapi/ci-workflows/.github/workflows/codeql.yml@a94fc68a7e32794bbdc77ae00db80bd6567cb6f0 # v0.2.7
2222
secrets: inherit

.github/workflows/contributors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ jobs:
1414
permissions:
1515
pull-requests: write
1616
contents: write
17-
uses: go-openapi/ci-workflows/.github/workflows/contributors.yml@ea0dfc9a8f78335f47355d842b76bcf95d29c846 # v0.2.5
17+
uses: go-openapi/ci-workflows/.github/workflows/contributors.yml@a94fc68a7e32794bbdc77ae00db80bd6567cb6f0 # v0.2.7
1818
secrets: inherit

.github/workflows/go-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313

1414
jobs:
1515
test:
16-
uses: go-openapi/ci-workflows/.github/workflows/go-test-monorepo.yml@ea0dfc9a8f78335f47355d842b76bcf95d29c846 # v0.2.5
16+
uses: go-openapi/ci-workflows/.github/workflows/go-test-monorepo.yml@a94fc68a7e32794bbdc77ae00db80bd6567cb6f0 # v0.2.7
1717
with:
18-
extra-flags: '-tags testcgo' # this is to trigger extra tests in spew
18+
extra-flags: '-tags testcgo,testcolorized' # (1) this is to trigger extra tests in spew, (2) this is to enable integration test for colorized output
1919
secrets: inherit

.github/workflows/scanner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ jobs:
1515
permissions:
1616
contents: read
1717
security-events: write
18-
uses: go-openapi/ci-workflows/.github/workflows/scanner.yml@ea0dfc9a8f78335f47355d842b76bcf95d29c846 # V0.2.4
18+
uses: go-openapi/ci-workflows/.github/workflows/scanner.yml@a94fc68a7e32794bbdc77ae00db80bd6567cb6f0 # V0.2.7
1919
secrets: inherit

.github/workflows/tag-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Create release
1414
permissions:
1515
contents: write
16-
uses: go-openapi/ci-workflows/.github/workflows/release.yml@ea0dfc9a8f78335f47355d842b76bcf95d29c846 # v0.2.5
16+
uses: go-openapi/ci-workflows/.github/workflows/release.yml@a94fc68a7e32794bbdc77ae00db80bd6567cb6f0 # v0.2.7
1717
with:
1818
tag: ${{ github.ref_name }}
1919
is-monorepo: true

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ linters:
1414
- paralleltest
1515
- recvcheck
1616
- testpackage
17+
- thelper
1718
- tparallel
1819
- varnamelen
1920
- whitespace
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// SPDX-FileCopyrightText: Copyright 2025 go-swagger maintainers
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package assert_test
5+
6+
import (
7+
"fmt"
8+
"testing"
9+
10+
"github.com/go-openapi/testify/v2/assert"
11+
)
12+
13+
func ExampleAssertions_with_generics() {
14+
t := new(testing.T) // normally provided by test
15+
16+
a := assert.New(t)
17+
18+
const expected = "hello"
19+
goodValue := "hello"
20+
wrongValue := "world"
21+
22+
r0 := a.Equal(expected, goodValue) // classic reflect-based assertion
23+
fmt.Printf("good value is %t\n", r0)
24+
25+
r1 := assert.EqualT(a.T, expected, goodValue) // usage with generic assertion
26+
fmt.Printf("good value is %t\n", r1)
27+
28+
r2 := assert.EqualT(a.T, expected, wrongValue)
29+
fmt.Printf("wrong value is %t\n", r2)
30+
31+
// Output:
32+
// good value is true
33+
// good value is true
34+
// wrong value is false
35+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// SPDX-FileCopyrightText: Copyright 2025 go-swagger maintainers
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package assert_test
5+
6+
import (
7+
"fmt"
8+
"sync"
9+
"testing"
10+
11+
"github.com/go-openapi/testify/v2/assert"
12+
)
13+
14+
func ExampleNoGoRoutineLeak_fail() {
15+
t := new(testing.T) // normally provided by test
16+
17+
blocker := make(chan struct{})
18+
var wg sync.WaitGroup
19+
20+
defer func() {
21+
// clean resources _after_ the test
22+
close(blocker)
23+
wg.Wait()
24+
}()
25+
26+
wg.Add(1)
27+
// This examplifies how a function that leaks a goroutine is detected.
28+
result := assert.NoGoRoutineLeak(t, func() { // true when there is no leak
29+
go func() {
30+
defer wg.Done()
31+
<-blocker // leaked: blocks until cleanup
32+
}()
33+
})
34+
35+
// Error message from test would typically return the leaked goroutine, e.g.:
36+
// # 0x69c8e8 github.com/go-openapi/testify/v2/assert_test.ExampleNoGoRoutineLeak.func2.1+0x48 .../assert_adhoc_example_7_test.go:30
37+
fmt.Printf("has leak: %t", !result)
38+
// Output:
39+
// has leak: true
40+
}

0 commit comments

Comments
 (0)