Skip to content

Commit 221bd11

Browse files
Fix tfgen test (#3094)
There's something weird going on with mixing the MemFs and OsFs which causes the test to fail on macos. This PR switches the test to just use a normal OsFs for the test. fixes #3092
1 parent bde4b60 commit 221bd11

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pkg/tests/schema_generation_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,16 @@ func Test_GenerateWithOverlay(t *testing.T) {
367367

368368
for _, tc := range testCases {
369369
t.Run(tc.name, func(t *testing.T) {
370-
root := afero.NewMemMapFs()
370+
osFs := afero.NewOsFs()
371+
tempDir := t.TempDir()
372+
root := afero.NewBasePathFs(osFs, tempDir)
371373

372374
err := afero.WriteFile(root, tc.overlayFileName, tc.overlayFileContent, 0o600)
373375
require.NoError(t, err)
374376

377+
err = root.MkdirAll(moduleName, 0o700)
378+
require.NoError(t, err)
379+
375380
err = afero.WriteFile(root, filepath.Join(moduleName, tc.overlayModFileName), tc.overlayModFileContent, 0o600)
376381
require.NoError(t, err)
377382

pkg/tfbridge/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ type providerOptions struct {
6262

6363
type providerOption func(providerOptions) (providerOptions, error)
6464

65-
func WithDefaultZeroSchemaVersion() providerOption { //nolint:revive
65+
func WithDefaultZeroSchemaVersion() providerOption {
6666
return func(opts providerOptions) (providerOptions, error) {
6767
opts.defaultZeroSchemaVersion = true
6868
return opts, nil

0 commit comments

Comments
 (0)