chore: revert Windows skip tests

This commit is contained in:
Fernandez Ludovic 2026-03-11 20:42:38 +01:00
commit 5c5ef84bcb
3 changed files with 8 additions and 32 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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() }()