-
Couldn't load subscription status.
- Fork 128
Validate JSON output file before unmarshall #1298
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
Conversation
|
/test |
|
/test |
internal/testrunner/runners/system/servicedeployer/terraform.go
Outdated
Show resolved
Hide resolved
internal/testrunner/runners/system/servicedeployer/terraform_test.go
Outdated
Show resolved
Hide resolved
| if !json.Valid(content) { | ||
| logger.Debug("Invalid Json content in the terraform output file, skipped creating outputs") | ||
| return nil | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if aws_logs has an invalid json here? Would the test package fail if that happens ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The system test fails on the package if there is an invalid json because the output is not available in the system test config
💚 Build Succeeded
History
cc @bhapas |
This reverts commit 5ad8bd8.
The terraform output file sometimes is empty and json unmarshall throws an error.
The fix is to validate the json file before unmarshalling it.