Skip to content

Commit 8f74954

Browse files
feat: add test sets for SSE port, protocol config, and port mapping (#212)
- Add /ping endpoint on HTTP mux and new ping server on :8050 - SKIP_PING_SERVER env var to disable ping server for port mapping CI tests - Record port-config-test: mixed HTTP (:8000) + SSE (:8047) requests - Record port-mapping-test: requests to :8050 for port mapping validation - Update keploy.yml with ssePort, protocol config, and per-test-set port mapping
1 parent 037e85b commit 8f74954

15 files changed

Lines changed: 731 additions & 2 deletions

File tree

http-sse/keploy.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,22 @@ test:
3333
url:
3434
"localhost:8003": "localhost:8000"
3535
"localhost:8004": "localhost:8000"
36-
sse:
37-
url:
36+
sse:
37+
url:
3838
"doubt.local": "localhost:8047"
39+
port-mapping-test:
40+
port:
41+
8050: 8000
3942
delay: 5
4043
host: ""
4144
port: 0
4245
grpcPort: 0
46+
ssePort: 8047
47+
protocol:
48+
http:
49+
port: 8000
50+
sse:
51+
port: 8047
4352
apiTimeout: 5
4453
skipCoverage: false
4554
coverageReportPath: ""
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-1
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://localhost:8000/health
12+
header:
13+
Accept: '*/*'
14+
Host: localhost:8000
15+
User-Agent: curl/8.5.0
16+
body: ""
17+
timestamp: 2026-03-26T12:50:44.335119622Z
18+
resp:
19+
status_code: 200
20+
header:
21+
Content-Length: "24"
22+
Content-Type: application/json
23+
Date: Thu, 26 Mar 2026 12:50:44 GMT
24+
body: |
25+
{"ok":true,"port":8000}
26+
status_message: OK
27+
proto_major: 0
28+
proto_minor: 0
29+
timestamp: 2026-03-26T12:50:44.335453935Z
30+
objects: []
31+
assertions:
32+
noise:
33+
header.Date: []
34+
created: 1774529444
35+
app_port: 8000
36+
curl: |
37+
curl --request GET \
38+
--url http://localhost:8000/health \
39+
--header 'Accept: */*' \
40+
--header 'Host: localhost:8000' \
41+
--header 'User-Agent: curl/8.5.0' \
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-2
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://localhost:8000/health
12+
header:
13+
Accept: '*/*'
14+
Host: localhost:8000
15+
User-Agent: curl/8.5.0
16+
body: ""
17+
timestamp: 2026-03-26T12:50:47.341688677Z
18+
resp:
19+
status_code: 200
20+
header:
21+
Content-Length: "24"
22+
Content-Type: application/json
23+
Date: Thu, 26 Mar 2026 12:50:47 GMT
24+
body: |
25+
{"ok":true,"port":8000}
26+
status_message: OK
27+
proto_major: 0
28+
proto_minor: 0
29+
timestamp: 2026-03-26T12:50:47.341870089Z
30+
objects: []
31+
assertions:
32+
noise:
33+
header.Date: []
34+
created: 1774529447
35+
app_port: 8000
36+
curl: |
37+
curl --request GET \
38+
--url http://localhost:8000/health \
39+
--header 'User-Agent: curl/8.5.0' \
40+
--header 'Accept: */*' \
41+
--header 'Host: localhost:8000' \
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-3
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://localhost:8000/api/hello
12+
header:
13+
Accept: '*/*'
14+
Host: localhost:8000
15+
User-Agent: curl/8.5.0
16+
body: ""
17+
timestamp: 2026-03-26T12:50:48.346822466Z
18+
resp:
19+
status_code: 200
20+
header:
21+
Content-Length: "38"
22+
Content-Type: application/json
23+
Date: Thu, 26 Mar 2026 12:50:48 GMT
24+
body: |
25+
{"msg":"hello from http","port":8000}
26+
status_message: OK
27+
proto_major: 0
28+
proto_minor: 0
29+
timestamp: 2026-03-26T12:50:48.347062708Z
30+
objects: []
31+
assertions:
32+
noise:
33+
header.Date: []
34+
created: 1774529448
35+
app_port: 8000
36+
curl: |
37+
curl --request GET \
38+
--url http://localhost:8000/api/hello \
39+
--header 'Host: localhost:8000' \
40+
--header 'User-Agent: curl/8.5.0' \
41+
--header 'Accept: */*' \
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-4
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://localhost:8000/api/echo?msg=porttest
12+
url_params:
13+
msg: porttest
14+
header:
15+
Accept: '*/*'
16+
Host: localhost:8000
17+
User-Agent: curl/8.5.0
18+
body: ""
19+
timestamp: 2026-03-26T12:50:49.352282873Z
20+
resp:
21+
status_code: 200
22+
header:
23+
Content-Length: "32"
24+
Content-Type: application/json
25+
Date: Thu, 26 Mar 2026 12:50:49 GMT
26+
body: |
27+
{"echo":"porttest","port":8000}
28+
status_message: OK
29+
proto_major: 0
30+
proto_minor: 0
31+
timestamp: 2026-03-26T12:50:49.352454614Z
32+
objects: []
33+
assertions:
34+
noise:
35+
header.Date: []
36+
created: 1774529449
37+
app_port: 8000
38+
curl: |
39+
curl --request GET \
40+
--url http://localhost:8000/api/echo?msg=porttest \
41+
--header 'User-Agent: curl/8.5.0' \
42+
--header 'Accept: */*' \
43+
--header 'Host: localhost:8000' \
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-5
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://localhost:8000/api/add?a=10&b=20
12+
url_params:
13+
a: "10"
14+
b: "20"
15+
header:
16+
Accept: '*/*'
17+
Host: localhost:8000
18+
User-Agent: curl/8.5.0
19+
body: ""
20+
timestamp: 2026-03-26T12:50:50.358125729Z
21+
resp:
22+
status_code: 200
23+
header:
24+
Content-Length: "37"
25+
Content-Type: application/json
26+
Date: Thu, 26 Mar 2026 12:50:50 GMT
27+
body: |
28+
{"a":10,"b":20,"port":8000,"sum":30}
29+
status_message: OK
30+
proto_major: 0
31+
proto_minor: 0
32+
timestamp: 2026-03-26T12:50:50.358338811Z
33+
objects: []
34+
assertions:
35+
noise:
36+
header.Date: []
37+
created: 1774529450
38+
app_port: 8000
39+
curl: |
40+
curl --request GET \
41+
--url http://localhost:8000/api/add?a=10&b=20 \
42+
--header 'Accept: */*' \
43+
--header 'Host: localhost:8000' \
44+
--header 'User-Agent: curl/8.5.0' \
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-6
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://localhost:8000/api/resource/99
12+
header:
13+
Accept: '*/*'
14+
Host: localhost:8000
15+
User-Agent: curl/8.5.0
16+
body: ""
17+
timestamp: 2026-03-26T12:50:51.363736261Z
18+
resp:
19+
status_code: 200
20+
header:
21+
Content-Length: "51"
22+
Content-Type: application/json
23+
Date: Thu, 26 Mar 2026 12:50:51 GMT
24+
body: |
25+
{"fixed":true,"id":"99","port":8000,"type":"demo"}
26+
status_message: OK
27+
proto_major: 0
28+
proto_minor: 0
29+
timestamp: 2026-03-26T12:50:51.363948263Z
30+
objects: []
31+
assertions:
32+
noise:
33+
header.Date: []
34+
created: 1774529451
35+
app_port: 8000
36+
curl: |
37+
curl --request GET \
38+
--url http://localhost:8000/api/resource/99 \
39+
--header 'Accept: */*' \
40+
--header 'Host: localhost:8000' \
41+
--header 'User-Agent: curl/8.5.0' \
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Generated by Keploy (3-dev)
2+
version: api.keploy.io/v1beta1
3+
kind: Http
4+
name: test-7
5+
spec:
6+
metadata: {}
7+
req:
8+
method: GET
9+
proto_major: 1
10+
proto_minor: 1
11+
url: http://localhost:8047/subscribe/student/events?doubtId=port-test-1
12+
url_params:
13+
doubtId: port-test-1
14+
header:
15+
Accept: text/event-stream
16+
Host: localhost:8047
17+
User-Agent: curl/8.5.0
18+
body: ""
19+
timestamp: 2026-03-26T12:50:52.371652738Z
20+
resp:
21+
status_code: 200
22+
header:
23+
Access-Control-Allow-Origin: '*'
24+
Cache-Control: no-cache
25+
Connection: keep-alive
26+
Content-Type: text/event-stream; charset=utf-8
27+
Date: Thu, 26 Mar 2026 12:50:52 GMT
28+
body:
29+
- ts: "2026-03-26T12:50:52.371930021Z"
30+
data:
31+
event: TICKER
32+
data: '[{"message_id":"ticker-1","message_type":"TICKER","message":{"id":"port-test-1","kind":"student","timestamp":1774529452371}}]'
33+
- ts: "2026-03-26T12:50:52.371930021Z"
34+
data:
35+
event: message
36+
data: '[{"message_id":"msg-1","message_type":"SYSTEM","message":{"timestamp":1774529453375,"title":"student stream message 1"}}]'
37+
- ts: "2026-03-26T12:50:52.371930021Z"
38+
data:
39+
event: message
40+
data: '[{"message_id":"msg-2","message_type":"SYSTEM","message":{"timestamp":1774529454379,"title":"student stream message 2"}}]'
41+
- ts: "2026-03-26T12:50:52.371930021Z"
42+
data:
43+
event: message
44+
data: '[{"message_id":"msg-3","message_type":"SYSTEM","message":{"timestamp":1774529455383,"title":"student stream message 3"}}]'
45+
- ts: "2026-03-26T12:50:52.371930021Z"
46+
data:
47+
event: message
48+
data: '[{"message_id":"msg-4","message_type":"SYSTEM","message":{"timestamp":1774529456385,"title":"student stream message 4"}}]'
49+
- ts: "2026-03-26T12:50:52.371930021Z"
50+
data:
51+
event: message
52+
data: '[{"message_id":"msg-5","message_type":"SYSTEM","message":{"timestamp":1774529457388,"title":"student stream message 5"}}]'
53+
- ts: "2026-03-26T12:50:52.371930021Z"
54+
data:
55+
event: message
56+
data: '[{"message_id":"msg-6","message_type":"SYSTEM","message":{"timestamp":1774529458394,"title":"student stream message 6"}}]'
57+
- ts: "2026-03-26T12:50:52.371930021Z"
58+
data:
59+
event: message
60+
data: '[{"message_id":"msg-7","message_type":"SYSTEM","message":{"timestamp":1774529459397,"title":"student stream message 7"}}]'
61+
- ts: "2026-03-26T12:50:52.371930021Z"
62+
data:
63+
event: message
64+
data: '[{"message_id":"msg-8","message_type":"SYSTEM","message":{"timestamp":1774529460401,"title":"student stream message 8"}}]'
65+
- ts: "2026-03-26T12:50:52.371930021Z"
66+
data:
67+
event: message
68+
data: '[{"message_id":"msg-9","message_type":"SYSTEM","message":{"timestamp":1774529461405,"title":"student stream message 9"}}]'
69+
- ts: "2026-03-26T12:50:52.371930021Z"
70+
data:
71+
event: message
72+
data: '[{"message_id":"msg-10","message_type":"SYSTEM","message":{"timestamp":1774529462406,"title":"student stream message 10"}}]'
73+
- ts: "2026-03-26T12:50:52.371930021Z"
74+
data:
75+
event: message
76+
data: '[{"message_id":"msg-11","message_type":"SYSTEM","message":{"timestamp":1774529463406,"title":"student stream message 11"}}]'
77+
- ts: "2026-03-26T12:50:52.371930021Z"
78+
data:
79+
event: message
80+
data: '[{"message_id":"msg-12","message_type":"SYSTEM","message":{"timestamp":1774529464407,"title":"student stream message 12"}}]'
81+
- ts: "2026-03-26T12:50:52.371930021Z"
82+
data:
83+
event: message
84+
data: '[{"message_id":"msg-13","message_type":"SYSTEM","message":{"timestamp":1774529465410,"title":"student stream message 13"}}]'
85+
- ts: "2026-03-26T12:50:52.371930021Z"
86+
data:
87+
event: message
88+
data: '[{"message_id":"msg-14","message_type":"SYSTEM","message":{"timestamp":1774529466414,"title":"student stream message 14"}}]'
89+
- ts: "2026-03-26T12:50:52.371930021Z"
90+
data:
91+
event: message
92+
data: '[{"message_id":"msg-15","message_type":"SYSTEM","message":{"timestamp":1774529467417,"title":"student stream message 15"}}]'
93+
status_message: OK
94+
proto_major: 0
95+
proto_minor: 0
96+
timestamp: 2026-03-26T12:50:52.371930021Z
97+
objects: []
98+
assertions:
99+
noise:
100+
header.Date: []
101+
created: 1774529467
102+
app_port: 8047
103+
curl: |
104+
curl --request GET \
105+
--url http://localhost:8047/subscribe/student/events?doubtId=port-test-1 \
106+
--header 'Accept: text/event-stream' \
107+
--header 'Host: localhost:8047' \
108+
--header 'User-Agent: curl/8.5.0' \

0 commit comments

Comments
 (0)