Skip to content

Commit

Permalink
Fix the eject test empty directory check
Browse files Browse the repository at this point in the history
  • Loading branch information
Frassle committed Dec 13, 2022
1 parent 4bcd47b commit 5fa01d6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/tf2pulumi/convert/eject_test.go
Expand Up @@ -144,10 +144,13 @@ func TestEject(t *testing.T) {

// Assert every pcl file is seen
infos, err := os.ReadDir(pclPath)
if os.IsNotExist(err) || !assert.NoError(t, err) {
return
if !os.IsNotExist(err) && !assert.NoError(t, err) {
// If the directory was not found then the expected pcl results are the empty set, but if the
// directory could not be read because of filesystem issues than just error out.
assert.FailNow(t, "Could not read expected pcl results")
}
pclFiles := make(map[string]interface{})
// infos will just be nil if pclPath did not exist
for _, info := range infos {
if !info.IsDir() {
pclFiles[info.Name()] = nil
Expand Down

0 comments on commit 5fa01d6

Please sign in to comment.