14 Commits

Author SHA1 Message Date
Abhiyan Khanal
67cf55e6f1
Merge 3f607b8662710b3602b03817cfc2f171416f6591 into d3ffc9985281dcf4d3bef604cce4e662b1a327a6 2026-03-17 13:55:19 +09:00
tsinglua
6d880724cc
refactor(test): use the built-in max/min to simplify the code (#4576)
Signed-off-by: tsinglua <tsinglua@outlook.com>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2026-03-13 22:42:00 +08:00
Abhiyan Khanal
4a0302068c feat(test): add RunTestHandler to flush status in test contexts
When using CreateTestContext directly to test handlers, ctx.Status()
sets the status internally but it is not flushed to the underlying
httptest.ResponseRecorder. RunTestHandler creates a test context, runs
the handler chain, and calls WriteHeaderNow() so that the status code
is properly reflected in the ResponseWriter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 19:09:51 +05:45
Wayne Aki
f416d1e594
test(gin): resolve race conditions in integration tests (#4453)
- Implement TestRebuild404Handlers to verify 404 handler chain rebuilding
  when global middleware is added via Use()
- Add waitForServerReady helper with exponential backoff to replace
  unreliable time.Sleep() calls in integration tests
- Fix race conditions in TestRunEmpty, TestRunEmptyWithEnv, and
  TestRunWithPort by using proper server readiness checks
- All tests now pass consistently with -race flag

This addresses the empty test function and eliminates flaky test failures
caused by insufficient wait times for server startup.

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2025-11-30 15:38:07 +08:00
諏訪原慶斗
42f93283cf
docs(test): improved GoDoc in test_helpers.go (#4270) 2025-08-02 12:23:20 +08:00
RoCry
55e27f1246
fix(engine): missing route params for CreateTestContext (#2778) (#2803) 2022-11-06 17:08:11 +08:00
thinkerou
4b68a5f12a
chore: update go.mod and remove space from copyright (#3158)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-28 10:42:28 +08:00
田欧
7e64d32269 Attempt to fix #1462 (#1463)
#1462
2018-08-12 10:12:33 +08:00
Dmitry Dorogin
9b7e7bdce6 Add tests for context.Stream (#1433) 2018-08-07 06:44:32 +08:00
Javier Provecho Fernandez
92ddc7d240 docs(test): add missing inline docs 2017-07-02 17:06:53 +02:00
田欧
4ad3baf44e Add license for some files (#940) 2017-06-12 01:04:52 -05:00
Yehezkiel Syamsuhadi
61ba9db5af Make CreateTestContext public without importing net/http/httptest 2016-09-21 12:16:51 +10:00
Miki Tebeka
2fd607be4c Rename to conform with test files naming (closes #580) 2016-04-07 07:33:28 +03:00
danielalves
f831ac80ac Exporting CreateTestContext 2015-06-02 17:16:51 -03:00