Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the eject test empty directory check #684

Merged
merged 1 commit into from Dec 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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