From 9d0cd24533b9ccdcc4f765eaed45fdc6a13c0700 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Sat, 24 Feb 2024 20:49:40 +0100 Subject: [PATCH] fix: test on CI (#2119) --- .github/workflows/documentation.yml | 2 +- .github/workflows/pr.yml | 4 +-- challenge/dns01/fqdn_test.go | 16 +++++----- providers/dns/cloudns/internal/client_test.go | 30 ++++++++--------- .../dns/cloudxns/internal/client_test.go | 32 +++++++++---------- providers/dns/edgedns/edgedns_test.go | 8 ++--- providers/dns/exoscale/exoscale_test.go | 8 ++--- providers/dns/linode/linode_test.go | 2 +- 8 files changed, 51 insertions(+), 51 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index f19fb1a5..26637201 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest env: GO_VERSION: stable - HUGO_VERSION: ${{vars.HUGO_VERSION}} + HUGO_VERSION: 0.117.0 CGO_ENABLED: 0 steps: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e3db0c30..015d3eba 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -46,10 +46,10 @@ jobs: golangci-lint --version - name: Install Pebble - run: go install github.com/letsencrypt/pebble/v2/cmd/pebble@main + run: go install github.com/letsencrypt/pebble/v2/cmd/pebble@3fe019bbc0a41ed16e2fee31592bb91751acaa47 - name: Install challtestsrv - run: go install github.com/letsencrypt/pebble/v2/cmd/pebble-challtestsrv@main + run: go install github.com/letsencrypt/pebble/v2/cmd/pebble-challtestsrv@3fe019bbc0a41ed16e2fee31592bb91751acaa47 - name: Set up a Memcached server uses: niden/actions-memcached@v7 diff --git a/challenge/dns01/fqdn_test.go b/challenge/dns01/fqdn_test.go index ab7be2a4..70bf01f3 100644 --- a/challenge/dns01/fqdn_test.go +++ b/challenge/dns01/fqdn_test.go @@ -14,13 +14,13 @@ func TestToFqdn(t *testing.T) { }{ { desc: "simple", - domain: "foo.bar.com", - expected: "foo.bar.com.", + domain: "foo.example.com", + expected: "foo.example.com.", }, { desc: "already FQDN", - domain: "foo.bar.com.", - expected: "foo.bar.com.", + domain: "foo.example.com.", + expected: "foo.example.com.", }, } @@ -43,13 +43,13 @@ func TestUnFqdn(t *testing.T) { }{ { desc: "simple", - fqdn: "foo.bar.com.", - expected: "foo.bar.com", + fqdn: "foo.example.", + expected: "foo.example", }, { desc: "already domain", - fqdn: "foo.bar.com", - expected: "foo.bar.com", + fqdn: "foo.example", + expected: "foo.example", }, } diff --git a/providers/dns/cloudns/internal/client_test.go b/providers/dns/cloudns/internal/client_test.go index 554bf008..999bd144 100644 --- a/providers/dns/cloudns/internal/client_test.go +++ b/providers/dns/cloudns/internal/client_test.go @@ -382,62 +382,62 @@ func TestClient_AddTxtRecord(t *testing.T) { { desc: "sub-zone", authID: "myAuthID", - zoneName: "bar.com", - authFQDN: "_acme-challenge.foo.bar.com.", + zoneName: "example.com", + authFQDN: "_acme-challenge.foo.example.com.", value: "txtTXTtxtTXTtxtTXTtxtTXT", ttl: 60, apiResponse: `{"status":"Success","statusDescription":"The record was added successfully."}`, expected: expected{ - query: `auth-id=myAuthID&auth-password=myAuthPassword&domain-name=bar.com&host=_acme-challenge.foo&record=txtTXTtxtTXTtxtTXTtxtTXT&record-type=TXT&ttl=60`, + query: `auth-id=myAuthID&auth-password=myAuthPassword&domain-name=example.com&host=_acme-challenge.foo&record=txtTXTtxtTXTtxtTXTtxtTXT&record-type=TXT&ttl=60`, }, }, { desc: "main zone (authID)", authID: "myAuthID", - zoneName: "bar.com", - authFQDN: "_acme-challenge.bar.com.", + zoneName: "example.com", + authFQDN: "_acme-challenge.example.com.", value: "TXTtxtTXTtxtTXTtxtTXTtxt", ttl: 60, apiResponse: `{"status":"Success","statusDescription":"The record was added successfully."}`, expected: expected{ - query: `auth-id=myAuthID&auth-password=myAuthPassword&domain-name=bar.com&host=_acme-challenge&record=TXTtxtTXTtxtTXTtxtTXTtxt&record-type=TXT&ttl=60`, + query: `auth-id=myAuthID&auth-password=myAuthPassword&domain-name=example.com&host=_acme-challenge&record=TXTtxtTXTtxtTXTtxtTXTtxt&record-type=TXT&ttl=60`, }, }, { desc: "main zone (subAuthID)", subAuthID: "mySubAuthID", - zoneName: "bar.com", - authFQDN: "_acme-challenge.bar.com.", + zoneName: "example.com", + authFQDN: "_acme-challenge.example.com.", value: "TXTtxtTXTtxtTXTtxtTXTtxt", ttl: 60, apiResponse: `{"status":"Success","statusDescription":"The record was added successfully."}`, expected: expected{ - query: `auth-password=myAuthPassword&domain-name=bar.com&host=_acme-challenge&record=TXTtxtTXTtxtTXTtxtTXTtxt&record-type=TXT&sub-auth-id=mySubAuthID&ttl=60`, + query: `auth-password=myAuthPassword&domain-name=example.com&host=_acme-challenge&record=TXTtxtTXTtxtTXTtxtTXTtxt&record-type=TXT&sub-auth-id=mySubAuthID&ttl=60`, }, }, { desc: "invalid status", authID: "myAuthID", - zoneName: "bar.com", - authFQDN: "_acme-challenge.bar.com.", + zoneName: "example.com", + authFQDN: "_acme-challenge.example.com.", value: "TXTtxtTXTtxtTXTtxtTXTtxt", ttl: 120, apiResponse: `{"status":"Failed","statusDescription":"Invalid TTL. Choose from the list of the values we support."}`, expected: expected{ - query: `auth-id=myAuthID&auth-password=myAuthPassword&domain-name=bar.com&host=_acme-challenge&record=TXTtxtTXTtxtTXTtxtTXTtxt&record-type=TXT&ttl=300`, + query: `auth-id=myAuthID&auth-password=myAuthPassword&domain-name=example.com&host=_acme-challenge&record=TXTtxtTXTtxtTXTtxtTXTtxt&record-type=TXT&ttl=300`, errorMsg: "failed to add TXT record: Failed Invalid TTL. Choose from the list of the values we support.", }, }, { desc: "invalid json response", authID: "myAuthID", - zoneName: "bar.com", - authFQDN: "_acme-challenge.bar.com.", + zoneName: "example.com", + authFQDN: "_acme-challenge.example.com.", value: "TXTtxtTXTtxtTXTtxtTXTtxt", ttl: 120, apiResponse: `[{}]`, expected: expected{ - query: `auth-id=myAuthID&auth-password=myAuthPassword&domain-name=bar.com&host=_acme-challenge&record=TXTtxtTXTtxtTXTtxtTXTtxt&record-type=TXT&ttl=300`, + query: `auth-id=myAuthID&auth-password=myAuthPassword&domain-name=example.com&host=_acme-challenge&record=TXTtxtTXTtxtTXTtxtTXTtxt&record-type=TXT&ttl=300`, errorMsg: "unable to unmarshal response: [status code: 200] body: [{}] error: json: cannot unmarshal array into Go value of type internal.apiResponse", }, }, diff --git a/providers/dns/cloudxns/internal/client_test.go b/providers/dns/cloudxns/internal/client_test.go index e4972174..ac4e36d6 100644 --- a/providers/dns/cloudxns/internal/client_test.go +++ b/providers/dns/cloudxns/internal/client_test.go @@ -81,23 +81,23 @@ func TestClient_GetDomainInformation(t *testing.T) { }{ { desc: "domain found", - fqdn: "_acme-challenge.foo.com.", + fqdn: "_acme-challenge.example.org.", response: &apiResponse{ Code: 1, }, data: []Data{ { ID: "1", - Domain: "bar.com.", + Domain: "example.com.", }, { ID: "2", - Domain: "foo.com.", + Domain: "example.org.", }, }, expected: result{domain: &Data{ ID: "2", - Domain: "foo.com.", + Domain: "example.org.", }}, }, { @@ -109,11 +109,11 @@ func TestClient_GetDomainInformation(t *testing.T) { data: []Data{ { ID: "5", - Domain: "bar.com.", + Domain: "example.com.", }, { ID: "6", - Domain: "foo.com.", + Domain: "example.org.", }, }, expected: result{error: true}, @@ -152,13 +152,13 @@ func TestClient_FindTxtRecord(t *testing.T) { }{ { desc: "record found", - fqdn: "_acme-challenge.foo.com.", + fqdn: "_acme-challenge.example.org.", zoneID: "test-zone", txtRecords: []TXTRecord{ { ID: 1, RecordID: "Record-A", - Host: "_acme-challenge.foo.com", + Host: "_acme-challenge.example.org", Value: "txtTXTtxtTXTtxtTXTtxtTXT", Type: "TXT", LineID: 6, @@ -167,7 +167,7 @@ func TestClient_FindTxtRecord(t *testing.T) { { ID: 2, RecordID: "Record-B", - Host: "_acme-challenge.bar.com", + Host: "_acme-challenge.example.com", Value: "TXTtxtTXTtxtTXTtxtTXTtxt", Type: "TXT", LineID: 6, @@ -181,7 +181,7 @@ func TestClient_FindTxtRecord(t *testing.T) { txtRecord: &TXTRecord{ ID: 1, RecordID: "Record-A", - Host: "_acme-challenge.foo.com", + Host: "_acme-challenge.example.org", Value: "txtTXTtxtTXTtxtTXTtxtTXT", Type: "TXT", LineID: 6, @@ -197,7 +197,7 @@ func TestClient_FindTxtRecord(t *testing.T) { { ID: 1, RecordID: "Record-A", - Host: "_acme-challenge.foo.com", + Host: "_acme-challenge.example.org", Value: "txtTXTtxtTXTtxtTXTtxtTXT", Type: "TXT", LineID: 6, @@ -206,7 +206,7 @@ func TestClient_FindTxtRecord(t *testing.T) { { ID: 2, RecordID: "Record-B", - Host: "_acme-challenge.bar.com", + Host: "_acme-challenge.example.com", Value: "TXTtxtTXTtxtTXTtxtTXTtxt", Type: "TXT", LineID: 6, @@ -249,9 +249,9 @@ func TestClient_AddTxtRecord(t *testing.T) { desc: "sub-domain", domain: &Data{ ID: "1", - Domain: "bar.com.", + Domain: "example.com.", }, - fqdn: "_acme-challenge.foo.bar.com.", + fqdn: "_acme-challenge.foo.example.com.", value: "txtTXTtxtTXTtxtTXTtxtTXT", ttl: 30, expected: `{"domain_id":1,"host":"_acme-challenge.foo","value":"txtTXTtxtTXTtxtTXTtxtTXT","type":"TXT","line_id":"1","ttl":"30"}`, @@ -260,9 +260,9 @@ func TestClient_AddTxtRecord(t *testing.T) { desc: "main domain", domain: &Data{ ID: "2", - Domain: "bar.com.", + Domain: "example.com.", }, - fqdn: "_acme-challenge.bar.com.", + fqdn: "_acme-challenge.example.com.", value: "TXTtxtTXTtxtTXTtxtTXTtxt", ttl: 30, expected: `{"domain_id":2,"host":"_acme-challenge","value":"TXTtxtTXTtxtTXTtxtTXTtxt","type":"TXT","line_id":"1","ttl":"30"}`, diff --git a/providers/dns/edgedns/edgedns_test.go b/providers/dns/edgedns/edgedns_test.go index a7f17b16..85302cb5 100644 --- a/providers/dns/edgedns/edgedns_test.go +++ b/providers/dns/edgedns/edgedns_test.go @@ -158,13 +158,13 @@ func TestDNSProvider_findZone(t *testing.T) { }{ { desc: "Extract root record name", - domain: "bar.com.", - expected: "bar.com", + domain: "example.com.", + expected: "example.com", }, { desc: "Extract sub record name", - domain: "foo.bar.com.", - expected: "bar.com", + domain: "foo.example.com.", + expected: "example.com", }, } diff --git a/providers/dns/exoscale/exoscale_test.go b/providers/dns/exoscale/exoscale_test.go index 2aad3fcf..059698cd 100644 --- a/providers/dns/exoscale/exoscale_test.go +++ b/providers/dns/exoscale/exoscale_test.go @@ -144,17 +144,17 @@ func TestDNSProvider_FindZoneAndRecordName(t *testing.T) { }{ { desc: "Extract root record name", - fqdn: "_acme-challenge.bar.com.", + fqdn: "_acme-challenge.example.com.", expected: expected{ - zone: "bar.com", + zone: "example.com", recordName: "_acme-challenge", }, }, { desc: "Extract sub record name", - fqdn: "_acme-challenge.foo.bar.com.", + fqdn: "_acme-challenge.foo.example.com.", expected: expected{ - zone: "bar.com", + zone: "example.com", recordName: "_acme-challenge.foo", }, }, diff --git a/providers/dns/linode/linode_test.go b/providers/dns/linode/linode_test.go index 7b12cbdd..70b33eda 100644 --- a/providers/dns/linode/linode_test.go +++ b/providers/dns/linode/linode_test.go @@ -197,7 +197,7 @@ func TestDNSProvider_Present(t *testing.T) { Page: 1, }, Data: []linodego.Domain{{ - Domain: "foobar.com", + Domain: "example.com", ID: 1234, }}, },