Skip to content

Commit 9e4f709

Browse files
committed
update test
1 parent 660945b commit 9e4f709

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

test/e2e/crds/v2/route.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,11 +2146,10 @@ spec:
21462146

21472147
By("verify wss connection")
21482148
hostname := "api6.com"
2149-
conn, err := s.NewWebsocketClient(&tls.Config{
2149+
conn := s.NewWebsocketClient(&tls.Config{
21502150
InsecureSkipVerify: true,
21512151
ServerName: hostname,
21522152
}, "/ws", http.Header{"Host": []string{hostname}})
2153-
Expect(err).ShouldNot(HaveOccurred(), "creating WebSocket client")
21542153

21552154
defer func() {
21562155
_ = conn.Close()

test/e2e/gatewayapi/httproute.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,19 +2506,18 @@ spec:
25062506

25072507
By("verify wss connection")
25082508
hostname := "api6.com"
2509-
conn, err := s.NewWebsocketClient(&tls.Config{
2509+
conn := s.NewWebsocketClient(&tls.Config{
25102510
InsecureSkipVerify: true,
25112511
ServerName: hostname,
25122512
}, "/ws", http.Header{"Host": []string{hostname}})
2513-
Expect(err).ShouldNot(HaveOccurred(), "creating WebSocket client")
25142513

25152514
defer func() {
25162515
_ = conn.Close()
25172516
}()
25182517

25192518
By("send and receive message through WebSocket")
25202519
testMessage := "hello, this is APISIX"
2521-
err = conn.WriteMessage(websocket.TextMessage, []byte(testMessage))
2520+
err := conn.WriteMessage(websocket.TextMessage, []byte(testMessage))
25222521
Expect(err).ShouldNot(HaveOccurred(), "writing WebSocket message")
25232522

25242523
// Then our echo

test/e2e/ingress/ingress.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,19 +1071,18 @@ spec:
10711071

10721072
By("verify wss connection")
10731073
hostname := "api6.com"
1074-
conn, err := s.NewWebsocketClient(&tls.Config{
1074+
conn := s.NewWebsocketClient(&tls.Config{
10751075
InsecureSkipVerify: true,
10761076
ServerName: hostname,
10771077
}, "/ws", http.Header{"Host": []string{hostname}})
1078-
Expect(err).ShouldNot(HaveOccurred(), "creating WebSocket client")
10791078

10801079
defer func() {
10811080
_ = conn.Close()
10821081
}()
10831082

10841083
By("send and receive message through WebSocket")
10851084
testMessage := "hello, this is APISIX"
1086-
err = conn.WriteMessage(websocket.TextMessage, []byte(testMessage))
1085+
err := conn.WriteMessage(websocket.TextMessage, []byte(testMessage))
10871086
Expect(err).ShouldNot(HaveOccurred(), "writing WebSocket message")
10881087

10891088
// Then our echo

test/e2e/scaffold/scaffold.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ func (s *Scaffold) GetMetricsEndpoint() string {
558558
return fmt.Sprintf("http://%s/metrics", tunnel.Endpoint())
559559
}
560560

561-
func (s *Scaffold) NewWebsocketClient(tls *tls.Config, path string, headers http.Header) (*websocket.Conn, error) {
561+
func (s *Scaffold) NewWebsocketClient(tls *tls.Config, path string, headers http.Header) *websocket.Conn {
562562
var host = s.ApisixHTTPEndpoint()
563563
var scheme = "ws"
564564
if tls != nil {
@@ -589,5 +589,5 @@ func (s *Scaffold) NewWebsocketClient(tls *tls.Config, path string, headers http
589589
conn = c
590590
return nil
591591
}).ShouldNot(HaveOccurred(), "establishing websocket connection")
592-
return conn, nil
592+
return conn
593593
}

0 commit comments

Comments
 (0)