-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π₯ Feature: Add TestConfig to app.Test() for configurable testing (#3161)
* π₯ Feature: Add thread-safe reading from a closed testConn * π₯ Feature: Add TestConfig to app.Test() This commit is summarized as: - Add the struct `TestConfig` as a parameter for `app.Test()` instead of `timeout` - Add documentation of `TestConfig` to docs/api/app.md and in-line - Modify middleware to use `TestConfig` instead of the previous implementation Fixes #3149 * π Doc: Add more details about TestConfig in docs * π©Ή Fix: Correct testConn tests - Fixes Test_Utils_TestConn_Closed_Write - Fixes missing regular write test * π¨ Style: Respect linter in Add App Test Config * π¨ Styles: Update app.go to respect linter * β»οΈ Refactor: Rename TestConfig's ErrOnTimeout to FailOnTimeout - Rename TestConfig.ErrOnTimeout to TestConfig.FailOnTimeout - Update documentation to use changed name - Also fix stale documentation about passing Timeout as a single argument * π©Ή Fix: Fix typo in TestConfig struct comment in app.go * β»οΈ Refactor: Change app.Test() fail on timeouterror to os.ErrDeadlineExceeded * β»οΈ Refactor:Update middleware that use the same TestConfig to use a global variable * π©Ή Fix: Update error from FailOnTimeout to os.ErrDeadlineExceeded in tests * π©Ή Fix: Remove errors import from middlware/proxy/proxy_test.go * π Doc: Add `app.Test()` config changes to docs/whats_new.md * β» Refactor: Change app.Test() and all uses to accept 0 as no timeout instead of -1 * π Doc: Add TestConfig option details to docs/whats_new.md * π¨ Styles: Update docs/whats_new.md to respect markdown-lint * π¨ Styles: Update docs/whats_new.md to use consistent style for TestConfig options description --------- Co-authored-by: Juan Calderon-Perez <[email protected]>
- Loading branch information
Showing
14 changed files
with
328 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f8b490f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.50
.Benchmark_Ctx_Send
6.812
ns/op 0 B/op 0 allocs/op4.335
ns/op 0 B/op 0 allocs/op1.57
Benchmark_Ctx_Send - ns/op
6.812
ns/op4.335
ns/op1.57
Benchmark_Utils_GetOffer/1_parameter
200.8
ns/op 0 B/op 0 allocs/op131
ns/op 0 B/op 0 allocs/op1.53
Benchmark_Utils_GetOffer/1_parameter - ns/op
200.8
ns/op131
ns/op1.53
Benchmark_Middleware_BasicAuth - B/op
80
B/op48
B/op1.67
Benchmark_Middleware_BasicAuth - allocs/op
5
allocs/op3
allocs/op1.67
Benchmark_Middleware_BasicAuth_Upper - B/op
80
B/op48
B/op1.67
Benchmark_Middleware_BasicAuth_Upper - allocs/op
5
allocs/op3
allocs/op1.67
Benchmark_CORS_NewHandler - B/op
16
B/op0
B/op+β
Benchmark_CORS_NewHandler - allocs/op
1
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerSingleOrigin - B/op
16
B/op0
B/op+β
Benchmark_CORS_NewHandlerSingleOrigin - allocs/op
1
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerPreflight - B/op
104
B/op0
B/op+β
Benchmark_CORS_NewHandlerPreflight - allocs/op
5
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerPreflightSingleOrigin - B/op
104
B/op0
B/op+β
Benchmark_CORS_NewHandlerPreflightSingleOrigin - allocs/op
5
allocs/op0
allocs/op+β
Benchmark_CORS_NewHandlerPreflightWildcard - B/op
104
B/op0
B/op+β
Benchmark_CORS_NewHandlerPreflightWildcard - allocs/op
5
allocs/op0
allocs/op+β
Benchmark_Middleware_CSRF_GenerateToken - B/op
517
B/op327
B/op1.58
Benchmark_Middleware_CSRF_GenerateToken - allocs/op
10
allocs/op6
allocs/op1.67
This comment was automatically generated by workflow using github-action-benchmark.