mirror of
https://github.com/TwiN/gatus.git
synced 2026-02-14 19:52:28 +00:00
fix(client): Switch websocket library (#1423)
* fix(websocket): switch to gorilla/websocket * fix(client): add missing t.Parallel() in tests --------- Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
)
|
||||
|
||||
func TestGetHTTPClient(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := &Config{
|
||||
Insecure: false,
|
||||
IgnoreRedirect: false,
|
||||
@@ -42,6 +43,7 @@ func TestGetHTTPClient(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRdapQuery(t *testing.T) {
|
||||
t.Parallel()
|
||||
if _, err := rdapQuery("1.1.1.1"); err == nil {
|
||||
t.Error("expected an error due to the invalid domain type")
|
||||
}
|
||||
@@ -288,6 +290,7 @@ func TestCanPerformTLS(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCanCreateConnection(t *testing.T) {
|
||||
t.Parallel()
|
||||
connected, _ := CanCreateNetworkConnection("tcp", "127.0.0.1", "", &Config{Timeout: 5 * time.Second})
|
||||
if connected {
|
||||
t.Error("should've failed, because there's no port in the address")
|
||||
@@ -302,6 +305,7 @@ func TestCanCreateConnection(t *testing.T) {
|
||||
// performs a Client Credentials OAuth2 flow and adds the obtained token as a `Authorization`
|
||||
// header to all outgoing HTTP calls.
|
||||
func TestHttpClientProvidesOAuth2BearerToken(t *testing.T) {
|
||||
t.Parallel()
|
||||
defer InjectHTTPClient(nil)
|
||||
oAuth2Config := &OAuth2Config{
|
||||
ClientID: "00000000-0000-0000-0000-000000000000",
|
||||
@@ -357,6 +361,7 @@ func TestHttpClientProvidesOAuth2BearerToken(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestQueryWebSocket(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, _, err := QueryWebSocket("", "body", nil, &Config{Timeout: 2 * time.Second})
|
||||
if err == nil {
|
||||
t.Error("expected an error due to the address being invalid")
|
||||
@@ -368,6 +373,7 @@ func TestQueryWebSocket(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTlsRenegotiation(t *testing.T) {
|
||||
t.Parallel()
|
||||
scenarios := []struct {
|
||||
name string
|
||||
cfg TLSConfig
|
||||
@@ -411,6 +417,7 @@ func TestTlsRenegotiation(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestQueryDNS(t *testing.T) {
|
||||
t.Parallel()
|
||||
scenarios := []struct {
|
||||
name string
|
||||
inputDNS dns.Config
|
||||
@@ -540,6 +547,7 @@ func TestQueryDNS(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCheckSSHBanner(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := &Config{Timeout: 3}
|
||||
t.Run("no-auth-ssh", func(t *testing.T) {
|
||||
connected, status, err := CheckSSHBanner("tty.sdf.org", cfg)
|
||||
|
||||
Reference in New Issue
Block a user