You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/README.md
+6-15Lines changed: 6 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,7 @@ This directory contains tests for the gen_http HTTP client library.
4
4
5
5
## Test Infrastructure
6
6
7
-
Tests use a local Docker-based infrastructure instead of making requests to external websites. This provides:
8
-
9
-
-**Reliability**: Tests don't fail due to network issues
10
-
-**Speed**: Local requests are much faster
11
-
-**Control**: We control the test server behavior
12
-
-**Privacy**: No external requests during development
7
+
Tests run against local Docker containers instead of hitting external websites. This means tests won't randomly fail from network issues, they run faster, and you're not leaking requests during development.
13
8
14
9
### Test Server Setup
15
10
@@ -65,19 +60,19 @@ docker compose -f test/support/docker-compose.yml down -v
65
60
66
61
## Test Server Endpoints
67
62
68
-
The local httpbin service provides the following endpoints:
63
+
httpbin gives you these endpoints:
69
64
70
65
-`GET /get` - Returns GET request data
71
66
-`POST /post` - Returns POST request data
72
67
-`GET /status/{code}` - Returns specified HTTP status code
73
68
-`GET /delay/{seconds}` - Delays response
74
69
-`GET /redirect/{n}` - 302 redirect n times
75
70
-`POST /anything` - Returns anything sent
76
-
-And many more (see[httpbin.org](https://httpbin.org/) for full API)
71
+
-Plus more at[httpbin.org](https://httpbin.org/)
77
72
78
73
## Configuration
79
74
80
-
Test server ports can be configured via environment variables:
75
+
Change ports with environment variables:
81
76
82
77
-`HTTPBIN_HTTP_PORT` (default: 8080) - HTTP server port
83
78
-`HTTPBIN_HTTPS_PORT` (default: 8443) - HTTPS server port
@@ -101,15 +96,11 @@ If tests are being skipped with "Test server not available", ensure:
101
96
102
97
### Port conflicts
103
98
104
-
If ports 8080 or 8443 are already in use:
105
-
106
-
1. Stop conflicting services
107
-
2. Or change ports in `.env` file
108
-
3. Restart Docker Compose
99
+
If ports 8080 or 8443 are already in use, either stop whatever's using them or change the ports in `.env` and restart docker compose.
109
100
110
101
### SSL certificate errors
111
102
112
-
The Caddy server uses self-signed certificates for local testing. Tests should use the `verify_none`SSL option:
103
+
Caddy uses self-signed certificates for local testing. Use `verify_none`in your tests:
0 commit comments