mirror of
https://github.com/go-acme/lego
synced 2026-03-14 14:35:48 +01:00
chore: revert Windows skip tests
This commit is contained in:
parent
ceabd686b7
commit
5c5ef84bcb
3 changed files with 8 additions and 32 deletions
|
|
@ -4,7 +4,6 @@ import (
|
|||
"encoding/json"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/go-acme/lego/v5/cmd/internal/configuration"
|
||||
|
|
@ -13,12 +12,6 @@ import (
|
|||
)
|
||||
|
||||
func TestArchiver_Accounts(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
// The error is:
|
||||
// TempDir RemoveAll cleanup: unlinkat C:\Users\RUNNER~1\AppData\Local\Temp\xxx: The process cannot access the file because it is being used by another process.
|
||||
t.Skip("skipping test on Windows")
|
||||
}
|
||||
|
||||
cfg := &configuration.Configuration{
|
||||
Storage: t.TempDir(),
|
||||
Accounts: map[string]*configuration.Account{
|
||||
|
|
@ -70,6 +63,8 @@ func generateFakeAccountFiles(t *testing.T, accountsBasePath, server, keyType, a
|
|||
file, err := os.Create(filename)
|
||||
require.NoError(t, err)
|
||||
|
||||
defer func() { _ = file.Close() }()
|
||||
|
||||
r := Account{ID: accountID}
|
||||
|
||||
err = json.NewEncoder(file).Encode(r)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/go-acme/lego/v5/certificate"
|
||||
|
|
@ -15,12 +14,6 @@ import (
|
|||
)
|
||||
|
||||
func TestArchiver_Certificates(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
// The error is:
|
||||
// TempDir RemoveAll cleanup: unlinkat C:\Users\RUNNER~1\AppData\Local\Temp\xxx: The process cannot access the file because it is being used by another process.
|
||||
t.Skip("skipping test on Windows")
|
||||
}
|
||||
|
||||
domain := "example.com"
|
||||
archiveDomain := "example.org"
|
||||
|
||||
|
|
@ -64,12 +57,6 @@ func TestArchiver_Certificates(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestArchiver_archiveCertificate(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
// The error is:
|
||||
// TempDir RemoveAll cleanup: unlinkat C:\Users\RUNNER~1\AppData\Local\Temp\xxx: The process cannot access the file because it is being used by another process.
|
||||
t.Skip("skipping test on Windows")
|
||||
}
|
||||
|
||||
domain := "example.com"
|
||||
|
||||
archiver := NewArchiver(t.TempDir())
|
||||
|
|
@ -95,12 +82,6 @@ func TestArchiver_archiveCertificate(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestArchiver_archiveCertificate_noFileRelatedToDomain(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
// The error is:
|
||||
// TempDir RemoveAll cleanup: unlinkat C:\Users\RUNNER~1\AppData\Local\Temp\xxx: The process cannot access the file because it is being used by another process.
|
||||
t.Skip("skipping test on Windows")
|
||||
}
|
||||
|
||||
domain := "example.com"
|
||||
|
||||
archiver := NewArchiver(t.TempDir())
|
||||
|
|
@ -122,12 +103,6 @@ func TestArchiver_archiveCertificate_noFileRelatedToDomain(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestArchiver_archiveCertificate_ambiguousDomain(t *testing.T) {
|
||||
if runtime.GOOS == "windows" {
|
||||
// The error is:
|
||||
// TempDir RemoveAll cleanup: unlinkat C:\Users\RUNNER~1\AppData\Local\Temp\xxx: The process cannot access the file because it is being used by another process.
|
||||
t.Skip("skipping test on Windows")
|
||||
}
|
||||
|
||||
domain := "example.com"
|
||||
|
||||
archiver := NewArchiver(t.TempDir())
|
||||
|
|
@ -191,6 +166,8 @@ func generateFakeCertificateFiles(t *testing.T, dir, domain string) []string {
|
|||
file, err := os.Create(filename)
|
||||
require.NoError(t, err)
|
||||
|
||||
defer func() { _ = file.Close() }()
|
||||
|
||||
r := certificate.Resource{ID: domain}
|
||||
|
||||
err = json.NewEncoder(file).Encode(r)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ func compressDirectory(name, dir, comment string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
defer func() { _ = file.Close() }()
|
||||
|
||||
writer := zip.NewWriter(file)
|
||||
|
||||
defer func() { _ = writer.Close() }()
|
||||
|
|
@ -38,6 +40,8 @@ func compressFiles(dest string, files []string, comment string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
defer func() { _ = file.Close() }()
|
||||
|
||||
writer := zip.NewWriter(file)
|
||||
|
||||
defer func() { _ = writer.Close() }()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue