From 368427a621d6e7ae39b5cee174e7f6c1cd9d6f0e Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 3 Jan 2023 02:45:25 +0100 Subject: [PATCH] fix: skip reg.ru tests on CI --- providers/dns/regru/internal/client_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/providers/dns/regru/internal/client_test.go b/providers/dns/regru/internal/client_test.go index e89331e8..0b7e7771 100644 --- a/providers/dns/regru/internal/client_test.go +++ b/providers/dns/regru/internal/client_test.go @@ -1,7 +1,10 @@ package internal import ( + "net/http" + "os" "testing" + "time" "github.com/stretchr/testify/require" ) @@ -17,12 +20,18 @@ func TestRemoveRecord(t *testing.T) { t.Skip("there is a bug with the reg.ru API: INTERNAL_API_ERROR: Внутренняя ошибка, status code: 503") client := NewClient(officialTestUser, officialTestPassword) + client.HTTPClient = &http.Client{Timeout: 30 * time.Second} err := client.RemoveTxtRecord("test.ru", "_acme-challenge", "txttxttxt") require.NoError(t, err) } func TestRemoveRecord_errors(t *testing.T) { + // TODO(ldez): remove skip when the reg.ru API will be fixed. + if os.Getenv("CI") == "true" { + t.Skip("there is a bug with the reg.ru and GitHub action: dial tcp 194.58.116.30:443: i/o timeout") + } + testCases := []struct { desc string domain string @@ -55,6 +64,8 @@ func TestRemoveRecord_errors(t *testing.T) { t.Parallel() client := NewClient(test.username, test.username) + client.HTTPClient = &http.Client{Timeout: 30 * time.Second} + client.BaseURL = test.baseURL err := client.RemoveTxtRecord(test.domain, "_acme-challenge", "txttxttxt") require.EqualError(t, err, test.expected) @@ -67,12 +78,18 @@ func TestAddTXTRecord(t *testing.T) { t.Skip("there is a bug with the reg.ru API: INTERNAL_API_ERROR: Внутренняя ошибка, status code: 503") client := NewClient(officialTestUser, officialTestPassword) + client.HTTPClient = &http.Client{Timeout: 30 * time.Second} err := client.AddTXTRecord("test.ru", "_acme-challenge", "txttxttxt") require.NoError(t, err) } func TestAddTXTRecord_errors(t *testing.T) { + // TODO(ldez): remove skip when the reg.ru API will be fixed. + if os.Getenv("CI") == "true" { + t.Skip("there is a bug with the reg.ru and GitHub action: dial tcp 194.58.116.30:443: i/o timeout") + } + testCases := []struct { desc string domain string @@ -105,6 +122,8 @@ func TestAddTXTRecord_errors(t *testing.T) { t.Parallel() client := NewClient(test.username, test.username) + client.HTTPClient = &http.Client{Timeout: 30 * time.Second} + client.BaseURL = test.baseURL err := client.AddTXTRecord(test.domain, "_acme-challenge", "txttxttxt") require.EqualError(t, err, test.expected)