fiber/middleware
Giovanni Rivera f8b490f89e
🔥 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 <835733+gaby@users.noreply.github.com>
2024-11-22 08:43:38 +01:00
..
adaptor 🐛 fix: Improve naming convention for Context returning functions (#3193) 2024-11-13 16:12:19 +01:00
basicauth v3: Use Named Fields Instead of Positional and Align Structures to Reduce Memory Usage (#3079) 2024-07-23 08:37:45 +02:00
cache 🐛 fix: Improve naming convention for Context returning functions (#3193) 2024-11-13 16:12:19 +01:00
compress 🔥 Feature: Add TestConfig to app.Test() for configurable testing (#3161) 2024-11-22 08:43:38 +01:00
cors 🔥Feature: Add support for TrustProxy (#3170) 2024-10-17 08:29:03 +02:00
csrf feat!(middleware/session): re-write session middleware with handler (#3016) 2024-10-25 08:36:30 +02:00
earlydata 🔥Feature: Add support for TrustProxy (#3170) 2024-10-17 08:29:03 +02:00
encryptcookie chore: Bump golangci-lint to v1.60.3 (#3119) 2024-09-02 15:38:59 +02:00
envvar v3: Use Named Fields Instead of Positional and Align Structures to Reduce Memory Usage (#3079) 2024-07-23 08:37:45 +02:00
etag 🐛 fix: Improve naming convention for Context returning functions (#3193) 2024-11-13 16:12:19 +01:00
expvar 🐛 fix: Improve naming convention for Context returning functions (#3193) 2024-11-13 16:12:19 +01:00
favicon v3: Use Named Fields Instead of Positional and Align Structures to Reduce Memory Usage (#3079) 2024-07-23 08:37:45 +02:00
healthcheck feat: Add Startup Probe to Healthcheck Middleware (#3069) 2024-07-18 13:54:44 +02:00
helmet v3: Use Named Fields Instead of Positional and Align Structures to Reduce Memory Usage (#3079) 2024-07-23 08:37:45 +02:00
idempotency 🔥 Feature: Add TestConfig to app.Test() for configurable testing (#3161) 2024-11-22 08:43:38 +01:00
keyauth 🔥 Feature: Add TestConfig to app.Test() for configurable testing (#3161) 2024-11-22 08:43:38 +01:00
limiter Bump golangci-lint to v1.62.0 (#3196) 2024-11-11 10:37:27 +01:00
logger 🔥 Feature: Add TestConfig to app.Test() for configurable testing (#3161) 2024-11-22 08:43:38 +01:00
pprof 🔥 Feature: Add TestConfig to app.Test() for configurable testing (#3161) 2024-11-22 08:43:38 +01:00
proxy 🔥 Feature: Add TestConfig to app.Test() for configurable testing (#3161) 2024-11-22 08:43:38 +01:00
recover v3: Use Named Fields Instead of Positional and Align Structures to Reduce Memory Usage (#3079) 2024-07-23 08:37:45 +02:00
redirect 🐛 fix: Improve naming convention for Context returning functions (#3193) 2024-11-13 16:12:19 +01:00
requestid 🔥 feat: Add Context Support to RequestID Middleware (#3200) 2024-11-15 17:34:20 +01:00
rewrite v3: Add Benchmarks for Rewrite Middleware (#3092) 2024-07-26 16:55:00 +02:00
session feat!(middleware/session): re-write session middleware with handler (#3016) 2024-10-25 08:36:30 +02:00
skip Merge remote-tracking branch 'origin/master' into v3-beta 2023-08-05 22:02:01 +03:00
static 🔥 Feature: Add TestConfig to app.Test() for configurable testing (#3161) 2024-11-22 08:43:38 +01:00
timeout 🐛 fix: Improve naming convention for Context returning functions (#3193) 2024-11-13 16:12:19 +01:00