Skip to content

Commit 368427a

Browse files
committed
fix: skip reg.ru tests on CI
1 parent a824cab commit 368427a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

providers/dns/regru/internal/client_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package internal
22

33
import (
4+
"net/http"
5+
"os"
46
"testing"
7+
"time"
58

69
"github.com/stretchr/testify/require"
710
)
@@ -17,12 +20,18 @@ func TestRemoveRecord(t *testing.T) {
1720
t.Skip("there is a bug with the reg.ru API: INTERNAL_API_ERROR: Внутренняя ошибка, status code: 503")
1821

1922
client := NewClient(officialTestUser, officialTestPassword)
23+
client.HTTPClient = &http.Client{Timeout: 30 * time.Second}
2024

2125
err := client.RemoveTxtRecord("test.ru", "_acme-challenge", "txttxttxt")
2226
require.NoError(t, err)
2327
}
2428

2529
func TestRemoveRecord_errors(t *testing.T) {
30+
// TODO(ldez): remove skip when the reg.ru API will be fixed.
31+
if os.Getenv("CI") == "true" {
32+
t.Skip("there is a bug with the reg.ru and GitHub action: dial tcp 194.58.116.30:443: i/o timeout")
33+
}
34+
2635
testCases := []struct {
2736
desc string
2837
domain string
@@ -55,6 +64,8 @@ func TestRemoveRecord_errors(t *testing.T) {
5564
t.Parallel()
5665

5766
client := NewClient(test.username, test.username)
67+
client.HTTPClient = &http.Client{Timeout: 30 * time.Second}
68+
client.BaseURL = test.baseURL
5869

5970
err := client.RemoveTxtRecord(test.domain, "_acme-challenge", "txttxttxt")
6071
require.EqualError(t, err, test.expected)
@@ -67,12 +78,18 @@ func TestAddTXTRecord(t *testing.T) {
6778
t.Skip("there is a bug with the reg.ru API: INTERNAL_API_ERROR: Внутренняя ошибка, status code: 503")
6879

6980
client := NewClient(officialTestUser, officialTestPassword)
81+
client.HTTPClient = &http.Client{Timeout: 30 * time.Second}
7082

7183
err := client.AddTXTRecord("test.ru", "_acme-challenge", "txttxttxt")
7284
require.NoError(t, err)
7385
}
7486

7587
func TestAddTXTRecord_errors(t *testing.T) {
88+
// TODO(ldez): remove skip when the reg.ru API will be fixed.
89+
if os.Getenv("CI") == "true" {
90+
t.Skip("there is a bug with the reg.ru and GitHub action: dial tcp 194.58.116.30:443: i/o timeout")
91+
}
92+
7693
testCases := []struct {
7794
desc string
7895
domain string
@@ -105,6 +122,8 @@ func TestAddTXTRecord_errors(t *testing.T) {
105122
t.Parallel()
106123

107124
client := NewClient(test.username, test.username)
125+
client.HTTPClient = &http.Client{Timeout: 30 * time.Second}
126+
client.BaseURL = test.baseURL
108127

109128
err := client.AddTXTRecord(test.domain, "_acme-challenge", "txttxttxt")
110129
require.EqualError(t, err, test.expected)

0 commit comments

Comments
 (0)