Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
oh do not run on windows
  • Loading branch information
mtojek committed Sep 7, 2023
commit 4e6a09c176cd72e5b271ab8e438fd57c964817bb
7 changes: 2 additions & 5 deletions provisioner/terraform/cleanup_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build linux || darwin

package terraform_test

import (
Expand All @@ -6,7 +8,6 @@ import (
"flag"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -163,17 +164,13 @@ func diffFileSystem(t *testing.T, fs afero.Fs) {
}

want, err := os.ReadFile(goldenFile)
if runtime.GOOS == "windows" {
want = bytes.ReplaceAll(want, []byte("\r\n"), []byte("\n"))
}
require.NoError(t, err, "open golden file, run \"make update-golden-files\" and commit the changes")
assert.Empty(t, cmp.Diff(want, actual), "golden file mismatch (-want +got): %s, run \"make update-golden-files\", verify and commit the changes", goldenFile)
}

func dumpFileSystem(t *testing.T, fs afero.Fs) []byte {
var buffer bytes.Buffer
err := afero.Walk(fs, "/", func(path string, info os.FileInfo, err error) error {
path = strings.ReplaceAll(path, "\\", "/") // fix for Windows
_, _ = buffer.WriteString(path)
_ = buffer.WriteByte(' ')
if info.IsDir() {
Expand Down